AGX Dynamics  2.38.0.2
Actuator.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 #pragma once
17 
18 #include <agxPowerLine/SubGraph.h>
20 #include <agxPowerLine/Sides.h>
21 #include <agxPowerLine/Unit.h>
22 
23 namespace agx
24 {
25  class RigidBody;
26 }
27 
28 namespace agxPowerLine
29 {
30  class PhysicalDimension;
31  class Connector;
32 
33  namespace detail
34  {
36  }
37 }
38 
39 namespace agxPowerLine
40 {
42 
47  {
48  public:
49 
50  Actuator( agx::Constraint* constraint );
51 
52  const agx::Constraint* getConstraint() const;
53  agx::Constraint* getConstraint();
54 
55  virtual agx::Real calculateRelativeGradient() const = 0;
56  virtual agx::Real calculateRelativeValue() const = 0;
57 
58  virtual agx::Vec3 calculateLocalDirection(Side side, int dimensionType) const = 0;
59  virtual agx::Vec3 calculateWorldDirection(Side side, agxPowerLine::PhysicalDimension::Type dimensionType) const = 0;
60 
61  virtual const agx::RigidBody* getRigidBody(Side side) const;
62  virtual agx::RigidBody* getRigidBody(Side side);
63 
64  agxPowerLine::PhysicalDimension* getPhysicalDimension(Side side, int dimensionType);
65  const agxPowerLine::PhysicalDimension* getPhysicalDimension(Side side, int dimensionType) const;
66 
67  agxPowerLine::detail::Translational3DofState* getTranslationalState(Side side);
68  agxPowerLine::detail::Rotational3DofState* getRotationalState(Side side);
69 
71  agxPowerLine::Side side,
73 
74  bool reverseOrderRelativeConstraint() const;
75 
76  virtual agxPowerLine::DimensionAndSide getConnectableDimension(
78 
79 
80  agxPowerLine::ActuatorBodyUnit* getActuatorBodyUnit(Side side);
81  const agxPowerLine::ActuatorBodyUnit* getActuatorBodyUnit(Side side) const;
82 
83  //* Vectors in world coordinates to calculate the Jacobian */
84  virtual agx::Vec3 getDir1( ) const = 0;
85  virtual agx::Vec3 getDir2( ) const = 0;
86  virtual agx::Vec3 getCmToAnchorPos1() const = 0;
87  virtual agx::Vec3 getCmToAnchorPos2() const = 0;
88  virtual agx::Vec3 getSeparation() const = 0;
89 
93  virtual bool store(agxStream::StorageStream& str) const override;
94 
96 
100  virtual bool restore(agxStream::StorageStream& str) override;
101 
103 
104  AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE(agxMode::Actuator);
105  virtual void store(agxStream::OutputArchive& out) const override;
106  virtual void restore(agxStream::InputArchive& in) override;
107 
108  protected:
109  virtual ~Actuator();
110 
111  Actuator();
112 
113  protected:
114  bool m_enabled;
115 
117 
118  //agx::observer_ptr<agxPowerLine::ActuatorBodyUnit> m_actuatorBodyUnits[Actuator::NUM_BODIES];
120  };
121 }
agxPowerLine::Actuator
Definition: Actuator.h:46
agx::Real
double Real
Definition: Real.h:42
agxPowerLine::Side
Side
Definition: Sides.h:28
agxStream::out
OutputRef< Serializable > out(const char *name, const Serializable *obj)
Return an object that contain the name and the object that should be serialized to an archive.
Definition: OutputArchive.h:412
Unit.h
agx::RigidBody
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:51
agxPowerLine::ActuatorBodyUnit
An ActuatorBodyUnit forms a connection between the power line world and the rest of the simulation.
Definition: ActuatorUnit.h:142
agxPowerLine::SubGraph::restore
virtual bool restore(agxStream::StorageStream &str)
Restores internal data from stream.
agxStream::StorageStream
Abstract base class for storing/restoring a line/drums with version control.
Definition: StorageStream.h:48
AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE
#define AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE(T)
Use this in a pure abstract Serializable class to add the required methods Important: Use full namesp...
Definition: Serializable.h:221
agxPowerLine::PhysicalDimension
Pure virtual class.
Definition: PhysicalDimension.h:92
agxPowerLine::PhysicalDimension::Type
int Type
Definition: PhysicalDimension.h:95
agx::observer_ptr< agx::Constraint >
agx
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Definition: AddedMassInteraction.h:22
agxStream::in
InputRef< T > in(const char *name, T &obj)
Create an object with a name and a reference to the object that should be restored (usually a pointer...
Definition: InputArchive.h:399
agxPowerLine::Unit
Pure virtual class.
Definition: Unit.h:71
agx::ref_ptr< agxPowerLine::ActuatorBodyUnit >
agxStream::OutputArchive
Class for writing serialized data in binary format to a stream.
Definition: OutputArchive.h:56
agxStream::InputArchive
Class for reading a binary stream of serialized data.
Definition: InputArchive.h:50
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
agxPowerLine
agxPowerLine contains a collection of connected components that transport power across a system.
Definition: MotorUnit.h:23
agx::Constraint
The base class for a constraint.
Definition: Constraint.h:88
SubGraph.h
AGXMODEL_EXPORT
#define AGXMODEL_EXPORT
Definition: agxModel/export.h:42
agxPowerLine::detail::DimensionState3Dof
Templated three dimensional dimension state.
Definition: DimensionState.h:354
agxPowerLine::detail::AbstractDimensionState3Dof
Base class for the two three dimensional dimension state classes.
Definition: DimensionState.h:336
Sides.h
agxPowerLine::Actuator::m_constraint
agx::observer_ptr< agx::Constraint > m_constraint
Definition: Actuator.h:116
agx::Vec3T< Real >
ActuatorUnit.h
agxPowerLine::SubGraph::store
virtual bool store(agxStream::StorageStream &str) const
Stores internal data into stream.
agxPowerLine::DimensionAndSide
std::pair< agxPowerLine::PhysicalDimension *, agxPowerLine::Side > DimensionAndSide
Definition: PhysicalDimension.h:77
agxPowerLine::Actuator::m_enabled
bool m_enabled
Definition: Actuator.h:114