AGX Dynamics 2.40.0.0
Loading...
Searching...
No Matches
agxWire::WireWinchController Class Reference

Winch class for handling in and out hauling of wires. More...

#include <WireWinchController.h>

+ Inheritance diagram for agxWire::WireWinchController:

Public Member Functions

 WireWinchController (agx::RigidBody *body, const agx::Vec3 &positionInBodyFrame, const agx::Vec3 &normalInBodyFrame, agx::Real pulledInLength=agx::Real(0))
 Construct this winch given position, normal and body this winch is attached to.
 
agx::Constraint1DOFget1DOFConstraint ()
 Get pointer to Constraint1DOF.
 
const agx::Constraint1DOFget1DOFConstraint () const
 
bool getAutoFeed () const
 
const agx::RangeRealgetBrakeForceRange () const
 
virtual agx::Real getCurrentBrakeForce () const
 
virtual agx::Real getCurrentForce () const
 
virtual agx::Real getCurrentSpeed () const
 
agxWire::BodyFixedNodegetFixedNode () const
 
const agx::RangeRealgetForceRange () const
 
agx::Vec3 getLumpNodeReferencePosition () const
 
const agx::Vec3getNormal () const
 
virtual agx::Real getPulledInWireLength () const
 
agx::RigidBodygetRigidBody () const
 
agx::Real getSpeed () const
 
agxWire::StopNodegetStopNode () const
 
bool getStopNodeInserted () const
 
agx::Real getStopNodeReferenceDistance () const
 
virtual bool getWithinEndRange () const
 
agx::Vec3 getWorldNormal () const
 
void setAutoFeed (bool autoFeed)
 Set auto feed to this winch.
 
void setBrakeForceRange (agx::RangeReal brakeForceRange)
 Set the desired brake force range where range::lower is the force in which this winch brake can hold the wire from hauling out and ranger::upper the brake force hold the wire from hauling in.
 
void setBrakeForceRange (agx::Real brakeForce)
 Same as setBrakeForceRange( agx::RangeReal brakeForceRange ) but this method will set range as [-brakeForce, brakeForce].
 
void setCompliance (agx::Prismatic *prismatic) const
 Sets the default compliance for the prismatic constraint.
 
void setForceRange (agx::RangeReal forceRange)
 Set the desired winch force where range::lower is the force in which this winch may haul in wire, range::upper haul out.
 
void setForceRange (agx::Real force)
 Same as setForceRange( agx::RangeReal forceRange ) but this method will set range as [-force, force].
 
void setParameterController (agxWire::WireParameterController *parameters)
 Associate a parameter controller to this winch.
 
void setPulledInWireLength (agx::Real pulledInLength)
 Set the pulled in length for this winch.
 
void setSpeed (agx::Real speed)
 Set winch motor speed.
 
void setStabilityController (agxWire::WireStabilityController *stabilityController)
 Associate a stability controller to this winch.
 
- Public Member Functions inherited from agxStream::Serializable
virtual ~Serializable ()
 Destructor for normal C++ use but hidden from SWIG bindings.
 
virtual const char * getClassName () const
 
bool getEnableSerialization () const
 
bool getEnableUuidGeneration ()
 
agx::UInt32 getIndex () const
 This index is given at creation of this object.
 
virtual StorageAgent * getStorageAgent () const =0
 
agx::Uuid getUuid () const
 
bool isFinished () const
 
void setEnableSerialization (bool flag)
 Set to false to disable serialization of this object.
 
void setFinished ()
 Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.
 
void setUuid (const agx::Uuid &uuid)
 Explicitly set a Uuid on a serializable object.
 

Protected Member Functions

 WireWinchController ()
 Default constructor for serialization.
 
virtual ~WireWinchController ()
 
virtual void addNotification (agxSDK::SimulationProxy *)
 Called from Wire::addNotification.
 
virtual bool attach (WireDistanceCompositeConstraint *constraint, WireParameterController *parameters, bool begin)
 Create new nodes for new wire.
 
