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. More... | |
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. More... | |
virtual void | Init (TConfigurationNode &t_tree) |
Initializes the state of the entity from the XML configuration tree. More... | |
virtual void | Reset () |
Resets the state of the entity to whatever it was after Init() or one of the standalone constructors was called. More... | |
const CVector3 & | GetOffset () const |
Returns the offset of the gripper with respect to the reference point. More... | |
const CVector3 & | GetInitOffset () const |
Returns the initial offset of the gripper with respect to the reference point. More... | |
void | SetOffset (const CVector3 &c_offset) |
Sets the offset of the gripper with respect to the reference point. More... | |
void | SetInitOffset (const CVector3 &c_offset) |
Sets the initial offset of the gripper with respect to the reference point. More... | |
const CVector3 & | GetDirection () const |
Returns the facing direction of the gripper with respect to the local X-axis. More... | |
const CVector3 & | GetInitDirection () const |
Returns the initial facing direction of the gripper with respect to the local X-axis. More... | |
void | SetDirection (const CVector3 &c_direction) |
Sets the facing direction of the gripper with respect to the local X-axis. More... | |
void | SetInitDirection (const CVector3 &c_direction) |
Sets the initial facing direction of the gripper with respect to the local X-axis. More... | |
Real | GetLockState () const |
Returns the lock state of the gripper. More... | |
void | SetLockState (Real f_lock_state) |
Sets the lock state of the gripper. More... | |
Real | GetLockThreshold () const |
Returns the lock threshold of the gripper. More... | |
void | SetLockThreshold (Real f_lock_threshold) |
Sets the lock threshold of the gripper. More... | |
bool | IsLocked () const |
Returns true if the gripper is locked. More... | |
bool | IsGripping () const |
Returns true if this gripper is gripping something. More... | |
CEmbodiedEntity & | GetGrippedEntity () |
Returns the embodied entity currently gripped by this gripper. More... | |
void | SetGrippedEntity (CEmbodiedEntity &c_entity) |
Sets the embodied entity currently gripped by this gripper. More... | |
void | ClearGrippedEntity () |
Clears the reference to the embodied entity currently gripped by this gripper. More... | |
virtual std::string | GetTypeDescription () const |
Returns a string label for this class. More... | |
Public Member Functions inherited from argos::CEntity | |
ENABLE_VTABLE () | |
CEntity (CComposableEntity *pc_parent) | |
Class constructor. More... | |
CEntity (CComposableEntity *pc_parent, const std::string &str_id) | |
Class constructor. More... | |
virtual | ~CEntity () |
Class destructor. More... | |
virtual void | Destroy () |
Destroys the entity, undoing whatever was done by Init() or by the standalone constructor. More... | |
const std::string & | GetId () const |
Returns the id of this entity. More... | |
std::string | GetContext () const |
Returns the context of this entity. More... | |
bool | HasParent () const |
Returns true if this entity has a parent. More... | |
CEntity & | GetRootEntity () |
Returns the root entity containing this entity. More... | |
const CEntity & | GetRootEntity () const |
Returns the root entity containing this entity. More... | |
CComposableEntity & | GetParent () |
Returns this entity's parent. More... | |
const CComposableEntity & | GetParent () const |
Returns this entity's parent. More... | |
void | SetParent (CComposableEntity &c_parent) |
Sets this entity's parent. More... | |
virtual void | Update () |
Updates the state of this entity. More... | |
ssize_t | GetIndex () const |
Returns the entity index. More... | |
void | SetIndex (ssize_t n_idx) |
Sets the entity index. More... | |
bool | IsEnabled () const |
Returns true if the entity is enabled. More... | |
void | Enable () |
Enables the entity. More... | |
void | Disable () |
Disables the entity. More... | |
virtual void | SetEnabled (bool b_enabled) |
Enables or disables an entity. More... | |
TConfigurationNode * | GetConfigurationNode () |
Returns a pointer to the configuration node that was used to create this entity. More... | |
Public Member Functions inherited from argos::CBaseConfigurableResource | |
virtual | ~CBaseConfigurableResource () |
Class destructor. More... | |
Public Member Functions inherited from argos::EnableVTableFor< CEntity > | |
size_t | GetTagHelper (const DERIVED *) const |
Additional Inherited Members | |
Public Types inherited from argos::CEntity | |
typedef std::vector< CEntity * > | TVector |
A vector of entities. More... | |
typedef unordered_map< std::string, CEntity * > | TMap |
A map of entities. More... | |
typedef std::multimap< std::string, CEntity * > | TMultiMap |
A multi-map of entities. More... | |
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.
argos::CGripperEquippedEntity::CGripperEquippedEntity | ( | CComposableEntity * | pc_parent | ) |
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 31 of file gripper_equipped_entity.cpp.
|
inline |
Clears the reference to the embodied entity currently gripped by this gripper.
Definition at line 217 of file gripper_equipped_entity.h.
argos::CGripperEquippedEntity::ENABLE_VTABLE | ( | ) |
|
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.
CEmbodiedEntity & argos::CGripperEquippedEntity::GetGrippedEntity | ( | ) |
Returns the embodied entity currently gripped by this gripper.
CARGoSException | if no entity is being gripped. |
Definition at line 96 of file gripper_equipped_entity.cpp.
|
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.
|
inline |
Returns the initial offset of the gripper with respect to the reference point.
Definition at line 93 of file gripper_equipped_entity.h.
|
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.
|
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.
|
inline |
Returns the offset of the gripper with respect to the reference point.
Definition at line 84 of file gripper_equipped_entity.h.
|
inlinevirtual |
Returns a string label for this class.
Reimplemented from argos::CEntity.
Definition at line 221 of file gripper_equipped_entity.h.
|
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 51 of file gripper_equipped_entity.cpp.
|
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.
|
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.
|
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 70 of file gripper_equipped_entity.cpp.
|
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.
|
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.
|
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.
|
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 80 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 88 of file gripper_equipped_entity.cpp.
|
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.