AGX Dynamics  2.37.3.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>
21 #include <agxPowerLine/Connector.h>
22 
23 namespace agxDriveTrain
24 {
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 
108 #endif
109 
110  protected:
111  virtual ~GearBox();
112 
114  agx::Real getCurrentRatio() const;
115 
118  };
120 }
A library of agxPowerLine components designed to model the various parts of a vehicle drive train...
The gear box can have an arbitrary number of gears.
Definition: GearBox.h:29
agx::ref_ptr< GearBox > GearBoxRef
Definition: GearBox.h:119
Defines a stiff gear constraint between two rotational dimensions.
agx::RealVector m_gearTable
Definition: GearBox.h:116
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:207
#define AGXMODEL_EXPORT
double Real
Definition: Real.h:42