AGXDynamics  2.31.1.0
Gear.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2021. 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 setViscousDamping( agx::Real viscousDamping );
157 
161  agx::Real getViscousDamping() const;
162 
163  public: // Methods called by AGX.
164 
165  virtual agx::RegularizationParameters::VariableType calculateComplianceAndDamping(
166  const agx::Real timeStep, agx::Real& compliance, agx::Real& damping) override;
167 
168  virtual agx::Real calculateViolation() const override;
169 
170  virtual bool postUpdate(agx::Real timeStep) override;
171  virtual bool removeNotification(agxUtil::ConstraintHolder* holder, agxSDK::Simulation* simulation) override;
172 
173 #ifndef SWIG
174  virtual agxPowerLine::PhysicalDimensionMultiBodyConstraintImplementation* createConstraint() override;
175 #endif
176 
177 #ifndef SWIG
178 
181  virtual bool store(agxStream::StorageStream& str) const override;
182 
186  virtual bool restore(agxStream::StorageStream& str) override;
187 
189 #endif
190 
191  protected:
192  virtual ~HolonomicGear();
193 
196 
198  };
199 
201 }
agx::ref_ptr< HolonomicGear > HolonomicGearRef
Definition: Gear.h:200
Utility class to hold custom implementations of constraints.
Definition: agxUtil.h:384
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:197
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:206
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:121
#define AGXMODEL_EXPORT
double Real
Definition: Real.h:42
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:102
agx::ref_ptr< SlipGear > SlipGearRef
Definition: Gear.h:130
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:101
agx::Real m_gearRatio
Definition: Gear.h:82