agx::Real configureInitialState ()
 This method will set the position of the lumped node given the stop node and pulled in length.
 
agx::PrismaticcreatePrismatic (Node *fixedNode, Node *lumpedNode, const agx::Vec3 &worldNormal) const
 Creates a prismatic constraint given the fixed-, lumped node and a normal.
 
BodyFixedNodefindParametersHoldingNode (bool begin)
 Search the wire, given begin true of false, for the parameters holding node.
 
virtual void forcePulledInLength (agx::Real newLength)
 
BodyFixedNodegetNextLumpedNode (BodyFixedNode *from, bool begin)
 Finds the next (or previous) lumped node given a lumped node and the direction of the search.
 
virtual agx::Real getReferenceCurrentLength (bool begin) const override
 
virtual NodegetReferenceNode () override
 
virtual void incrementPulledInLength (agx::Real dl)
 
virtual void initialize (bool begin, WireParameterController *parameters) override
 Initializes this winch (inserts the stop node and move the lump for example).
 
bool insertStopNode (bool begin)
 Inserts the stop wire node in the wire.
 
void massUpdate (agx::Real restLengthChange, bool begin)
 Updates mass for lumped nodes where the rest length is changed by restLengthChange.
 
virtual bool owns (const Node *node) const override
 For the wire to know if node belongs to this attachment.
 
virtual void postUpdate (agx::Bool, agxSDK::SimulationProxy *)
 Post update call from the wire.
 
virtual void preCollideUpdate (agx::Bool, agxSDK::SimulationProxy *)
 Pre-collide update call from the wire.
 
virtual void preUpdate (agx::Bool, agxSDK::SimulationProxy *)
 Pre update call from the wire.
 
agx::Real resetLumpPosition (agx::Real angle)
 Resets the lump position to reference.
 
virtual void unitialize ()
 Forgets about all wire parameters and clears the constraint.
 
virtual void update (Node *controlledNode, Node *lumpedNode, bool begin) override
 Called when it's time to update the constraint and reset the position of the lump.
 
void updateConstraintSettings (agx::Prismatic *prismatic, agx::Real desiredSpeed, const agx::RangeReal &forceRange, const agx::RangeReal &brakeRange, bool rangeEnable, bool forcedBrake=false) const
 Updates motor, lock and range parameters.
 
- Protected Member Functions inherited from agxStream::Serializable
 Serializable ()
 Default constructor.
 
 Serializable (const Serializable &other)
 Copy constructor.
 
void generateUuid ()
 

Protected Attributes

bool m_autoFeed
 
agx::RangeReal m_brakeRange
 
BodyFixedNodeRef m_fixedNode
 
bool m_forcedBrake
 
agx::RangeReal m_forceRange
 
agx::observer_ptr< BodyFixedNodem_lumpedNode
 
agx::Vec3 m_normal
 
WireParameterControllerm_parameters
 
agx::observer_ptr< BodyFixedNodem_parametersHoldingNode
 To access and change rest/current length.
 
agx::Real m_pulledInLength
 
agx::Real m_speed
 
agx::observer_ptr< WireStabilityController > m_stabilityController
 If by the initialization controller, this winch can merge segments and change mass of the lumps via this controller.
 
StopNodeRef m_stopNode
 
bool m_withinEndRange
 

Additional Inherited Members

- Static Public Member Functions inherited from agxStream::Serializable
static void setEnableUuidGeneration (bool flag)
 Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled.
 

Detailed Description

Winch class for handling in and out hauling of wires.

Note
Spooling out all available wire is not recommended. Either the winch should be stopped before this happens, or the wire should be detached from the winch. Force reported by the brake/winch will not be correct if no wire is left in the winch.

Definition at line 41 of file WireWinchController.h.

Constructor & Destructor Documentation

◆ WireWinchController() [1/2]

agxWire::WireWinchController::WireWinchController ( agx::RigidBody body,
const agx::Vec3 positionInBodyFrame,
const agx::Vec3 normalInBodyFrame,
agx::Real  pulledInLength = agx::Real(0) 
)

