ARGoS
3
A parallel, multi-engine simulator for swarm robotics
range_and_bearing_default_actuator.cpp
Go to the documentation of this file.
1
6
7
#include "
range_and_bearing_default_actuator.h
"
8
#include <argos3/core/simulator/entity/composable_entity.h>
9
#include <argos3/core/simulator/simulator.h>
10
11
namespace
argos
{
12
13
/****************************************/
14
/****************************************/
15
16
void
CRangeAndBearingDefaultActuator::SetRobot
(
CComposableEntity
& c_entity) {
17
m_pcRangeAndBearingEquippedEntity = &c_entity.
GetComponent
<
CRABEquippedEntity
>(
"rab"
);
18
m_pcRangeAndBearingEquippedEntity->
Enable
();
19
m_cData
.Resize(m_pcRangeAndBearingEquippedEntity->GetMsgSize());
20
}
21
22
/****************************************/
23
/****************************************/
24
25
void
CRangeAndBearingDefaultActuator::Update
() {
26
m_pcRangeAndBearingEquippedEntity->SetData(
m_cData
);
27
}
28
29
/****************************************/
30
/****************************************/
31
32
void
CRangeAndBearingDefaultActuator::Reset
() {
33
m_cData
.Zero();
34
}
35
36
/****************************************/
37
/****************************************/
38
39
REGISTER_ACTUATOR
(
CRangeAndBearingDefaultActuator
,
40
"range_and_bearing"
,
"default"
,
41
"Carlo Pinciroli [ilpincy@gmail.com]"
,
42
"1.0"
,
43
"The range and bearing actuator."
,
44
45
"This actuator allows robots to perform situated communication, i.e., a form of\n"
46
"wireless communication whereby the receiver also knows the location of the\n"
47
"sender with respect to its own frame of reference.\n"
48
"This actuator allows a robot to send messages. To receive messages, you need\n"
49
"the range-and-bearing sensor.\n"
50
"To use this actuator, in controllers you must include the\n"
51
"ci_range_and_bearing_actuator.h header.\n\n"
52
53
"REQUIRED XML CONFIGURATION\n\n"
54
55
" <controllers>\n"
56
" ...\n"
57
" <my_controller ...>\n"
58
" ...\n"
59
" <actuators>\n"
60
" ...\n"
61
" <range_and_bearing implementation=\"default\" />\n"
62
" ...\n"
63
" </actuators>\n"
64
" ...\n"
65
" </my_controller>\n"
66
" ...\n"
67
" </controllers>\n\n"
68
69
"OPTIONAL XML CONFIGURATION\n\n"
70
71
"None.\n"
,
72
73
"Usable"
);
74
75
}
range_and_bearing_default_actuator.h
REGISTER_ACTUATOR
#define REGISTER_ACTUATOR(CLASSNAME, LABEL, IMPLEMENTATION, AUTHOR, VERSION, BRIEF_DESCRIPTION, LONG_DESCRIPTION, STATUS)
Registers a new actuator model inside ARGoS.
Definition
actuator.h:59
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::CComposableEntity::GetComponent
CEntity & GetComponent(const std::string &str_component)
Returns the component with the passed string label.
Definition
composable_entity.cpp:109
argos::CEntity::Enable
void Enable()
Enables the entity.
Definition
entity.h:265
argos::CCI_RangeAndBearingActuator::m_cData
CByteArray m_cData
Definition
ci_range_and_bearing_actuator.h:40
argos::CRangeAndBearingDefaultActuator
Definition
range_and_bearing_default_actuator.h:24
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::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::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
Definition
rab_equipped_entity.h:26
plugins
robots
generic
simulator
range_and_bearing_default_actuator.cpp
Generated on Tue Mar 4 2025 00:50:32 for ARGoS by
1.13.2