AGX Dynamics  2.37.2.0
Gear.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
9 having been advised so by Algoryx Simulation AB for a time limited evaluation,
10 or having purchased a 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 <agx/Hinge.h>
20 
21 #include <agxPowerLine/PowerLine.h>
24 
25 
26 namespace agxDriveTrain
27 {
35  {
36  public:
40  Gear();
41 
45  explicit Gear(agx::Real ratio);
46 
50  void setGearRatio(agx::Real ratio);
51 
55  agx::Real getGearRatio() const;
56 
57 
58  public:
60  virtual agx::RegularizationParameters::VariableType calculateComplianceAndDamping(
61  const agx::Real timeStep, agx::Real& compliance, agx::Real& damping) override;
63 
64 #ifndef SWIG
65 
68  virtual bool store(agxStream::StorageStream& str) const override;
69 
71 
75  virtual bool restore(agxStream::StorageStream& str) override;
76 
78 #endif
79 
80  protected:
81  virtual ~Gear();
83  };
84 
86 
87 
88 
94  {
95  public:
96  SlipGear();
97 
101  void setViscousCompliance( agx::Real viscousCompliance );
102 
106  agx::Real getViscousCompliance() const;
107 
108  public:
109  virtual agx::RegularizationParameters::VariableType calculateComplianceAndDamping(
110  const agx::Real timeStep, agx::Real& compliance, agx::Real& damping) override;
111 
112 #ifndef SWIG
113 
116  virtual bool store(agxStream::StorageStream& str) const override;
117 
121  virtual bool restore(agxStream::StorageStream& str) override;
122 
124 #endif
125 
126  protected:
127  virtual ~SlipGear();
129  };
131 
132 
133 
139  {
140  public:
141  HolonomicGear();
142 
146  agx::Real getInputAngle() const;
147 
151  agx::Real getOutputAngle() const;
152 
156  void rebind();
157 
161  void setViscousDamping( agx::Real viscousDamping );
162 
166  agx::Real getViscousDamping() const;
167 
168  public: // Methods called by AGX.
169 
170  virtual agx::RegularizationParameters::VariableType calculateComplianceAndDamping(
171  const agx::Real timeStep, agx::Real& compliance, agx::Real& damping) override;
172 
173  virtual agx::Real calculateViolation() const override;
174 
175  virtual bool postUpdate(agx::Real timeStep) override;
176  virtual bool removeNotification(agxUtil::ConstraintHolder* holder, agxSDK::Simulation* simulation) override;
177 
178 #ifndef SWIG
179  virtual agxPowerLine::PhysicalDimensionMultiBodyConstraintImplementation* createConstraint() override;
180 #endif
181 
182 #ifndef SWIG
183 
186  virtual bool store(agxStream::StorageStream& str) const override;
187 
191  virtual bool restore(agxStream::StorageStream& str) override;
192 
194 #endif
195 
196  protected:
197  virtual ~HolonomicGear();
198 
201 
203  };
204 
206 }
agx::ref_ptr< HolonomicGear > HolonomicGearRef
Definition: Gear.h:205
Utility class to hold custom implementations of constraints.
Definition: agxUtil.h:463
Defines a viscous coupling between two rotational dimensions.
Definition: Gear.h:93
Constraint implementation for constraining a number of physical dimensions of the same type...
agx::Real m_viscousDamping
Definition: Gear.h:202
A library of agxPowerLine components designed to model the various parts of a vehicle drive train...
virtual bool store(agxStream::StorageStream &str) const override
Stores internal data into stream.
agx::ref_ptr< Gear > GearRef
Definition: Gear.h:85
A Gear that uses a holonomic constraint instead of the default nonholonomic contstraint.
Definition: Gear.h:138
Defines a stiff gear constraint between two rotational dimensions.
A gear is a connector between two rotational units.
Definition: Gear.h:34
agx::Real m_viscousCompliance
Definition: Gear.h:128
Abstract base class for storing/restoring a line/drums with version control.
Definition: StorageStream.h:48
#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
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:126
#define AGXMODEL_EXPORT
double Real
Definition: Real.h:42
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:98
agx::ref_ptr< SlipGear > SlipGearRef
Definition: Gear.h:130
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:97
agx::Real m_gearRatio
Definition: Gear.h:82