AGXDynamics  2.35.0.2
TrackProperties.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #pragma once
18 
19 #include <agxVehicle/export.h>
20 
21 #include <agx/Hinge.h>
22 #include <agx/BitState.h>
23 #include <agx/agx_vector_types.h>
24 
25 namespace agxVehicle
26 {
28 
33  {
34  public:
39 
44  void setHingeCompliance( agx::Real compliance );
45 
51  void setHingeCompliance( agx::Real compliance, agx::Hinge::DOF dof );
52 
57  void setHingeComplianceTranslational( agx::Real compliance );
58 
63  void setHingeComplianceRotational( agx::Real compliance );
64 
68  agx::Real getHingeCompliance( agx::Hinge::DOF dof ) const;
69 
74  void setHingeDamping( agx::Real damping );
75 
81  void setHingeDamping(agx::Real damping, agx::Hinge::DOF dof);
82 
87  void setHingeDampingTranslational(agx::Real damping);
88 
93  void setHingeDampingRotational(agx::Real damping);
94 
98  agx::Real getHingeDamping( agx::Hinge::DOF dof ) const;
99 
105  void setEnableHingeRange( agx::Bool enable );
106 
110  agx::Bool getEnableHingeRange() const;
111 
117  void setHingeRangeRange( agx::Real lowerAngle, agx::Real upperAngle );
118 
122  agx::RangeReal getHingeRangeRange() const;
123 
131  void setEnableOnInitializeMergeNodesToWheels( agx::Bool enable );
132 
136  agx::Bool getEnableOnInitializeMergeNodesToWheels() const;
137 
144  void setEnableOnInitializeTransformNodesToWheels( agx::Bool enable );
145 
149  agx::Bool getEnableOnInitializeTransformNodesToWheels() const;
150 
155  void setTransformNodesToWheelsOverlap( agx::Real overlap );
156 
160  agx::Real getTransformNodesToWheelsOverlap() const;
161 
170  void setNodesToWheelsMergeThreshold( agx::Real mergeThreshold );
171 
175  agx::Real getNodesToWheelsMergeThreshold() const;
176 
185  void setNodesToWheelsSplitThreshold( agx::Real splitThreshold );
186 
190  agx::Real getNodesToWheelsSplitThreshold() const;
191 
198  void setNumNodesIncludedInAverageDirection( agx::UInt numIncludedNodes );
199 
203  agx::UInt getNumNodesIncludedInAverageDirection() const;
204 
212  void setMinStabilizingHingeNormalForce( agx::Real minNormalForce );
213 
217  agx::Real getMinStabilizingHingeNormalForce() const;
218 
226  void setStabilizingHingeFrictionParameter( agx::Real frictionParameter );
227 
231  agx::Real getStabilizingHingeFrictionParameter() const;
232 
236  void resetToDefault();
237 
242  void updateComplianceDamping( agx::Hinge& hinge ) const;
243 
244  public:
246 
247  protected:
249  {
250  ON_INITIALIZE_MERGE_NODES_TO_WHEELS = 1 << 0,
251  ON_INITIALIZE_TRANSFORM_NODES_TO_WHEELS = 1 << 1,
252  HINGE_RANGE_ENABLED = 1 << 2,
253  };
254  using Flags = agx::BitState<FlagsEnum, agx::UInt32>;
255 
257  {
266  NUM_REAL_VALUES
267  };
269 
270  protected:
274  virtual ~TrackProperties();
275 
276  private:
277  Flags m_flags;
278  RealValues m_realValues;
279  agx::Real m_hingeCompliance[ 5 ];
280  agx::Real m_hingeDamping[ 5 ];
281  };
282 
284  {
285  return m_hingeCompliance[ (agx::UInt)std::max<int>( dof, 0 ) ];
286  }
287 
289  {
290  return m_hingeDamping[ (agx::UInt)std::max<int>( dof, 0 ) ];
291  }
292 
294  {
295  return m_flags.Is( HINGE_RANGE_ENABLED );
296  }
297 
299  {
300  return agx::RangeReal{ m_realValues[ HINGE_RANGE_LOWER ], m_realValues[ HINGE_RANGE_UPPER ] };
301  }
302 }
agxVehicle::TrackProperties::Flags
agx::BitState< FlagsEnum, agx::UInt32 > Flags
Definition: TrackProperties.h:254
agxVehicle::TrackProperties::HINGE_RANGE_UPPER
@ HINGE_RANGE_UPPER
Definition: TrackProperties.h:259
agx::Real
double Real
Definition: Real.h:42
Hinge.h
BitState.h
agx::RealValue
agxData::ValueT< agx::Real > RealValue
Definition: generated_container_typedefs.h:34
agxStream::Serializable
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Definition: Serializable.h:44
export.h
agxVehicle::TrackProperties::NODE_TO_WHEEL_MERGE_THRESHOLD
@ NODE_TO_WHEEL_MERGE_THRESHOLD
Definition: TrackProperties.h:261
AGXSTREAM_DECLARE_SERIALIZABLE
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
Definition: Serializable.h:207
agx::VectorPOD< Real >
agxVehicle::TrackProperties::getHingeDamping
agx::Real getHingeDamping(agx::Hinge::DOF dof) const
Definition: TrackProperties.h:288
agxVehicle::TrackProperties::getEnableHingeRange
agx::Bool getEnableHingeRange() const
Definition: TrackProperties.h:293
agx::RealVector
VectorPOD< Real > RealVector
Definition: agx_vector_types.h:111
agxVehicle
This namespace contains classes related to vehicles dynamics.
Definition: AckermannSteering.h:22
agxVehicle::TrackProperties::getHingeRangeRange
agx::RangeReal getHingeRangeRange() const
Definition: TrackProperties.h:298
agxVehicle::TrackProperties::STABILIZING_FRICTION_PARAMETER
@ STABILIZING_FRICTION_PARAMETER
Definition: TrackProperties.h:265
agx::Referenced
Base class providing referencing counted objects.
Definition: Referenced.h:113
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
agxVehicle::TrackProperties::NUM_NODES_IN_AVERAGE_DIRECTION
@ NUM_NODES_IN_AVERAGE_DIRECTION
Definition: TrackProperties.h:263
agxVehicle::TrackProperties::HINGE_RANGE_LOWER
@ HINGE_RANGE_LOWER
Definition: TrackProperties.h:258
agx::UInt
uint32_t UInt
Definition: Integer.h:34
agxVehicle::TrackProperties
Object containing properties of an agxVehicle::Track.
Definition: TrackProperties.h:32
agx::Bool
bool Bool
Definition: Integer.h:48
agxVehicle::TrackProperties::MIN_STABILIZING_NORMAL_FORCE
@ MIN_STABILIZING_NORMAL_FORCE
Definition: TrackProperties.h:264
agx::Hinge
The hinge constraint between two rigid bodies or one rigid body and the world.
Definition: Hinge.h:103
AGXVEHICLE_EXPORT
#define AGXVEHICLE_EXPORT
Definition: agxVehicle/export.h:38
agx::Range< Real >
agxVehicle::TrackProperties::NODE_TO_WHEEL_SPLIT_THRESHOLD
@ NODE_TO_WHEEL_SPLIT_THRESHOLD
Definition: TrackProperties.h:262
agxVehicle::TrackProperties::NODE_TO_WHEEL_OVERLAP
@ NODE_TO_WHEEL_OVERLAP
Definition: TrackProperties.h:260
agxVehicle::TrackProperties::HINGE_RANGE_ENABLED
@ HINGE_RANGE_ENABLED
Definition: TrackProperties.h:252
agxVehicle::TrackProperties::FlagsEnum
FlagsEnum
Definition: TrackProperties.h:248
agx::UInt32
uint32_t UInt32
Definition: Integer.h:40
agx_vector_types.h
agxVehicle::TrackProperties::getHingeCompliance
agx::Real getHingeCompliance(agx::Hinge::DOF dof) const
Definition: TrackProperties.h:283
agx::Hinge::DOF
DOF
Enum used for specifying which Degree of Freedom (DOF) that should be accessed in calls to for exampl...
Definition: Hinge.h:151