Construct this winch given position, normal and body this winch is attached to.

Both position and normal are in body frame. The normal defines the direction out from the winch, i.e., the positive direction in which the wire will be hauled out.

Parameters
body- rigid body this winch is attached to
positionInBodyFrame- position of this winch on body
normalInBodyFrame- direction of this winch
pulledInLength- pulled in length in this winch

◆ WireWinchController() [2/2]

agxWire::WireWinchController::WireWinchController ( )
protected

Default constructor for serialization.

◆ ~WireWinchController()

virtual agxWire::WireWinchController::~WireWinchController ( )
protectedvirtual

Member Function Documentation

◆ addNotification()

virtual void agxWire::WireWinchController::addNotification ( agxSDK::SimulationProxy )
inlineprotectedvirtual

Called from Wire::addNotification.

Reimplemented in agxWire::Winch.

Definition at line 251 of file WireWinchController.h.

◆ attach()

virtual bool agxWire::WireWinchController::attach ( WireDistanceCompositeConstraint *  constraint,
WireParameterController parameters,
bool  begin 
)
protectedvirtual

Create new nodes for new wire.

◆ configureInitialState()

agx::Real agxWire::WireWinchController::configureInitialState ( )
protected

This method will set the position of the lumped node given the stop node and pulled in length.

Returns
the distance the lumped node moved during this initialization (distance < reference distance means that the range should be enabled)

◆ createPrismatic()

agx::Prismatic * agxWire::WireWinchController::createPrismatic ( Node fixedNode,
Node lumpedNode,
const agx::Vec3 worldNormal 
) const
protected

Creates a prismatic constraint given the fixed-, lumped node and a normal.

◆ findParametersHoldingNode()

BodyFixedNode * agxWire::WireWinchController::findParametersHoldingNode ( bool  begin)
protected

Search the wire, given begin true of false, for the parameters holding node.

If this winch is located at the beginning of the wire, the parameters holding node will be the first lump after m_lumpedNode. If at end, the parameters holding node is equal to the lumped node.

Parameters
begin- if this winch is located at the beginning or at the end of the wire
Returns
the node which holds the rest/current length of its segment

◆ forcePulledInLength()

virtual void agxWire::WireWinchController::forcePulledInLength ( agx::Real  newLength)
protectedvirtual

◆ get1DOFConstraint() [1/2]

agx::Constraint1DOF * agxWire::WireWinchController::get1DOFConstraint ( )

Get pointer to Constraint1DOF.

◆ get1DOFConstraint() [2/2]

const agx::Constraint1DOF * agxWire::WireWinchController::get1DOFConstraint ( ) const

◆ getAutoFeed()

bool agxWire::WireWinchController::getAutoFeed ( ) const
inline
Returns
true if auto feed mode - otherwise false
See also
setAutoFeed

Definition at line 403 of file WireWinchController.h.

References m_autoFeed.

◆ getBrakeForceRange()

const agx::RangeReal & agxWire::WireWinchController::getBrakeForceRange ( ) const
inline
Returns
the brake force range

Definition at line 418 of file WireWinchController.h.

References m_brakeRange.

◆ getCurrentBrakeForce()

virtual agx::Real agxWire::WireWinchController::getCurrentBrakeForce ( ) const
virtual
Note
that if all the wire is spooled out, the force reported will not be correct. Avoid this situation.
Returns
the current brake force the winch brake is applying

Reimplemented in agxWire::WireSimpleDrumController.

◆ getCurrentForce()

virtual agx::Real agxWire::WireWinchController::getCurrentForce ( ) const
virtual
Returns
the current force the winch motor is applying

Reimplemented in agxWire::WireSimpleDrumController.

◆ getCurrentSpeed()

virtual agx::Real agxWire::WireWinchController::getCurrentSpeed ( ) const
virtual
Returns
the current speed of the winch motor

Reimplemented in agxWire::WireSimpleDrumController.

◆ getFixedNode()

agxWire::BodyFixedNode * agxWire::WireWinchController::getFixedNode ( ) const
Returns
the fixed node (i.e., first or last node depending on which side this winch is on)

