AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
GearBox.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#pragma once
18
22
23namespace agxDriveTrain
24{
30 {
31 public:
38
43 GearBox(const agx::RealVector& gears);
44
48 void setGearRatios(const agx::RealVector& gearRatios);
49
53 size_t getNumGears( ) const;
54
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
90
91 virtual void initConstraint() override;
92
94 const agx::Real timeStep, agx::Real& compliance, agx::Real& damping) override;
95
96#ifndef SWIG
100 virtual bool store(agxStream::StorageStream& str) const override;
101
105 virtual bool restore(agxStream::StorageStream& str) override;
106
108#endif
109
110 protected:
111 virtual ~GearBox();
112
115
118 };
120}
#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
The gear box can have an arbitrary number of gears.
Definition: GearBox.h:30
virtual void initConstraint() override
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.
GearBox(const agx::RealVector &gears)
Create a gear box with the given gear ratios.
agx::Real getTorque() const
Get current load torque, i.e., the torque applied on the output.
virtual bool store(agxStream::StorageStream &str) const override
Stores internal data into stream.
bool setGear(int gearIndex)
Change to the gear at the given index.
bool gearDown()
Change to the previous gear, if there is one.
agx::Real getCurrentGearRatio() const
GearBox()
Create an empty gear box.
bool gearUp()
Change to the next gear, if there is one.
void setGearRatios(const agx::RealVector &gearRatios)
Set the gear ratios.
size_t getNumGears() const
virtual bool restore(agxStream::StorageStream &str) override
Restores internal data from stream.
agx::Real getGearRatio(int gearIndex) const
agx::Real getCurrentRatio() const
agx::RealVector m_gearTable
Definition: GearBox.h:116
Defines a stiff gear constraint between two rotational dimensions.
Abstract base class for storing/restoring a line/drums with version control.
Definition: StorageStream.h:49
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:30
A library of agxPowerLine components designed to model the various parts of a vehicle drive train.
agx::ref_ptr< GearBox > GearBoxRef
Definition: GearBox.h:119
double Real
Definition: Real.h:41