AGX Dynamics  2.35.0.1
PistonActuator.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 
18 #ifndef AGXHYDRAULICS_PISTON_ACTUATOR_H
19 #define AGXHYDRAULICS_PISTON_ACTUATOR_H
20 
21 #include <agxHydraulics/FlowUnit.h>
22 #include <agxHydraulics/Pipe.h>
27 
28 namespace agx
29 {
30  class RigidBody;
31 }
32 
33 namespace agxModel
34 {
35  class Connector;
36 }
37 
38 namespace agxHydraulics
39 {
40 
41  class PistonActuator;
42  class FlowUnit;
43 
44 
45 
46 
49 
50 
66  {
67  public:
68 
84  PistonActuator(agx::Prismatic* prismatic, agx::Real inputChamberArea, agx::Real outputChamberArea, agx::Real fluidDensity);
85 
92  PistonActuator(agx::DistanceJoint* distancejoint, agx::Real inputChamberArea, agx::Real outputChamberArea, agx::Real fluidDensity);
93 
94 
100 
106 
113 
114 
120 
126 
134 
135 
140 
141 
142 
143 
144 
145  // Deprecated methods.
146  public:
153 
160 
161 
168 
175 
176 
177 
178 
179  // Methods called by the rest of the power line framework.
180  public:
182 
184  virtual bool preUpdate(agx::Real timeStep) override;
185 
193  virtual agx::Real calculateChamberLength(agxPowerLine::Side side) const;
195 
196 
197 #ifndef SWIG
200 
203 
204 
208  virtual bool store(agxStream::StorageStream& str) const override;
209 
213  virtual bool restore(agxStream::StorageStream& str) override;
214 
216 #endif
217 
218 
219  protected:
220  void create(agx::Constraint1DOF* constraint1DOF, agx::Real inputChamberArea, agx::Real outputChamberArea, agx::Real fluidDensity);
222 
224  virtual ~PistonActuator();
225 
226  private:
227  agx::Real m_chamberBufferLength;
228  agx::ref_ptr<FlowUnit> m_flowUnits[2];
229  agx::ref_ptr<agxHydraulics::PistonActuatorConnector> m_pistonChamberConnectors[2];
230  };
231 
232 
233 
234 
235 
236 
237 }
238 
239 #endif
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
#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 AGXHYDRAULICS_EXPORT
#define AGX_DECLARE_VECTOR_TYPES(type)
Definition: agx/Vector.h:34
FlowUnit is the base class for Units that contains a FlowDimension.
Definition: FlowUnit.h:67
The PistonChamberConnector is an internal Connector to the PistonActuator.
A PistonActuator is a model of a hydraulic cylinder.
void create(agx::Constraint1DOF *constraint1DOF, agx::Real inputChamberArea, agx::Real outputChamberArea, agx::Real fluidDensity)
agxHydraulics::PistonActuatorConnector * getInputChamberConnector()
const agxHydraulics::FlowUnit * getOutputChamber() const
agx::Real getPistonPosition() const
agxHydraulics::PistonActuatorConnector * getRearChamberConnector()
agxHydraulics::PistonActuatorConnector * getFrontChamberConnector()
virtual bool store(agxStream::StorageStream &str) const override
Stores internal data into stream.
agxHydraulics::FlowUnit * getRearChamber()
agxHydraulics::PistonActuatorConnector * getChamberConnector(agxPowerLine::Side side)
agxHydraulics::FlowUnit * getChamber(agxPowerLine::Side side)
Get one of the cylinder chambers.
agxHydraulics::FlowUnit * getInputChamber()
PistonActuator(agx::DistanceJoint *distancejoint, agx::Real inputChamberArea, agx::Real outputChamberArea, agx::Real fluidDensity)
Same as the constructor taking a agx::Prismatic, but with a agx::DistanceJoint instead.
agxHydraulics::FlowUnit * getFrontChamber()
const agxHydraulics::FlowUnit * getRearChamber() const
bool connect(agxPowerLine::ActuatorBodyUnit *flowSideBody, agxPowerLine::ActuatorBodyUnit *oppositeSideBody, agxPowerLine::Side index)
const agxHydraulics::PistonActuatorConnector * getInputChamberConnector() const
virtual void getConnectableDimensionTypes(agxPowerLine::PhysicalDimension::TypeVector &types, agxPowerLine::Side side) const override
const agxHydraulics::PistonActuatorConnector * getOutputChamberConnector() const
PistonActuator(agx::Prismatic *prismatic, agx::Real inputChamberArea, agx::Real outputChamberArea, agx::Real fluidDensity)
Create a PistonActuator from the given prismatic.
agxHydraulics::PistonActuatorConnector * getOutputChamberConnector()
virtual agxPowerLine::DimensionAndSide getConnectableDimension(agxPowerLine::PhysicalDimension::Type type, agxPowerLine::Side side) override
Stores internal data into stream.
const agxHydraulics::FlowUnit * getFrontChamber() const
virtual bool restore(agxStream::StorageStream &str) override
Restores internal data from stream.
const agxHydraulics::FlowUnit * getInputChamber() const
agxHydraulics::FlowUnit * getOutputChamber()
An ActuatorBodyUnit forms a connection between the power line world and the rest of the simulation.
Definition: ActuatorUnit.h:144
virtual bool connect(agxPowerLine::Connector *connector)
Connect the unit to a connector.
Abstract base class for storing/restoring a line/drums with version control.
Definition: StorageStream.h:49
Specialization for constraints that have only one degree of freedom such as Hinge and Prismatic.
Definition: Constraint.h:677
This joint will preserve the initial distance between a body and a point in world coordinate or betwe...
Definition: DistanceJoint.h:28
A prismatic joint keeps a fixed relative orientation between the attached bodies but allows them to s...
Definition: Prismatic.h:68
Templated vector class.
Definition: agx/Vector.h:53
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:97
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:96
The agxHydraulics namespace contains classes for modeling hydraulic circuits within the power line fr...
Definition: Accumulator.h:28
Contain classes for higher level modeling primitives, such as Tree, Terrain etc.
Definition: FlowUnit.h:37
agxPowerLine contains a collection of connected components that transport power across a system.
Definition: MotorUnit.h:24
std::pair< agxPowerLine::PhysicalDimension *, agxPowerLine::Side > DimensionAndSide
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
double Real
Definition: Real.h:42