ARGoS 3
A parallel, multi-engine simulator for swarm robotics
footbot_turret_encoder_default_sensor.cpp
Go to the documentation of this file.
1
8#include <argos3/core/simulator/entity/composable_entity.h>
9
10namespace argos {
11
12 /****************************************/
13 /****************************************/
14
17
18 /****************************************/
19 /****************************************/
20
22 m_pcTurretEntity = &(c_entity.GetComponent<CFootBotTurretEntity>("turret"));
23
24 /* sensor is enabled by default */
25 Enable();
26 }
27
28 /****************************************/
29 /****************************************/
30
32 /* sensor is disabled--nothing to do */
33 if (IsDisabled()) {
34 return;
35 }
36 m_cRotation = m_pcTurretEntity->GetRotation();
37 }
38
39 /****************************************/
40 /****************************************/
41
43 m_pcTurretEntity->Enable();
45 }
46
47 /****************************************/
48 /****************************************/
49
51 m_pcTurretEntity->Disable();
53 }
54
55 /****************************************/
56 /****************************************/
57
61
62 /****************************************/
63 /****************************************/
64
66 "footbot_turret_encoder", "default",
67 "Carlo Pinciroli [ilpincy@gmail.com]",
68 "1.0",
69 "The foot-bot turret encoder sensor.",
70 "This sensor accesses the foot-bot turret encoder. For a complete\n"
71 "description of its usage, refer to the ci_footbot_turret_encoder_sensor\n"
72 "file.\n\n"
73
74 "This sensor is enabled by default.\n\n"
75
76 "REQUIRED XML CONFIGURATION\n\n"
77
78 " <controllers>\n"
79 " ...\n"
80 " <my_controller ...>\n"
81 " ...\n"
82 " <sensors>\n"
83 " ...\n"
84 " <footbot_turret_encoder implementation=\"default\" />\n"
85 " ...\n"
86 " </sensors>\n"
87 " ...\n"
88 " </my_controller>\n"
89 " ...\n"
90 " </controllers>\n\n"
91 "OPTIONAL XML CONFIGURATION\n\n"
92 "None for the time being.\n",
93 "Usable"
94 );
95
96}
#define REGISTER_SENSOR(CLASSNAME, LABEL, IMPLEMENTATION, AUTHOR, VERSION, BRIEF_DESCRIPTION, LONG_DESCRIPTION, STATUS)
Registers a new sensor model inside ARGoS.
Definition sensor.h:63
The namespace containing all the ARGoS related code.
Definition ci_actuator.h:12
virtual void Enable()
Enables updating of sensor information in the event loop.
Definition ci_sensor.h:78
bool IsDisabled() const
Definition ci_sensor.h:86
virtual void Disable()
Disables updating of sensor information in the event loop.
Definition ci_sensor.h:83
Basic class for an entity that contains other entities.
CEntity & GetComponent(const std::string &str_component)
Returns the component with the passed string label.
void Disable()
Disables the entity.
Definition entity.h:275
void Enable()
Enables the entity.
Definition entity.h:265
static const CRadians ZERO
Set to zero radians.
Definition angles.h:79
virtual void Reset()
Resets the sensor to the state it had just after Init().
virtual void Update()
Updates the state of the entity associated to this sensor, if the sensor is currently enabled.
virtual void Disable()
Disables updating of sensor information in the event loop.
virtual void Enable()
Enables updating of sensor information in the event loop.
virtual void SetRobot(CComposableEntity &c_entity)
Sets the entity associated to this sensor.