ARGoS  3
A parallel, multi-engine simulator for swarm robotics
argos::CGripperEquippedEntity Class Reference

An entity that stores the state of a robot gripper. More...

#include <gripper_equipped_entity.h>

+ Inheritance diagram for argos::CGripperEquippedEntity:

List of all members.

Public Member Functions

 ENABLE_VTABLE ()
 CGripperEquippedEntity (CComposableEntity *pc_parent)
 Class constructor.
 CGripperEquippedEntity (CComposableEntity *pc_parent, const std::string &str_id, const CVector3 &c_offset, const CVector3 &c_direction, Real f_lock_threshold=0.5f)
 Class constructor.
virtual void Init (TConfigurationNode &t_tree)
 Initializes the state of the entity from the XML configuration tree.
virtual void Reset ()
 Resets the state of the entity to whatever it was after Init() or one of the standalone constructors was called.
const CVector3GetOffset () const
 Returns the offset of the gripper with respect to the reference point.
const CVector3GetInitOffset () const
 Returns the initial offset of the gripper with respect to the reference point.
void SetOffset (const CVector3 &c_offset)
 Sets the offset of the gripper with respect to the reference point.
void SetInitOffset (const CVector3 &c_offset)
 Sets the initial offset of the gripper with respect to the reference point.
const CVector3GetDirection () const
 Returns the facing direction of the gripper with respect to the local X-axis.
const CVector3GetInitDirection () const
 Returns the initial facing direction of the gripper with respect to the local X-axis.
void SetDirection (const CVector3 &c_direction)
 Sets the facing direction of the gripper with respect to the local X-axis.
void SetInitDirection (const CVector3 &c_direction)
 Sets the initial facing direction of the gripper with respect to the local X-axis.
Real GetLockState () const
 Returns the lock state of the gripper.
void SetLockState (Real f_lock_state)
 Sets the lock state of the gripper.
Real GetLockThreshold () const
 Returns the lock threshold of the gripper.
void SetLockThreshold (Real f_lock_threshold)
 Sets the lock threshold of the gripper.
bool IsLocked () const
 Returns true if the gripper is locked.
bool IsGripping () const
 Returns true if this gripper is gripping something.
CEmbodiedEntityGetGrippedEntity ()
 Returns the embodied entity currently gripped by this gripper.
void SetGrippedEntity (CEmbodiedEntity &c_entity)
 Sets the embodied entity currently gripped by this gripper.
void ClearGrippedEntity ()
 Clears the reference to the embodied entity currently gripped by this gripper.
virtual std::string GetTypeDescription () const
 Returns a string label for this class.

Detailed Description

An entity that stores the state of a robot gripper.

This class provides a component that stores the state of a robot gripper. The state is represented by a Real value between 0 and 1, where 0 means unlocked and 1 means locked. In-between values are also allowed. The transition between locked and unlocked state is when the lock state exceeds m_fLockThreshold, which is set to 0.5 by default.

The gripper can also be oriented, acting on its offset and direction attributes. The offset refers to the position of the gripper with respect to the reference point of the robot. The direction refers to where the gripper is facing.

Definition at line 37 of file gripper_equipped_entity.h.


Constructor & Destructor Documentation

Class constructor.

This constructor is meant to be used with the Init() method.

Parameters:
pc_parentThe parent of this entity.

Definition at line 20 of file gripper_equipped_entity.cpp.

argos::CGripperEquippedEntity::CGripperEquippedEntity ( CComposableEntity pc_parent,
const std::string &  str_id,
const CVector3 c_offset,
const CVector3 c_direction,
Real  f_lock_threshold = 0.5f 
)

Class constructor.

This constructor is meant to be standalone. You should not call Init() after using this constructor, or memory leaks are likely to happen.

Parameters:
pc_parentThe parent of this entity.
str_idThe id of this entity.
c_offsetThe positional offset of this gripper with respect to the robot reference point.
c_directionThe facing direction of this gripper.
f_lock_thresholdThe lock value above which the gripper is considered locked.

Definition at line 32 of file gripper_equipped_entity.cpp.


Member Function Documentation

Clears the reference to the embodied entity currently gripped by this gripper.

Definition at line 217 of file gripper_equipped_entity.h.

Returns the facing direction of the gripper with respect to the local X-axis.

Returns:
The facing direction of the gripper with respect to the local X-axis

