AGX Dynamics  2.35.0.1
WheelJoint.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 #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 
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 
116 
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 
158 
163 
168 
169 
173  agx::Real getAngle( SecondaryConstraint sc = STEERING ) const;
174 
178  void render(class agxRender::RenderManager* mgr, float scale) const override;
179 
181 
183 
184  protected:
185  virtual ~WheelJoint();
186 
187  private:
188  class WheelJointImplementation* m_implementation;
189  };
190 
191 } //namespace agx
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
#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
#define AGXVEHICLE_EXPORT
Class for managing the rendering of geometries, shapes, rigid bodies, constraints etc.
Helper class to define reference frames for WheelJoint.
Definition: WheelJoint.h:33
WheelJointFrame(agx::Vec3 point, agx::Vec3 wheelAxle, agx::Vec3 steeringAxle)
The WheelJoint has a direction for the wheel axle, a direction for the steering axle which must be or...
The wheel constraint is designed to attach two bodies such that one of them is free to rotate about a...
Definition: WheelJoint.h:73
agx::Lock1D * getLock1D(SecondaryConstraint sc)
WheelJoint(agx::RigidBody *rb1, agx::Frame *rb1AttachmentFrame, agx::RigidBody *rb2=nullptr, agx::Frame *rb2AttachmentFrame=nullptr)
Create wheel given body attachment frames and one or two rigid bodies.
int getNumDOF() const override
agx::Real getAngle(SecondaryConstraint sc=STEERING) const
void render(class agxRender::RenderManager *mgr, float scale) const override
Perform debug rendering of this constraint via agxRender::RenderManager.
agx::RigidBody * getWheelRigidBody()
Get the rigid body of the wheel.
WheelJoint(const WheelJointFrame &wjf, agx::RigidBody *rb1, agx::RigidBody *rb2)
Construct a WheelJoint from a WheelJointFrame and bodies.
agx::Motor1D * getMotor1D(SecondaryConstraint sc)
WheelJoint(agx::RigidBody *rb1, agx::RigidBody *rb2, const agx::Vec3 &center, const agx::Vec3 &axis)
Constructor to create a wheel from two rigid bodies, a center point and a steering/suspension axis.
agx::RigidBody * getChassisRigidBody()
Get the rigid body of the chassis.
DOF
Enum used for specifying which Degree of Freedom (DOF) that should be accessed in calls to for exampl...
Definition: WheelJoint.h:127
agx::Range1D * getRange1D(SecondaryConstraint sc)
SecondaryConstraint
Enum for specifying which secondary constraint to access.
Definition: WheelJoint.h:138
The base class for a constraint.
Definition: Constraint.h:89
The object defining a frame of reference and providing transformations operations.
Definition: agx/Frame.h:68
Elementary secondary constraint to keep constraint angle at a given target position.
Elementary secondary constraint to keep constraint angle within two given values.
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:55
Elementary secondary constraint to drive something given target speed (translational or rotational).
#define CALLABLE
Definition: macros.h:72
This namespace contains classes related to vehicles dynamics.
double Real
Definition: Real.h:42