AGX Dynamics
2.38.0.2
GearBox.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 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 <
agxPowerLine/PowerLine.h
>
20
#include <
agxPowerLine/PowerLineConstraints.h
>
21
#include <
agxPowerLine/Connector.h
>
22
23
namespace
agxDriveTrain
24
{
29
class
AGXMODEL_EXPORT
GearBox
:
public
agxPowerLine::RotationalConnector
30
{
31
public
:
37
GearBox
();
38
43
GearBox
(
const
agx::RealVector
& gears);
44
48
void
setGearRatios(
const
agx::RealVector
& gearRatios);
49
53
size_t
getNumGears( )
const
;
54
59
agx::Real
getTorque()
const
;
60
64
bool
gearUp();
65
69
bool
gearDown();
70
74
bool
setGear(
int
gearIndex);
75
79
int
getGear()
const
;
80
84
agx::Real
getGearRatio(
int
gearIndex)
const
;
85
89
agx::Real
getCurrentGearRatio()
const
;
90
91
virtual
void
initConstraint()
override
;
92
93
virtual
agx::RegularizationParameters::VariableType
calculateComplianceAndDamping(
94
const
agx::Real
timeStep,
agx::Real
& compliance,
agx::Real
& damping)
override
;
95
96
#ifndef SWIG
97
100
virtual
bool
store(
agxStream::StorageStream
& str)
const override
;
101
105
virtual
bool
restore(
agxStream::StorageStream
& str)
override
;
106
107
AGXSTREAM_DECLARE_SERIALIZABLE
(
agxDriveTrain::GearBox
);
108
#endif
109
110
protected
:
111
virtual
~
GearBox
();
112
114
agx::Real
getCurrentRatio()
const
;
115
116
agx::RealVector
m_gearTable
;
117
size_t
m_currentGear
;
118
};
119
typedef
agx::ref_ptr<GearBox>
GearBoxRef
;
120
}
PowerLine.h
agx::Real
double Real
Definition:
Real.h:42
agx::RegularizationParameters::VariableType
VariableType
Definition:
RegularizationParameters.h:32
agxDriveTrain::GearBox::m_currentGear
size_t m_currentGear
Definition:
GearBox.h:117
agxDriveTrain
A library of agxPowerLine components designed to model the various parts of a vehicle drive train.
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
agx::VectorPOD< Real >
agxDriveTrain::GearBoxRef
agx::ref_ptr< GearBox > GearBoxRef
Definition:
GearBox.h:119
PowerLineConstraints.h
agxDriveTrain::GearBox::m_gearTable
agx::RealVector m_gearTable
Definition:
GearBox.h:116
agx::ref_ptr< GearBox >
Connector.h
agxDriveTrain::GearBox
The gear box can have an arbitrary number of gears.
Definition:
GearBox.h:29
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
include
agxDriveTrain
GearBox.h
Generated on Sun Sep 1 2024 11:18:38 for AGX Dynamics by
1.8.17