◆ getForceRange()

const agx::RangeReal & agxWire::WireWinchController::getForceRange ( ) const
inline
Returns
the winch force range

Definition at line 413 of file WireWinchController.h.

References m_forceRange.

◆ getLumpNodeReferencePosition()

agx::Vec3 agxWire::WireWinchController::getLumpNodeReferencePosition ( ) const
Returns
the reference position of the lump node given normal and fixed node

◆ getNextLumpedNode()

BodyFixedNode * agxWire::WireWinchController::getNextLumpedNode ( BodyFixedNode from,
bool  begin 
)
protected

Finds the next (or previous) lumped node given a lumped node and the direction of the search.

Parameters
from- the search will start from this body fixed wire node
begin- direction of the search, begin == true the search will be forward, false backward (in the list)
Returns
the next lumped node - zero of no lump was found

◆ getNormal()

const agx::Vec3 & agxWire::WireWinchController::getNormal ( ) const
inline
Returns
the normal in rigid body frame

Definition at line 398 of file WireWinchController.h.

References m_normal.

◆ getPulledInWireLength()

virtual agx::Real agxWire::WireWinchController::getPulledInWireLength ( ) const
virtual
Returns
the pulled in length of the wire attached to the winch controller.

◆ getReferenceCurrentLength()

virtual agx::Real agxWire::WireWinchController::getReferenceCurrentLength ( bool  begin) const
overrideprotectedvirtual
Returns
current length between lumped node and stop node

◆ getReferenceNode()

virtual Node * agxWire::WireWinchController::getReferenceNode ( )
inlineoverrideprotectedvirtual
Returns
true if our stop node is on the wire

Definition at line 330 of file WireWinchController.h.

◆ getRigidBody()

agx::RigidBody * agxWire::WireWinchController::getRigidBody ( ) const
Returns
the rigid body

◆ getSpeed()

agx::Real agxWire::WireWinchController::getSpeed ( ) const
inline
Returns
the desired speed of the winch motor

Definition at line 408 of file WireWinchController.h.

References m_speed.

◆ getStopNode()

agxWire::StopNode * agxWire::WireWinchController::getStopNode ( ) const
Returns
the stop node

◆ getStopNodeInserted()

bool agxWire::WireWinchController::getStopNodeInserted ( ) const
Returns
true if the stop node has been inserted into the wire - otherwise false

◆ getStopNodeReferenceDistance()

agx::Real agxWire::WireWinchController::getStopNodeReferenceDistance ( ) const
Returns
distance between lump reposition position and the stop node.

◆ getWithinEndRange()

virtual bool agxWire::WireWinchController::getWithinEndRange ( ) const
virtual

◆ getWorldNormal()

agx::Vec3 agxWire::WireWinchController::getWorldNormal ( ) const
Returns
the normal in world frame

◆ incrementPulledInLength()

virtual void agxWire::WireWinchController::incrementPulledInLength ( agx::Real  dl)
protectedvirtual

◆ initialize()

virtual void agxWire::WireWinchController::initialize ( bool  begin,
WireParameterController parameters 
)
overrideprotectedvirtual

Initializes this winch (inserts the stop node and move the lump for example).

Parameters
begin- true if this attachment is at the beginning of the wire
parameters- pointer to the parameter object

Reimplemented in agxWire::WireSimpleDrumController.

◆ insertStopNode()

bool agxWire::WireWinchController::insertStopNode ( bool  begin)
protected

Inserts the stop wire node in the wire.

Returns
true if the operation was successful (or if the node is already inserted) - otherwise false

◆ massUpdate()

void agxWire::WireWinchController::massUpdate ( agx::Real  restLengthChange,
bool  begin 
)
protected

Updates mass for lumped nodes where the rest length is changed by restLengthChange.

◆ owns()

virtual bool agxWire::WireWinchController::owns ( const Node node) const
inlineoverrideprotectedvirtual

For the wire to know if node belongs to this attachment.

Parameters
node- node
Returns
true if node is part of this attachment

