ARGoS  3
A parallel, multi-engine simulator for swarm robotics
range_and_bearing_default_actuator.cpp
Go to the documentation of this file.
1 
8 #include <argos3/core/simulator/entity/composable_entity.h>
9 #include <argos3/core/simulator/simulator.h>
10 
11 namespace argos {
12 
13  /****************************************/
14  /****************************************/
15 
17  m_pcRangeAndBearingEquippedEntity = &c_entity.GetComponent<CRABEquippedEntity>("rab");
18  m_pcRangeAndBearingEquippedEntity->Enable();
19  m_cData.Resize(m_pcRangeAndBearingEquippedEntity->GetMsgSize());
20  }
21 
22  /****************************************/
23  /****************************************/
24 
26  m_pcRangeAndBearingEquippedEntity->SetData(m_cData);
27  }
28 
29  /****************************************/
30  /****************************************/
31 
33  m_cData.Zero();
34  }
35 
36  /****************************************/
37  /****************************************/
38 
40  "range_and_bearing", "default",
41  "Carlo Pinciroli [ilpincy@gmail.com]",
42  "1.0",
43  "The range and bearing actuator.",
44  "This actuator allows robots to perform situated communication, i.e., a form of\n"
45  "wireless communication whereby the receiver also knows the location of the\n"
46  "sender with respect to its own frame of reference.\n"
47  "This actuator allows a robot to send messages. To receive messages, you need\n"
48  "the range-and-bearing sensor.\n"
49  "To use this actuator, in controllers you must include the\n"
50  "ci_range_and_bearing_actuator.h header.\n\n"
51  "REQUIRED XML CONFIGURATION\n\n"
52  " <controllers>\n"
53  " ...\n"
54  " <my_controller ...>\n"
55  " ...\n"
56  " <actuators>\n"
57  " ...\n"
58  " <range_and_bearing implementation=\"default\" />\n"
59  " ...\n"
60  " </actuators>\n"
61  " ...\n"
62  " </my_controller>\n"
63  " ...\n"
64  " </controllers>\n\n"
65  "OPTIONAL XML CONFIGURATION\n\n"
66  "None for the time being.\n",
67  "Usable");
68 
69 }
argos::CRangeAndBearingDefaultActuator::SetRobot
virtual void SetRobot(CComposableEntity &c_entity)
Sets the entity associated to this actuator.
Definition: range_and_bearing_default_actuator.cpp:16
argos::CRABEquippedEntity::Enable
virtual void Enable()
Definition: rab_equipped_entity.cpp:129
argos
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
argos::CComposableEntity
Basic class for an entity that contains other entities.
Definition: composable_entity.h:32
argos::CRangeAndBearingDefaultActuator::Update
virtual void Update()
Updates the state of the entity associated to this actuator.
Definition: range_and_bearing_default_actuator.cpp:25
argos::CByteArray::Resize
void Resize(size_t un_size, UInt8 un_value=0)
Resizes the byte array to the wanted size.
Definition: byte_array.h:83
argos::CComposableEntity::GetComponent
CEntity & GetComponent(const std::string &str_component)
Returns the component with the passed string label.
Definition: composable_entity.cpp:109
argos::CRangeAndBearingDefaultActuator::Reset
virtual void Reset()
Resets the actuator to the state it had just after Init().
Definition: range_and_bearing_default_actuator.cpp:32
argos::CRABEquippedEntity::SetData
void SetData(const CByteArray &c_data)
Definition: rab_equipped_entity.cpp:143
argos::CRABEquippedEntity
Definition: rab_equipped_entity.h:25
argos::CRangeAndBearingDefaultActuator
Definition: range_and_bearing_default_actuator.h:23
argos::REGISTER_ACTUATOR
REGISTER_ACTUATOR(CFootBotDistanceScannerDefaultActuator, "footbot_distance_scanner", "default", "Carlo Pinciroli [ilpincy@gmail.com]", "1.0", "The foot-bot distance scanner actuator.", "This actuator controls the foot-bot distance scanner. For a complete\n" "description of its usage, refer to the ci_footbot_distance_scanner_actuator\n" "file.\n\n" "REQUIRED XML CONFIGURATION\n\n" " <controllers>\n" " ...\n" " <my_controller ...>\n" " ...\n" " <actuators>\n" " ...\n" " <footbot_distance_scanner implementation=\"default\" />\n" " ...\n" " </actuators>\n" " ...\n" " </my_controller>\n" " ...\n" " </controllers>\n\n" "OPTIONAL XML CONFIGURATION\n\n" "None for the time being.\n", "Usable")
range_and_bearing_default_actuator.h
argos::CRABEquippedEntity::GetMsgSize
size_t GetMsgSize() const
Definition: rab_equipped_entity.h:63
argos::CByteArray::Zero
void Zero()
Sets the contents of the byte array to all zeros.
Definition: byte_array.cpp:81
argos::CCI_RangeAndBearingActuator::m_cData
CByteArray m_cData
Definition: ci_range_and_bearing_actuator.h:40