ARGoS
3
A parallel, multi-engine simulator for swarm robotics
|
An entity that stores the state of a robot gripper. More...
#include <gripper_equipped_entity.h>
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 CVector3 & | GetOffset () const |
Returns the offset of the gripper with respect to the reference point. | |
const CVector3 & | GetInitOffset () 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 CVector3 & | GetDirection () const |
Returns the facing direction of the gripper with respect to the local X-axis. | |
const CVector3 & | GetInitDirection () 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. | |
CEmbodiedEntity & | GetGrippedEntity () |
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. |
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.
Class constructor.
This constructor is meant to be used with the Init() method.
pc_parent | The 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.
pc_parent | The parent of this entity. |
str_id | The id of this entity. |
c_offset | The positional offset of this gripper with respect to the robot reference point. |
c_direction | The facing direction of this gripper. |
f_lock_threshold | The lock value above which the gripper is considered locked. |
Definition at line 32 of file gripper_equipped_entity.cpp.
void argos::CGripperEquippedEntity::ClearGrippedEntity | ( | ) | [inline] |
Clears the reference to the embodied entity currently gripped by this gripper.
Definition at line 217 of file gripper_equipped_entity.h.
Reimplemented from argos::CEntity.
const CVector3& argos::CGripperEquippedEntity::GetDirection | ( | ) | const [inline] |
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.
CARGoSException | if no entity is being gripped. |
Definition at line 98 of file gripper_equipped_entity.cpp.
const CVector3& argos::CGripperEquippedEntity::GetInitDirection | ( | ) | const [inline] |
Returns the initial facing direction of the gripper with respect to the local X-axis.
Definition at line 127 of file gripper_equipped_entity.h.
const CVector3& argos::CGripperEquippedEntity::GetInitOffset | ( | ) | const [inline] |
Returns the initial offset of the gripper with respect to the reference point.
Definition at line 93 of file gripper_equipped_entity.h.
Real argos::CGripperEquippedEntity::GetLockState | ( | ) | const [inline] |
Returns the lock state of the gripper.
The lock state is a Real in the range [0:1].
Definition at line 153 of file gripper_equipped_entity.h.
Real argos::CGripperEquippedEntity::GetLockThreshold | ( | ) | const [inline] |
Returns the lock threshold of the gripper.
The lock threshold is a Real in the range [0:1].
Definition at line 169 of file gripper_equipped_entity.h.
const CVector3& argos::CGripperEquippedEntity::GetOffset | ( | ) | const [inline] |
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.
Reimplemented from argos::CEntity.
Definition at line 221 of file gripper_equipped_entity.h.
void argos::CGripperEquippedEntity::Init | ( | TConfigurationNode & | t_tree | ) | [virtual] |
Initializes the state of the entity from the XML configuration tree.
CARGoSException | if a parse error occurs |
Reimplemented from argos::CEntity.
Definition at line 53 of file gripper_equipped_entity.cpp.
bool argos::CGripperEquippedEntity::IsGripping | ( | ) | const [inline] |
Returns true
if this gripper is gripping something.
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.
true
if the gripper is locked. Definition at line 187 of file gripper_equipped_entity.h.
void argos::CGripperEquippedEntity::Reset | ( | ) | [virtual] |
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.
c_direction | The facing direction of the gripper with respect to the local X-axis |
Definition at line 135 of file gripper_equipped_entity.h.
void argos::CGripperEquippedEntity::SetGrippedEntity | ( | CEmbodiedEntity & | c_entity | ) | [inline] |
Sets the embodied entity currently gripped by this gripper.
c_entity | The 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.
c_direction | The initial facing direction of the gripper with respect to the local X-axis |
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.
c_offset | The initial offset of the gripper with respect to the reference point. |
Definition at line 110 of file gripper_equipped_entity.h.
void argos::CGripperEquippedEntity::SetLockState | ( | Real | f_lock_state | ) |
Sets the lock state of the gripper.
The lock state is a Real in the range [0:1]. The passed value is clamped internally.
Definition at line 82 of file gripper_equipped_entity.cpp.
void argos::CGripperEquippedEntity::SetLockThreshold | ( | Real | f_lock_threshold | ) |
Sets the lock threshold of the gripper.
The lock threshold is a Real in the range [0:1]. The passed value is clamped internally.
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.
c_offset | The offset of the gripper with respect to the reference point. |
Definition at line 101 of file gripper_equipped_entity.h.