ARGoS  3
A parallel, multi-engine simulator for swarm robotics
plugins/simulator/actuators/range_and_bearing_default_actuator.cpp
Go to the documentation of this file.
00001 
00007 #include "range_and_bearing_default_actuator.h"
00008 #include <argos3/core/simulator/entity/composable_entity.h>
00009 #include <argos3/core/simulator/simulator.h>
00010 
00011 namespace argos {
00012 
00013    /****************************************/
00014    /****************************************/
00015 
00016    void CRangeAndBearingDefaultActuator::SetRobot(CComposableEntity& c_entity) {
00017       m_pcRangeAndBearingEquippedEntity = &c_entity.GetComponent<CRABEquippedEntity>("rab");
00018       m_pcRangeAndBearingEquippedEntity->SetCanBeEnabledIfDisabled(true);
00019       m_pcRangeAndBearingEquippedEntity->Enable();
00020       m_cData.Resize(m_pcRangeAndBearingEquippedEntity->GetMsgSize());
00021    }
00022 
00023    /****************************************/
00024    /****************************************/
00025 
00026    void CRangeAndBearingDefaultActuator::Update() {
00027       m_pcRangeAndBearingEquippedEntity->SetData(m_cData);
00028    }
00029 
00030    /****************************************/
00031    /****************************************/
00032 
00033    void CRangeAndBearingDefaultActuator::Reset() {
00034       m_cData.Zero();
00035    }
00036 
00037    /****************************************/
00038    /****************************************/
00039 
00040    REGISTER_ACTUATOR(CRangeAndBearingDefaultActuator,
00041                      "range_and_bearing", "default",
00042                      "Carlo Pinciroli [ilpincy@gmail.com]",
00043                      "1.0",
00044                      "The range and bearing actuator.",
00045                      "This actuator allows robots to perform situated communication, i.e., a form of\n"
00046                      "wireless communication whereby the receiver also knows the location of the\n"
00047                      "sender with respect to its own frame of reference.\n"
00048                      "This actuator allows a robot to send messages. To receive messages, you need\n"
00049                      "the range-and-bearing sensor.\n"
00050                      "To use this actuator, in controllers you must include the\n"
00051                      "ci_range_and_bearing_actuator.h header.\n\n"
00052                      "REQUIRED XML CONFIGURATION\n\n"
00053                      "  <controllers>\n"
00054                      "    ...\n"
00055                      "    <my_controller ...>\n"
00056                      "      ...\n"
00057                      "      <actuators>\n"
00058                      "        ...\n"
00059                      "        <range_and_bearing implementation=\"default\" />\n"
00060                      "        ...\n"
00061                      "      </actuators>\n"
00062                      "      ...\n"
00063                      "    </my_controller>\n"
00064                      "    ...\n"
00065                      "  </controllers>\n\n"
00066                      "OPTIONAL XML CONFIGURATION\n\n"
00067                      "None for the time being.\n",
00068                      "Usable");
00069    
00070 }