ARGoS  3
A parallel, multi-engine simulator for swarm robotics
plugins/simulator/actuators/gripper_default_actuator.cpp
Go to the documentation of this file.
00001 
00007 #include "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    CGripperDefaultActuator::CGripperDefaultActuator() :
00017       m_pcGripperEquippedEntity(NULL) {}
00018 
00019    /****************************************/
00020    /****************************************/
00021 
00022    void CGripperDefaultActuator::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 CGripperDefaultActuator::Update() {
00032       m_pcGripperEquippedEntity->SetLockState(m_fLockState);
00033    }
00034 
00035    /****************************************/
00036    /****************************************/
00037 
00038    void CGripperDefaultActuator::Reset() {
00039       m_fLockState = 0.0;
00040    }
00041 
00042    /****************************************/
00043    /****************************************/
00044 
00045 }
00046 
00047 REGISTER_ACTUATOR(CGripperDefaultActuator,
00048                   "gripper", "default",
00049                   "Carlo Pinciroli [ilpincy@gmail.com]",
00050                   "1.0",
00051                   "The Gripper actuator.",
00052                   "This actuator controls a gripper. For a complete description of its\n"
00053                   "usage, refer to the ci_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                   "        <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