AGX Dynamics
2.38.0.2
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
>
22
#include <
agxPowerLine/RotationalUnit.h
>
23
#include <
agxPowerLine/PowerLineConstraints.h
>
24
25
26
namespace
agxDriveTrain
27
{
34
class
AGXMODEL_EXPORT
Gear
:
public
agxPowerLine::RotationalConnector
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
:
59
DOXYGEN_START_INTERNAL_BLOCK
()
60
virtual
agx::RegularizationParameters::VariableType
calculateComplianceAndDamping(
61
const
agx::Real
timeStep,
agx::Real
& compliance,
agx::Real
& damping)
override
;
62
DOXYGEN_END_INTERNAL_BLOCK
()
63
64
#ifndef SWIG
65
68
virtual
bool
store(
agxStream::StorageStream
& str)
const override
;
69
70
using
agxPowerLine::RotationalConnector::store
;
71
75
virtual
bool
restore(
agxStream::StorageStream
& str)
override
;
76
77
AGXSTREAM_DECLARE_SERIALIZABLE
(
agxDriveTrain::Gear
);
78
#endif
79
80
protected
:
81
virtual
~
Gear
();
82
agx::Real
m_gearRatio
;
83
};
84
85
typedef
agx::ref_ptr<Gear>
GearRef
;
86
87
88
93
class
AGXMODEL_EXPORT
SlipGear
:
public
agxDriveTrain::Gear
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
123
AGXSTREAM_DECLARE_SERIALIZABLE
(
agxDriveTrain::SlipGear
);
124
#endif
125
126
protected
:
127
virtual
~
SlipGear
();
128
agx::Real
m_viscousCompliance
;
129
};
130
typedef
agx::ref_ptr<SlipGear>
SlipGearRef
;
131
132
133
138
class
AGXMODEL_EXPORT
HolonomicGear
:
public
agxDriveTrain::SlipGear
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
193
AGXSTREAM_DECLARE_SERIALIZABLE
(
agxDriveTrain::HolonomicGear
);
194
#endif
195
196
protected
:
197
virtual
~
HolonomicGear
();
198
199
agx::Real
m_inputAngle
;
200
agx::Real
m_outputAngle
;
201
202
agx::Real
m_viscousDamping
;
203
};
204
205
typedef
agx::ref_ptr<HolonomicGear>
HolonomicGearRef
;
206
}
agxDriveTrain::Gear::m_gearRatio
agx::Real m_gearRatio
Definition:
Gear.h:82
RotationalUnit.h
PowerLine.h
agx::Real
double Real
Definition:
Real.h:42
Hinge.h
agx::RegularizationParameters::VariableType
VariableType
Definition:
RegularizationParameters.h:32
DOXYGEN_END_INTERNAL_BLOCK
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition:
macros.h:97
agxDriveTrain
A library of agxPowerLine components designed to model the various parts of a vehicle drive train.
agxUtil::ConstraintHolder
Utility class to hold custom implementations of constraints.
Definition:
agxUtil.h:463
agxDriveTrain::HolonomicGearRef
agx::ref_ptr< HolonomicGear > HolonomicGearRef
Definition:
Gear.h:205
agxPowerLine::PhysicalDimensionMultiBodyConstraintImplementation
Constraint implementation for constraining a number of physical dimensions of the same type.
Definition:
PowerLineConstraints.h:149
DOXYGEN_START_INTERNAL_BLOCK
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition:
macros.h:96
agxDriveTrain::HolonomicGear::m_outputAngle
agx::Real m_outputAngle
Definition:
Gear.h:200
agxDriveTrain::HolonomicGear::m_inputAngle
agx::Real m_inputAngle
Definition:
Gear.h:199
agxStream::StorageStream
Abstract base class for storing/restoring a line/drums with version control.
Definition:
StorageStream.h:48
AGXSTREAM_DECLARE_SERIALIZABLE
#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
PowerLineConstraints.h
agx::ref_ptr< Gear >
agxPowerLine::RotationalConnector::store
virtual bool store(agxStream::StorageStream &str) const override
Stores internal data into stream.
agxSDK::Simulation
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition:
Simulation.h:125
agxDriveTrain::GearRef
agx::ref_ptr< Gear > GearRef
Definition:
Gear.h:85
agxDriveTrain::HolonomicGear
A Gear that uses a holonomic constraint instead of the default nonholonomic contstraint.
Definition:
Gear.h:138
agxDriveTrain::SlipGear
Defines a viscous coupling between two rotational dimensions.
Definition:
Gear.h:93
agxPowerLine::RotationalConnector
Defines a stiff gear constraint between two rotational dimensions.
Definition:
RotationalDimension.h:154
AGXMODEL_EXPORT
#define AGXMODEL_EXPORT
Definition:
agxModel/export.h:42
agxDriveTrain::Gear
A gear is a connector between two rotational units.
Definition:
Gear.h:34
agxDriveTrain::SlipGear::m_viscousCompliance
agx::Real m_viscousCompliance
Definition:
Gear.h:128
agxDriveTrain::HolonomicGear::m_viscousDamping
agx::Real m_viscousDamping
Definition:
Gear.h:202
agxDriveTrain::SlipGearRef
agx::ref_ptr< SlipGear > SlipGearRef
Definition:
Gear.h:130
include
agxDriveTrain
Gear.h
Generated on Sun Sep 1 2024 11:18:38 for AGX Dynamics by
1.8.17