footbot_turret_encoder_default_sensor.cpp
Go to the documentation of this file.
1 
8 #include <argos3/core/simulator/entity/composable_entity.h>
9 
10 namespace argos {
11 
12  /****************************************/
13  /****************************************/
14 
16  m_pcTurretEntity(nullptr) {}
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 
60  }
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 }
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
REGISTER_SENSOR(CEPuckProximityDefaultSensor, "epuck_proximity", "default", "Danesh Tarapore [daneshtarapore@gmail.com]", "1.0", "The E-Puck proximity sensor.", "This sensor accesses the epuck proximity sensor. For a complete description\n" "of its usage, refer to the ci_epuck_proximity_sensor.h interface. For the XML\n" "configuration, refer to the default proximity sensor.\n", "Usable")
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.