AGX Dynamics  2.37.3.2
WheelJoint.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. 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 #include <agx/Constraint.h>
21 
22 
23 namespace agxVehicle
24 {
25 
27 
28 
32  class CALLABLE AGXVEHICLE_EXPORT WheelJointFrame : public agx::ConstraintFrame
33  {
34  public:
35 
46  WheelJointFrame( agx::Vec3 point, agx::Vec3 wheelAxle, agx::Vec3 steeringAxle );
47 
48  };
49 
50 
51 
74  public:
75 
82  WheelJoint( const WheelJointFrame& wjf, agx::RigidBody* rb1, agx::RigidBody* rb2 );
83 
92  WheelJoint(agx::RigidBody* rb1, agx::RigidBody* rb2, const agx::Vec3& center, const agx::Vec3& axis);
93 
94 
107  WheelJoint(agx::RigidBody* rb1, agx::Frame* rb1AttachmentFrame, agx::RigidBody* rb2 = nullptr,
108  agx::Frame* rb2AttachmentFrame = nullptr);
109 
110 
115  agx::RigidBody* getWheelRigidBody();
116 
121  agx::RigidBody* getChassisRigidBody();
122 
127  enum DOF {
128  ALL_DOF = -1,
129  TRANSLATIONAL_1 = 0,
130  TRANSLATIONAL_2 = 1,
131  ROTATIONAL_1 = 3,
132  NUM_DOF = 3
133  };
134 
139  STEERING = 0,
140  WHEEL = 1,
141  SUSPENSION = 2,
143  STEERINGCONSTRAINT_BOUNDS = 3,
146  NUM_FREEDOF = 3
147  };
148 
152  int getNumDOF() const override;
153 
157  agx::Motor1D* getMotor1D(SecondaryConstraint sc);
158 
162  agx::Lock1D* getLock1D(SecondaryConstraint sc);
163 
167  agx::Range1D* getRange1D(SecondaryConstraint sc);
168 
169 
173  agx::Real getAngle( SecondaryConstraint sc = STEERING ) const;
174 
178  void render(class agxRender::RenderManager* mgr, float scale) const override;
179 
181 
182  WheelJoint();
183 
184  protected:
185  virtual ~WheelJoint();
186 
187  private:
188  class WheelJointImplementation* m_implementation;
189  };
190 
191 } //namespace agx
#define AGXVEHICLE_EXPORT
Helper class to define reference frames for WheelJoint.
Definition: WheelJoint.h:32
The base class for a constraint.
Definition: Constraint.h:88
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
Class for managing the rendering of geometries, shapes, rigid bodies, constraints etc...
Elementary secondary constraint to keep constraint angle at a given target position.
Elementary secondary constraint to keep constraint angle within two given values. ...
DOF
Enum used for specifying which Degree of Freedom (DOF) that should be accessed in calls to for exampl...
Definition: WheelJoint.h:127
The wheel constraint is designed to attach two bodies such that one of them is free to rotate about a...
Definition: WheelJoint.h:73
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:54
#define CALLABLE
Definition: Object.h:73
This namespace contains classes related to vehicles dynamics.
The object defining a frame of reference and providing transformations operations.
Definition: Frame.h:67
#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
Elementary secondary constraint to drive something given target speed (translational or rotational)...
SecondaryConstraint
Enum for specifying which secondary constraint to access.
Definition: WheelJoint.h:138
double Real
Definition: Real.h:42
Real getAngle(const Vec3 &a, const Vec3 &b, const Vec3 &c)
a and b should be orthogonal