AGX Dynamics  2.35.0.1
WireWinchActuator.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 #ifndef AGXPOWERLINE_ROTATIONAL_WIRE_WINCH_H
18 #define AGXPOWERLINE_ROTATIONAL_WIRE_WINCH_H
19 
22 
24 
26 
27 namespace agxPowerLine
28 {
30 
36  {
37  public:
42 
44 
46 
47  void setEnable(bool enabled);
48  bool getEnable() const;
49 
51 
53 
54  agxPowerLine::TranslationalUnit* getInputRod();
55 
56  virtual bool preUpdate(agx::Real timeStamp) override;
57 
58  virtual bool postUpdate(agx::Real timeStamp) override;
59 
60 
61  virtual void prepareForStore() override;
62  virtual void prepareForRestore() override;
63 
64 
68  virtual bool store(agxStream::StorageStream& str) const override;
69 
73  virtual bool restore(agxStream::StorageStream& str) override;
74 
75 
77 
78 
79  public:
80  // Methods called by the rest of the PowerLine framework.
82 
83  virtual agxPowerLine::DimensionAndSide getConnectableDimension(
85  agxPowerLine::Side side) override;
86 
88 
89 
90  private:
91  void takeWinchControlParameters();
92  void returnWinchControlParameters();
93  void clearTakenWinchControlParameters();
94 
95  protected:
96 
98  virtual ~WireWinchActuator();
99 
100  void detachActuatorUnitsFromEachOther();
101 
102  void connectWireWinchConnector();
103  void disconnectWireWinchConnector();
104  void reconnectWireWinchConnector();
105 
106  protected:
107  agx::observer_ptr<agxWire::WireWinchController> m_winchController;
108 
110  agxPowerLine::detail::WireWinchConnectorRef m_wireWinchConnector;
111 
112  agx::RangeReal m_tmpForceRange;
113  agx::RangeReal m_tmpBrakeRange;
114  agx::Bool m_bounceSpoolDirectionBeforeOutOfWire;
115  };
116 
117 
118 }
119 
120 #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 AGXMODEL_EXPORT
This actuator can be used to connect a Winch (which is a linear constraint) to a powerline for exampl...
void setEnable(bool enabled)
agx::Bool getBounceSpoolDirectionBeforeOutOfWire() const
virtual bool postUpdate(agx::Real timeStamp) override
void setWinch(agxWire::WireWinchController *winch)
virtual void prepareForStore() override
agxPowerLine::TranslationalUnit * getInputRod()
virtual bool preUpdate(agx::Real timeStamp) override
WireWinchActuator(agxWire::WireWinchController *winch)
Create a wire winch actuator, with same arguments as needed for a WireWinchController.
void setBounceSpoolDirectionBeforeOutOfWire(agx::Bool bounce)
agxWire::WireWinchController * getWinch() const
virtual void prepareForRestore() override
virtual bool restore(agxStream::StorageStream &str) override
Restores internal data from stream.
virtual bool store(agxStream::StorageStream &str) const override
Stores internal data into stream.
Abstract base class for storing/restoring a line/drums with version control.
Definition: StorageStream.h:49
Winch class for handling in and out hauling of wires.
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:97
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:96
agx::ref_ptr< WireWinchConnector > WireWinchConnectorRef
agxPowerLine contains a collection of connected components that transport power across a system.
Definition: MotorUnit.h:24
std::pair< agxPowerLine::PhysicalDimension *, agxPowerLine::Side > DimensionAndSide
Implements a Wire model with adaptive resolution.
Definition: MergedBody.h:40
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
bool Bool
Definition: Integer.h:48
Range< Real > RangeReal
A short hand for ranges of floating point numbers.
Definition: Range.h:191
double Real
Definition: Real.h:42