Definition at line 322 of file WireWinchController.h.

◆ postUpdate()

virtual void agxWire::WireWinchController::postUpdate ( agx::Bool  ,
agxSDK::SimulationProxy  
)
inlineprotectedvirtual

Post update call from the wire.

Definition at line 315 of file WireWinchController.h.

◆ preCollideUpdate()

virtual void agxWire::WireWinchController::preCollideUpdate ( agx::Bool  ,
agxSDK::SimulationProxy  
)
inlineprotectedvirtual

Pre-collide update call from the wire.

Definition at line 300 of file WireWinchController.h.

◆ preUpdate()

virtual void agxWire::WireWinchController::preUpdate ( agx::Bool  ,
agxSDK::SimulationProxy  
)
inlineprotectedvirtual

Pre update call from the wire.

Reimplemented in agxWire::Winch.

Definition at line 305 of file WireWinchController.h.

◆ resetLumpPosition()

agx::Real agxWire::WireWinchController::resetLumpPosition ( agx::Real  angle)
protected

Resets the lump position to reference.

Parameters
angle- the current angle of the constraint
Returns
change in angle (i.e., the amount the rest and current (?) length should change

◆ setAutoFeed()

void agxWire::WireWinchController::setAutoFeed ( bool  autoFeed)

Set auto feed to this winch.

This mode can be used to facilitate routing. E.g., put all wire in this winch (start of route), set mode to auto feed, and route. The wire will automatically decrease in this winch to fulfill the rout without initial tension. Default: false

Parameters
autoFeed- true for auto feed mode

◆ setBrakeForceRange() [1/2]

void agxWire::WireWinchController::setBrakeForceRange ( agx::RangeReal  brakeForceRange)

Set the desired brake force range where range::lower is the force in which this winch brake can hold the wire from hauling out and ranger::upper the brake force hold the wire from hauling in.

It's important that the lower value is smaller than zero and the upper larger than zero. Default: (-0, 0)

Parameters
brakeForceRange- brake force range
See also
setBrakeForce

◆ setBrakeForceRange() [2/2]

void agxWire::WireWinchController::setBrakeForceRange ( agx::Real  brakeForce)

Same as setBrakeForceRange( agx::RangeReal brakeForceRange ) but this method will set range as [-brakeForce, brakeForce].

Parameters
brakeForce- brake force (Newton) to define the total brake force range

◆ setCompliance()

void agxWire::WireWinchController::setCompliance ( agx::Prismatic prismatic) const

Sets the default compliance for the prismatic constraint.

Parameters
prismatic- a prismatic constraint

◆ setForceRange() [1/2]

void agxWire::WireWinchController::setForceRange ( agx::RangeReal  forceRange)

Set the desired winch force where range::lower is the force in which this winch may haul in wire, range::upper haul out.

It's important that the lower value is smaller than zero and the upper larger than zero. Default: (-Infinity, Infinity)

Parameters
forceRange- force (Newton) range [haul_in, haul_out] where haul_in <= 0 and haul_out >= 0

◆ setForceRange() [2/2]

void agxWire::WireWinchController::setForceRange ( agx::Real  force)

Same as setForceRange( agx::RangeReal forceRange ) but this method will set range as [-force, force].

Parameters
force- force (Newton) to define the total force range

◆ setParameterController()

void agxWire::WireWinchController::setParameterController ( agxWire::WireParameterController parameters)

Associate a parameter controller to this winch.

◆ setPulledInWireLength()

void agxWire::WireWinchController::setPulledInWireLength ( agx::Real  pulledInLength)

Set the pulled in length for this winch.

Note
Explicitly assigning this value will affect the total length of the wire this winch is attached to.
Parameters
pulledInLength- pulled in length

◆ setSpeed()

void agxWire::WireWinchController::setSpeed ( agx::Real  speed)

Set winch motor speed.

Parameters
speed- speed of the winch motor (Default: 0)

◆ setStabilityController()

void agxWire::WireWinchController::setStabilityController ( agxWire::WireStabilityController *  stabilityController)

Associate a stability controller to this winch.

This winch will use the stability controller to calculate and set masses to the neighboring lumped nodes when hauling in and out wire. It makes it also possible for this winch to merge two lumps if the haul in speed is large.

Parameters
stabilityController- new stability controller

◆ unitialize()

virtual void agxWire::WireWinchController::unitialize ( )
protectedvirtual

Forgets about all wire parameters and clears the constraint.

◆ update()

virtual void agxWire::WireWinchController::update ( Node controlledNode,
Node lumpedNode,
bool  begin 
)
overrideprotectedvirtual

Called when it's time to update the constraint and reset the position of the lump.

Reimplemented in agxWire::WireSimpleDrumController.

◆ updateConstraintSettings()

void agxWire::WireWinchController::updateConstraintSettings ( agx::Prismatic prismatic,
agx::Real  desiredSpeed,
const agx::RangeReal forceRange,
const agx::RangeReal brakeRange,
bool  rangeEnable,
bool  forcedBrake = false 
) const
protected

Updates motor, lock and range parameters.

Parameters
prismatic- the prismatic constraint
desiredSpeed- desired speed of the prismatic motor
forceRange- force range of the motor
brakeRange- force range of the lock
rangeEnable- if pulled in length < reference distance the range should be enabled
forcedBrake- true for "emergency stop" of this winch, brake force will be infinite

Member Data Documentation

◆ m_autoFeed

bool agxWire::WireWinchController::m_autoFeed
protected

Definition at line 373 of file WireWinchController.h.

Referenced by getAutoFeed().

◆ m_brakeRange

agx::RangeReal agxWire::WireWinchController::m_brakeRange
protected

Definition at line 376 of file WireWinchController.h.

Referenced by getBrakeForceRange().

◆ m_fixedNode

BodyFixedNodeRef agxWire::WireWinchController::m_fixedNode
protected

Definition at line 381 of file WireWinchController.h.

◆ m_forcedBrake

bool agxWire::WireWinchController::m_forcedBrake
protected

Definition at line 379 of file WireWinchController.h.

◆ m_forceRange

agx::RangeReal agxWire::WireWinchController::m_forceRange
protected

Definition at line 375 of file WireWinchController.h.

Referenced by getForceRange().

◆ m_lumpedNode

agx::observer_ptr< BodyFixedNode > agxWire::WireWinchController::m_lumpedNode
protected

Definition at line 384 of file WireWinchController.h.

◆ m_normal

agx::Vec3 agxWire::WireWinchController::m_normal
protected

Definition at line 383 of file WireWinchController.h.

Referenced by getNormal().

◆ m_parameters

WireParameterController* agxWire::WireWinchController::m_parameters
protected

Definition at line 389 of file WireWinchController.h.

◆ m_parametersHoldingNode

agx::observer_ptr< BodyFixedNode > agxWire::WireWinchController::m_parametersHoldingNode
protected

To access and change rest/current length.

If this winch is located at begin this will be the lumped node after m_lumpedNode, if at end m_lumpedNode == m_parametersHoldingNode.

Definition at line 385 of file WireWinchController.h.

◆ m_pulledInLength

agx::Real agxWire::WireWinchController::m_pulledInLength
protected

Definition at line 377 of file WireWinchController.h.

◆ m_speed

agx::Real agxWire::WireWinchController::m_speed
protected

Definition at line 374 of file WireWinchController.h.

Referenced by getSpeed().

◆ m_stabilityController

agx::observer_ptr< WireStabilityController > agxWire::WireWinchController::m_stabilityController
protected

If by the initialization controller, this winch can merge segments and change mass of the lumps via this controller.

Definition at line 387 of file WireWinchController.h.

◆ m_stopNode

StopNodeRef agxWire::WireWinchController::m_stopNode
protected

Definition at line 382 of file WireWinchController.h.

◆ m_withinEndRange

bool agxWire::WireWinchController::m_withinEndRange
protected

Definition at line 378 of file WireWinchController.h.


The documentation for this class was generated from the following file: