footbot_gripper_default_actuator.cpp
Go to the documentation of this file.
1 
8 #include <argos3/core/utility/logging/argos_log.h>
9 #include <argos3/core/simulator/entity/composable_entity.h>
10 
11 namespace argos {
12 
13  /****************************************/
14  /****************************************/
15 
17  m_pcGripperEquippedEntity(nullptr) {}
18 
19  /****************************************/
20  /****************************************/
21 
23  m_pcGripperEquippedEntity = &(c_entity.GetComponent<CGripperEquippedEntity>("gripper"));
24  m_pcGripperEquippedEntity->Enable();
25  }
26 
27  /****************************************/
28  /****************************************/
29 
31  m_pcGripperEquippedEntity->SetLockState(Abs(m_cAperture) / CRadians::PI_OVER_TWO);
32  }
33 
34  /****************************************/
35  /****************************************/
36 
38  Unlock();
39  }
40 
41  /****************************************/
42  /****************************************/
43 
44 }
45 
46 REGISTER_ACTUATOR(CFootBotGripperDefaultActuator,
47  "footbot_gripper", "default",
48  "Carlo Pinciroli [ilpincy@gmail.com]",
49  "1.0",
50  "The footbot gripper actuator.",
51  "This actuator controls the foot-bot gripper. For a complete description of its\n"
52  "usage, refer to the ci_footbot_gripper_actuator.h file.\n\n"
53  "REQUIRED XML CONFIGURATION\n\n"
54  " <controllers>\n"
55  " ...\n"
56  " <my_controller ...>\n"
57  " ...\n"
58  " <actuators>\n"
59  " ...\n"
60  " <footbot_gripper implementation=\"default\" />\n"
61  " ...\n"
62  " </actuators>\n"
63  " ...\n"
64  " </my_controller>\n"
65  " ...\n"
66  " </controllers>\n\n"
67  "OPTIONAL XML CONFIGURATION\n\n"
68  "None.\n",
69  "Usable"
70  );
71 
REGISTER_ACTUATOR(CFootBotGripperDefaultActuator, "footbot_gripper", "default", "Carlo Pinciroli [ilpincy@gmail.com]", "1.0", "The footbot gripper actuator.", "This actuator controls the foot-bot gripper. For a complete description of its\n" "usage, refer to the ci_footbot_gripper_actuator.h file.\n\n" "REQUIRED XML CONFIGURATION\n\n" " <controllers>\n" " ...\n" " <my_controller ...>\n" " ...\n" " <actuators>\n" " ...\n" " <footbot_gripper implementation=\"default\" />\n" " ...\n" " </actuators>\n" " ...\n" " </my_controller>\n" " ...\n" " </controllers>\n\n" "OPTIONAL XML CONFIGURATION\n\n" "None.\n", "Usable")
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
T Abs(const T &t_v)
Returns the absolute value of the passed argument.
Definition: general.h:25
Basic class for an entity that contains other entities.
CEntity & GetComponent(const std::string &str_component)
Returns the component with the passed string label.
void Enable()
Enables the entity.
Definition: entity.h:265
static const CRadians PI_OVER_TWO
Set to PI / 2.
Definition: angles.h:59
void Unlock()
Unlock gripper: objects are released.
virtual void SetRobot(CComposableEntity &c_entity)
Sets the entity associated to this actuator.
virtual void Reset()
Resets the actuator to the state it had just after Init().
virtual void Update()
Updates the state of the entity associated to this actuator.
An entity that stores the state of a robot gripper.
void SetLockState(Real f_lock_state)
Sets the lock state of the gripper.