Definition at line 118 of file gripper_equipped_entity.h.

Returns the embodied entity currently gripped by this gripper.

Returns:
The embodied entity currently gripped by this gripper.
Exceptions:
CARGoSExceptionif no entity is being gripped.

Definition at line 98 of file gripper_equipped_entity.cpp.

Returns the initial facing direction of the gripper with respect to the local X-axis.

Returns:
The initial facing direction of the gripper with respect to the local X-axis
See also:
Reset()

Definition at line 127 of file gripper_equipped_entity.h.

Returns the initial offset of the gripper with respect to the reference point.

Returns:
The initial offset of the gripper with respect to the reference point.
See also:
Reset()

Definition at line 93 of file gripper_equipped_entity.h.

Returns the lock state of the gripper.

The lock state is a Real in the range [0:1].

Returns:
The lock state of the gripper.

Definition at line 153 of file gripper_equipped_entity.h.

Returns the lock threshold of the gripper.

The lock threshold is a Real in the range [0:1].

Returns:
The lock threshold of the gripper.

Definition at line 169 of file gripper_equipped_entity.h.

Returns the offset of the gripper with respect to the reference point.

Returns:
The offset of the gripper with respect to the reference point.

Definition at line 84 of file gripper_equipped_entity.h.

virtual std::string argos::CGripperEquippedEntity::GetTypeDescription ( ) const [inline, virtual]

Returns a string label for this class.

Returns:
A string label for this class.

Reimplemented from argos::CEntity.

Definition at line 221 of file gripper_equipped_entity.h.

Initializes the state of the entity from the XML configuration tree.

Exceptions:
CARGoSExceptionif a parse error occurs

Reimplemented from argos::CEntity.

Definition at line 53 of file gripper_equipped_entity.cpp.

Returns true if this gripper is gripping something.

Returns:
true if this gripper is gripping something.

Definition at line 195 of file gripper_equipped_entity.h.

bool argos::CGripperEquippedEntity::IsLocked ( ) const [inline]

Returns true if the gripper is locked.

The gripper is considered locked if its state is greater than the lock threshold.

Returns:
true if the gripper is locked.
See also:
GetLockState()
GetLockThreshold()

Definition at line 187 of file gripper_equipped_entity.h.

Resets the state of the entity to whatever it was after Init() or one of the standalone constructors was called.

Reimplemented from argos::CEntity.

Definition at line 72 of file gripper_equipped_entity.cpp.

void argos::CGripperEquippedEntity::SetDirection ( const CVector3 c_direction) [inline]

Sets the facing direction of the gripper with respect to the local X-axis.

Parameters:
c_directionThe facing direction of the gripper with respect to the local X-axis

Definition at line 135 of file gripper_equipped_entity.h.

Sets the embodied entity currently gripped by this gripper.

Parameters:
c_entityThe embodied entity currently gripped by this gripper.

Definition at line 210 of file gripper_equipped_entity.h.

void argos::CGripperEquippedEntity::SetInitDirection ( const CVector3 c_direction) [inline]

Sets the initial facing direction of the gripper with respect to the local X-axis.

Parameters:
c_directionThe initial facing direction of the gripper with respect to the local X-axis
See also:
Reset()

Definition at line 144 of file gripper_equipped_entity.h.

void argos::CGripperEquippedEntity::SetInitOffset ( const CVector3 c_offset) [inline]

Sets the initial offset of the gripper with respect to the reference point.

Parameters:
c_offsetThe initial offset of the gripper with respect to the reference point.
See also:
Reset()

Definition at line 110 of file gripper_equipped_entity.h.

Sets the lock state of the gripper.

The lock state is a Real in the range [0:1]. The passed value is clamped internally.

Returns:
The lock state of the gripper.

Definition at line 82 of file gripper_equipped_entity.cpp.

Sets the lock threshold of the gripper.

The lock threshold is a Real in the range [0:1]. The passed value is clamped internally.

Returns:
The lock threshold of the gripper.

Definition at line 90 of file gripper_equipped_entity.cpp.

void argos::CGripperEquippedEntity::SetOffset ( const CVector3 c_offset) [inline]

Sets the offset of the gripper with respect to the reference point.

Parameters:
c_offsetThe offset of the gripper with respect to the reference point.

Definition at line 101 of file gripper_equipped_entity.h.


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