AGX Dynamics  2.35.0.1
Gear.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
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 
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
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:
97 
101  void setViscousCompliance( agx::Real viscousCompliance );
102 
107 
108  public:
110  const agx::Real timeStep, agx::Real& compliance, agx::Real& damping) override;
111 
112 #ifndef SWIG
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:
142 
147 
152 
156  void rebind();
157 
161  void setViscousDamping( agx::Real viscousDamping );
162 
167 
168  public: // Methods called by AGX.
169 
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
180 #endif
181 
182 #ifndef SWIG
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 }
#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 AGXMODEL_EXPORT
A gear is a connector between two rotational units.
Definition: Gear.h:35
agx::Real m_gearRatio
Definition: Gear.h:82
void setGearRatio(agx::Real ratio)
Set the gear ratio.
Gear(agx::Real ratio)
Create a gear with the given gear ratio.
agx::Real getGearRatio() const
Gear()
Create a gear with gear ratio 1.
virtual bool restore(agxStream::StorageStream &str) override
Restores internal data from stream.
virtual bool store(agxStream::StorageStream &str) const override
Stores internal data into stream.
A Gear that uses a holonomic constraint instead of the default nonholonomic contstraint.
Definition: Gear.h:139
void rebind()
Will set both input and output angle to zero, to remove all potential energy.
virtual bool postUpdate(agx::Real timeStep) override
agx::Real getOutputAngle() const
The angle, including winding, of the output unit.
virtual bool removeNotification(agxUtil::ConstraintHolder *holder, agxSDK::Simulation *simulation) override
remove connector and constraint from simulation
virtual agx::Real calculateViolation() const override
calculate violation for constraint
agx::Real m_viscousDamping
Definition: Gear.h:202
agx::Real getViscousDamping() const
virtual agxPowerLine::PhysicalDimensionMultiBodyConstraintImplementation * createConstraint() override
Create a gear constraint.
virtual bool store(agxStream::StorageStream &str) const override
Stores internal data into stream.
void setViscousDamping(agx::Real viscousDamping)
Set the fixed damping.
agx::Real getInputAngle() const
The angle, including winding, of the input unit.
virtual bool restore(agxStream::StorageStream &str) override
Restores internal data from stream.
virtual agx::RegularizationParameters::VariableType calculateComplianceAndDamping(const agx::Real timeStep, agx::Real &compliance, agx::Real &damping) override
Calculate a compliance that will result in the wanted efficiency.
Defines a viscous coupling between two rotational dimensions.
Definition: Gear.h:94
agx::Real getViscousCompliance() const
void setViscousCompliance(agx::Real viscousCompliance)
Set the fixed compliance.
agx::Real m_viscousCompliance
Definition: Gear.h:128
virtual agx::RegularizationParameters::VariableType calculateComplianceAndDamping(const agx::Real timeStep, agx::Real &compliance, agx::Real &damping) override
Calculate a compliance that will result in the wanted efficiency.
virtual bool restore(agxStream::StorageStream &str) override
Restores internal data from stream.
virtual bool store(agxStream::StorageStream &str) const override
Stores internal data into stream.
Constraint implementation for constraining a number of physical dimensions of the same type.
Defines a stiff gear constraint between two rotational dimensions.
virtual bool store(agxStream::StorageStream &str) const override
Stores internal data into stream.
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:127
Abstract base class for storing/restoring a line/drums with version control.
Definition: StorageStream.h:49
Utility class to hold custom implementations of constraints.
Definition: agxUtil.h:464
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:97
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:96
A library of agxPowerLine components designed to model the various parts of a vehicle drive train.
agx::ref_ptr< HolonomicGear > HolonomicGearRef
Definition: Gear.h:205
agx::ref_ptr< Gear > GearRef
Definition: Gear.h:85
agx::ref_ptr< SlipGear > SlipGearRef
Definition: Gear.h:130
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
double Real
Definition: Real.h:42