AGXDynamics  2.35.0.2
Differential.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. 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 
22 #include <agxDriveTrain/Gear.h>
23 
24 namespace agxUtil
25 {
26  class ConstraintHolder;
27 }
28 
29 
30 namespace agxDriveTrain
31 {
32  typedef std::pair<agx::observer_ptr<agxPowerLine::Unit>, agxPowerLine::Side> UnitObserverSidePair;
34 
41  {
42  public:
47 
48  virtual void initConstraint( ) override;
49 
50 #ifndef SWIG
51 
54  virtual bool store( agxStream::StorageStream& str ) const override;
55 
59  virtual bool restore( agxStream::StorageStream& str ) override;
60 
61 
63 #endif
64 
65  protected:
66  virtual ~DifferentialLockConnector( );
67 
68 
69  };
70 
72 
73 
74 
79  {
80  public:
84  Differential();
85 
86  virtual bool connect(agxPowerLine::Side mySide, agxPowerLine::Side unitSide, agxPowerLine::Unit* unit) override;
87  virtual bool disconnect(agxPowerLine::Unit* unit) override;
88 
89  using Gear::connect;
90  using Gear::disconnect;
91 
98  void setLimitedSlipTorque( agx::Real limitedSlipTorque );
99 
103  bool getLockEnabled( ) const;
104 
108  bool getLimitedSlipTorqueEnabled( ) const;
109 
113  void setLock(bool enable);
114 
115  virtual agx::RegularizationParameters::VariableType calculateComplianceAndDamping(
116  const agx::Real timeStep, agx::Real& compliance, agx::Real& damping) override;
117 
118 
119 #if !defined(SWIG) && !defined(SWIG_CPPWRAPPER_BUILD)
120 
121  virtual void getConnectorsRecursive(agxPowerLine::ConnectorPtrVector& connectors) override;
122 
126  virtual bool removeNotification(agxUtil::ConstraintHolder* holder, agxSDK::Simulation* simulation) override;
127 
131  virtual bool store(agxStream::StorageStream& str) const override;
132 
136  virtual bool restore(agxStream::StorageStream& str) override;
137 
139 #endif
140 
141  protected:
142  virtual ~Differential();
143  void removeDiffLockConnector(size_t connectorIndex);
144 
147 
148  private:
149  agx::Bool m_locked;
150  agx::Real m_limitedSlipTorque;
151  };
153 
154 }
agxDriveTrain::DifferentialRef
agx::ref_ptr< Differential > DifferentialRef
Definition: Differential.h:152
RotationalUnit.h
PowerLine.h
agx::Real
double Real
Definition: Real.h:42
agxPowerLine::Side
Side
Definition: Sides.h:30
agx::RegularizationParameters::VariableType
VariableType
Definition: RegularizationParameters.h:32
agx::Vector< UnitObserverSidePair >
agxDriveTrain
A library of agxPowerLine components designed to model the various parts of a vehicle drive train.
agxDriveTrain::DifferentialLockConnector
Connector for locking of the differential.
Definition: Differential.h:40
agxUtil::ConstraintHolder
Utility class to hold custom implementations of constraints.
Definition: agxUtil.h:463
agxPowerLine::Connector::disconnect
virtual bool disconnect()
agxDriveTrain::UnitObserverSidePair
std::pair< agx::observer_ptr< agxPowerLine::Unit >, agxPowerLine::Side > UnitObserverSidePair
Definition: Differential.h:32
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
agxDriveTrain::Differential
A differential for distributing the torque evenly between an arbitrary number of output shafts.
Definition: Differential.h:78
agxDriveTrain::Differential::m_children
UnitObserverSidePairVector m_children
Definition: Differential.h:146
agxPowerLine::Unit
Pure virtual class.
Definition: Unit.h:72
agx::ref_ptr
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:29
Gear.h
agxSDK::Simulation
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:126
agxPowerLine::RotationalConnector
Defines a stiff gear constraint between two rotational dimensions.
Definition: RotationalDimension.h:152
agxDriveTrain::UnitObserverSidePairVector
agx::Vector< UnitObserverSidePair > UnitObserverSidePairVector
Definition: Differential.h:33
agx::Bool
bool Bool
Definition: Integer.h:48
agxDriveTrain::DifferentialLockConnectorRef
agx::ref_ptr< DifferentialLockConnector > DifferentialLockConnectorRef
Definition: Differential.h:71
AGXMODEL_EXPORT
#define AGXMODEL_EXPORT
Definition: agxModel/export.h:42
agxDriveTrain::Differential::m_diffLockConnectors
agx::Vector< agxDriveTrain::DifferentialLockConnectorRef > m_diffLockConnectors
Definition: Differential.h:145
agxPowerLine::Connector::connect
virtual bool connect(agxPowerLine::Unit *unit)
Connect a unit to this Connector.
agxDriveTrain::Gear
A gear is a connector between two rotational units.
Definition: Gear.h:34
agxUtil
The agxUtil namespace contain classes and methods for utility functionality.
Definition: CylindricalJoint.h:22