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(NULL) {}
17 
18  /****************************************/
19  /****************************************/
20 
22  m_pcTurretEntity = &(c_entity.GetComponent<CFootBotTurretEntity>("turret"));
23  m_pcTurretEntity->Enable();
24  }
25 
26  /****************************************/
27  /****************************************/
28 
30  m_cRotation = m_pcTurretEntity->GetRotation();
31  }
32 
33  /****************************************/
34  /****************************************/
35 
38  }
39 
40  /****************************************/
41  /****************************************/
42 
44  "footbot_turret_encoder", "default",
45  "Carlo Pinciroli [ilpincy@gmail.com]",
46  "1.0",
47  "The foot-bot turret encoder sensor.",
48  "This sensor accesses the foot-bot turret encoder. For a complete\n"
49  "description of its usage, refer to the ci_footbot_turret_encoder_sensor\n"
50  "file.\n\n"
51  "REQUIRED XML CONFIGURATION\n\n"
52  " <controllers>\n"
53  " ...\n"
54  " <my_controller ...>\n"
55  " ...\n"
56  " <sensors>\n"
57  " ...\n"
58  " <footbot_turret_encoder implementation=\"default\" />\n"
59  " ...\n"
60  " </sensors>\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 
70 }
Basic class for an entity that contains other entities.
REGISTER_SENSOR(CEyeBotLightRotZOnlySensor, "eyebot_light", "rot_z_only", "Carlo Pinciroli [ilpincy@gmail.com]", "1.0", "The eye-bot light sensor (optimized for 2D).", "This sensor accesses a set of light sensors. The sensors all return a value\ "between 0 and 1, where 0 means nothing within range and 1 means the perceived\" "light saturates the sensor. Values between 0 and 1 depend on the distance of\" "the perceived light. Each reading R is calculated with R=(I/x)^2, where x is the\" "distance between a sensor and the light, and I is the reference intensity of the\" "perceived light. The reference intensity corresponds to the minimum distance at\" "which the light saturates a sensor. The reference intensity depends on the\" "individual light, and it is set with the \intensity\ attribute of the light\" "entity. In case multiple lights are present in the environment, each sensor\" "reading is calculated as the sum of the individual readings due to each light.\" "In other words, light wave interference is not taken into account. In\" "controllers, you must include the ci_light_sensor.h header.\\" "REQUIRED XML CONFIGURATION\\" "< controllers >\" " ...\" "< my_controller ... >\" " ...\" "< sensors >\" " ...\" "< eyebot_light implementation=\rot_z_only\/>\" " ...\" "</sensors >\" " ...\" "</my_controller >\" " ...\" "</controllers >\\" "OPTIONAL XML CONFIGURATION\\" "It is possible to draw the rays shot by the light sensor in the OpenGL\" "visualization. This can be useful for sensor debugging but also to understand\" "what 's wrong in your controller. In OpenGL, the rays are drawn in cyan when\" "they are not obstructed and in purple when they are. In case a ray is\" "obstructed, a black dot is drawn where the intersection occurred.\" "To turn this functionality on, add the attribute \show_rays\ as in this\" "example:\\" "< controllers >\" " ...\" "< my_controller ... >\" " ...\" "< sensors >\" " ...\" "< eyebot_light implementation=\rot_z_only\\" " show_rays=\true\/>\" " ...\" "</sensors >\" " ...\" "</my_controller >\" " ...\" "</controllers >\\" "It is possible to add uniform noise to the sensors, thus matching the\" "characteristics of a real robot better. This can be done with the attribute\" "\noise_level\, whose allowed range is in [-1, 1] and is added to the calculated\" "reading. The final sensor reading is always normalized in the [0-1] range.\\" "< controllers >\" " ...\" "< my_controller ... >\" " ...\" "< sensors >\" " ...\" "< eyebot_light implementation=\rot_z_only\\" " noise_level=\0.1\/>\" " ...\" "</sensors >\" " ...\" "</my_controller >\" " ...\" "</controllers >\\" "OPTIONAL XML CONFIGURATION\\" "None.\", "Usable")
static const CRadians ZERO
Set to zero radians.
Definition: angles.h:79
virtual void SetRobot(CComposableEntity &c_entity)
Sets the entity associated to this sensor.
virtual void Update()
Updates the state of the entity associated to this sensor.
void Enable()
Enables the entity.
Definition: entity.h:265
virtual void Reset()
Resets the sensor to the state it had just after Init().
CEntity & GetComponent(const std::string &str_component)
Returns the component with the passed string label.
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12