ARGoS
3
A parallel, multi-engine simulator for swarm robotics
|
00001 00007 #include "footbot_gripper_default_actuator.h" 00008 #include <argos3/core/utility/logging/argos_log.h> 00009 #include <argos3/core/simulator/entity/composable_entity.h> 00010 00011 namespace argos { 00012 00013 /****************************************/ 00014 /****************************************/ 00015 00016 CFootBotGripperDefaultActuator::CFootBotGripperDefaultActuator() : 00017 m_pcGripperEquippedEntity(NULL) {} 00018 00019 /****************************************/ 00020 /****************************************/ 00021 00022 void CFootBotGripperDefaultActuator::SetRobot(CComposableEntity& c_entity) { 00023 m_pcGripperEquippedEntity = &(c_entity.GetComponent<CGripperEquippedEntity>("gripper")); 00024 m_pcGripperEquippedEntity->SetCanBeEnabledIfDisabled(true); 00025 m_pcGripperEquippedEntity->Enable(); 00026 } 00027 00028 /****************************************/ 00029 /****************************************/ 00030 00031 void CFootBotGripperDefaultActuator::Update() { 00032 m_pcGripperEquippedEntity->SetLockState(Abs(m_cAperture) / CRadians::PI_OVER_TWO); 00033 } 00034 00035 /****************************************/ 00036 /****************************************/ 00037 00038 void CFootBotGripperDefaultActuator::Reset() { 00039 Unlock(); 00040 } 00041 00042 /****************************************/ 00043 /****************************************/ 00044 00045 } 00046 00047 REGISTER_ACTUATOR(CFootBotGripperDefaultActuator, 00048 "footbot_gripper", "default", 00049 "Carlo Pinciroli [ilpincy@gmail.com]", 00050 "1.0", 00051 "The footbot gripper actuator.", 00052 "This actuator controls the foot-bot gripper. For a complete description of its\n" 00053 "usage, refer to the ci_footbot_gripper_actuator.h file.\n\n" 00054 "REQUIRED XML CONFIGURATION\n\n" 00055 " <controllers>\n" 00056 " ...\n" 00057 " <my_controller ...>\n" 00058 " ...\n" 00059 " <actuators>\n" 00060 " ...\n" 00061 " <footbot_gripper implementation=\"default\" />\n" 00062 " ...\n" 00063 " </actuators>\n" 00064 " ...\n" 00065 " </my_controller>\n" 00066 " ...\n" 00067 " </controllers>\n\n" 00068 "OPTIONAL XML CONFIGURATION\n\n" 00069 "None.\n", 00070 "Usable" 00071 ); 00072