ARGoS  3
A parallel, multi-engine simulator for swarm robotics
eyebot_entity.cpp
Go to the documentation of this file.
1 
7 #include "eyebot_entity.h"
8 
9 #include <argos3/core/simulator/space/space.h>
10 #include <argos3/core/simulator/entity/controllable_entity.h>
11 #include <argos3/core/simulator/entity/embodied_entity.h>
12 #include <argos3/plugins/simulator/entities/led_equipped_entity.h>
13 #include <argos3/plugins/simulator/entities/light_sensor_equipped_entity.h>
14 #include <argos3/plugins/simulator/entities/perspective_camera_equipped_entity.h>
15 #include <argos3/plugins/simulator/entities/proximity_sensor_equipped_entity.h>
16 #include <argos3/plugins/simulator/entities/quadrotor_entity.h>
17 #include <argos3/plugins/simulator/entities/rab_equipped_entity.h>
18 
19 namespace argos {
20 
21  /****************************************/
22  /****************************************/
23 
24  static const Real BODY_HEIGHT = 0.566f;
25  static const Real BODY_RADIUS = 0.25f;
26  static const Real LED_RING_RADIUS = BODY_RADIUS + 0.005;
27  static const Real LED_LOWER_RING_ELEVATION = 0.1535f;
28  static const Real LED_UPPER_RING_ELEVATION = 0.1635f;
29  static const CRadians LED_ANGLE_SLICE = CRadians(3.14159265358979323846264338327950288 / 8.0);
30  static const CRadians HALF_LED_ANGLE_SLICE = LED_ANGLE_SLICE * 0.5f;
31  static const Real PROXIMITY_SENSOR_RING_ELEVATION = LED_UPPER_RING_ELEVATION;
32  static const Real PROXIMITY_SENSOR_RING_RADIUS = LED_RING_RADIUS;
33  static const CRadians PROXIMITY_SENSOR_RING_START_ANGLE = CRadians((ARGOS_PI / 12.0f) * 0.5f);
34  static const Real PROXIMITY_SENSOR_RING_RANGE = 3.0f;
35 
36  /****************************************/
37  /****************************************/
38 
40  CComposableEntity(NULL),
41  m_pcControllableEntity(NULL),
42  m_pcEmbodiedEntity(NULL),
43  m_pcLEDEquippedEntity(NULL),
44  m_pcLightSensorEquippedEntity(NULL),
45  m_pcPerspectiveCameraEquippedEntity(NULL),
46  m_pcProximitySensorEquippedEntity(NULL),
47  m_pcQuadRotorEntity(NULL),
48  m_pcRABEquippedEntity(NULL) {
49  }
50 
51  /****************************************/
52  /****************************************/
53 
54  CEyeBotEntity::CEyeBotEntity(const std::string& str_id,
55  const std::string& str_controller_id,
56  const CVector3& c_position,
57  const CQuaternion& c_orientation,
58  Real f_rab_range,
59  size_t un_rab_data_size,
60  const CRadians& c_perspcam_aperture,
61  Real f_perspcam_focal_length,
62  Real f_perspcam_range) :
63  CComposableEntity(NULL, str_id),
64  m_pcControllableEntity(NULL),
65  m_pcEmbodiedEntity(NULL),
66  m_pcLEDEquippedEntity(NULL),
67  m_pcLightSensorEquippedEntity(NULL),
68  m_pcPerspectiveCameraEquippedEntity(NULL),
69  m_pcProximitySensorEquippedEntity(NULL),
70  m_pcQuadRotorEntity(NULL),
71  m_pcRABEquippedEntity(NULL) {
72  try {
73  /*
74  * Create and init components
75  */
76  /*
77  * Embodied entity
78  * Better to put this first, because many other entities need this one
79  */
80  m_pcEmbodiedEntity = new CEmbodiedEntity(this, "body_0", c_position, c_orientation);
81  AddComponent(*m_pcEmbodiedEntity);
82  /* Quadrotor entity */
83  m_pcQuadRotorEntity = new CQuadRotorEntity(this, "quadrotor_0");
84  AddComponent(*m_pcQuadRotorEntity);
85  /* LED equipped entity, with LEDs [0-11] and beacon [12] */
86  m_pcLEDEquippedEntity = new CLEDEquippedEntity(this, "leds_0");
87  m_pcLEDEquippedEntity->AddLEDRing(
88  CVector3(0.0f, 0.0f, LED_LOWER_RING_ELEVATION),
89  LED_RING_RADIUS,
90  HALF_LED_ANGLE_SLICE,
91  16,
92  m_pcEmbodiedEntity->GetOriginAnchor());
93  m_pcLEDEquippedEntity->AddLEDRing(
94  CVector3(0.0f, 0.0f, LED_UPPER_RING_ELEVATION),
95  LED_RING_RADIUS,
96  HALF_LED_ANGLE_SLICE,
97  16,
98  m_pcEmbodiedEntity->GetOriginAnchor());
99  CVector3 cLEDPos(LED_RING_RADIUS * 0.7f,
100  0.0f,
101  LED_LOWER_RING_ELEVATION - 0.01f);
102  cLEDPos.RotateZ(3.0f * CRadians::PI_OVER_FOUR);
103  m_pcLEDEquippedEntity->AddLED(
104  cLEDPos,
105  m_pcEmbodiedEntity->GetOriginAnchor());
106  AddComponent(*m_pcLEDEquippedEntity);
107  /* Proximity sensor equipped entity */
108  m_pcProximitySensorEquippedEntity =
110  "proximity_0");
111  AddComponent(*m_pcProximitySensorEquippedEntity);
112  m_pcProximitySensorEquippedEntity->AddSensorRing(
113  CVector3(0.0f, 0.0f, PROXIMITY_SENSOR_RING_ELEVATION),
114  PROXIMITY_SENSOR_RING_RADIUS,
115  PROXIMITY_SENSOR_RING_START_ANGLE,
116  PROXIMITY_SENSOR_RING_RANGE,
117  24,
118  m_pcEmbodiedEntity->GetOriginAnchor());
119  /* Light sensor equipped entity */
120  m_pcLightSensorEquippedEntity =
122  "light_0");
123  AddComponent(*m_pcLightSensorEquippedEntity);
124  m_pcLightSensorEquippedEntity->AddSensorRing(
125  CVector3(0.0f, 0.0f, PROXIMITY_SENSOR_RING_ELEVATION),
126  PROXIMITY_SENSOR_RING_RADIUS,
127  PROXIMITY_SENSOR_RING_START_ANGLE,
128  PROXIMITY_SENSOR_RING_RANGE,
129  24,
130  m_pcEmbodiedEntity->GetOriginAnchor());
131  /* RAB equipped entity */
132  m_pcRABEquippedEntity = new CRABEquippedEntity(
133  this,
134  "rab_0",
135  un_rab_data_size,
136  f_rab_range,
137  m_pcEmbodiedEntity->GetOriginAnchor(),
138  *m_pcEmbodiedEntity);
139  AddComponent(*m_pcRABEquippedEntity);
140  /* Perspective camera equipped entity */
142  SAnchor& cPerspCamAnchor = m_pcEmbodiedEntity->AddAnchor("perspective_camera",
143  CVector3(0.0, 0.0, 0.0),
144  cPerspCamOrient);
145  m_pcPerspectiveCameraEquippedEntity =
147  "perspective_camera_0",
148  c_perspcam_aperture,
149  f_perspcam_focal_length,
150  f_perspcam_range,
151  640, 480,
152  cPerspCamAnchor);
153  AddComponent(*m_pcPerspectiveCameraEquippedEntity);
154  /* Controllable entity
155  It must be the last one, for actuators/sensors to link to composing entities correctly */
156  m_pcControllableEntity = new CControllableEntity(this, "controller_0");
157  AddComponent(*m_pcControllableEntity);
158  m_pcControllableEntity->SetController(str_controller_id);
159  /* Update components */
161  }
162  catch(CARGoSException& ex) {
163  THROW_ARGOSEXCEPTION_NESTED("Failed to initialize entity \"" << GetId() << "\".", ex);
164  }
165  }
166 
167  /****************************************/
168  /****************************************/
169 
171  try {
172  /*
173  * Init parent
174  */
175  CComposableEntity::Init(t_tree);
176  /*
177  * Create and init components
178  */
179  /*
180  * Embodied entity
181  * Better to put this first, because many other entities need this one
182  */
183  m_pcEmbodiedEntity = new CEmbodiedEntity(this);
184  AddComponent(*m_pcEmbodiedEntity);
185  m_pcEmbodiedEntity->Init(GetNode(t_tree, "body"));
186  /* Quadrotor entity */
187  m_pcQuadRotorEntity = new CQuadRotorEntity(this, "quadrotor_0");
188  AddComponent(*m_pcQuadRotorEntity);
189  /* LED equipped entity, with LEDs [0-11] and beacon [12] */
190  m_pcLEDEquippedEntity = new CLEDEquippedEntity(this, "leds_0");
191  m_pcLEDEquippedEntity->AddLEDRing(
192  CVector3(0.0f, 0.0f, LED_LOWER_RING_ELEVATION),
193  LED_RING_RADIUS,
194  HALF_LED_ANGLE_SLICE,
195  16,
196  m_pcEmbodiedEntity->GetOriginAnchor());
197  m_pcLEDEquippedEntity->AddLEDRing(
198  CVector3(0.0f, 0.0f, LED_UPPER_RING_ELEVATION),
199  LED_RING_RADIUS,
200  HALF_LED_ANGLE_SLICE,
201  16,
202  m_pcEmbodiedEntity->GetOriginAnchor());
203  CVector3 cLEDPos(LED_RING_RADIUS * 0.7f,
204  0.0f,
205  LED_LOWER_RING_ELEVATION - 0.01f);
206  cLEDPos.RotateZ(3.0f * CRadians::PI_OVER_FOUR);
207  m_pcLEDEquippedEntity->AddLED(
208  cLEDPos,
209  m_pcEmbodiedEntity->GetOriginAnchor());
210  AddComponent(*m_pcLEDEquippedEntity);
211  /* Proximity sensor equipped entity */
212  m_pcProximitySensorEquippedEntity =
214  "proximity_0");
215  AddComponent(*m_pcProximitySensorEquippedEntity);
216  m_pcProximitySensorEquippedEntity->AddSensorRing(
217  CVector3(0.0f, 0.0f, PROXIMITY_SENSOR_RING_ELEVATION),
218  PROXIMITY_SENSOR_RING_RADIUS,
219  PROXIMITY_SENSOR_RING_START_ANGLE,
220  PROXIMITY_SENSOR_RING_RANGE,
221  24,
222  m_pcEmbodiedEntity->GetOriginAnchor());
223  /* Light sensor equipped entity */
224  m_pcLightSensorEquippedEntity =
226  "light_0");
227  AddComponent(*m_pcLightSensorEquippedEntity);
228  m_pcLightSensorEquippedEntity->AddSensorRing(
229  CVector3(0.0f, 0.0f, PROXIMITY_SENSOR_RING_ELEVATION),
230  PROXIMITY_SENSOR_RING_RADIUS,
231  PROXIMITY_SENSOR_RING_START_ANGLE,
232  PROXIMITY_SENSOR_RING_RANGE,
233  24,
234  m_pcEmbodiedEntity->GetOriginAnchor());
235  /* RAB equipped entity */
236  Real fRange = 3.0f;
237  GetNodeAttributeOrDefault(t_tree, "rab_range", fRange, fRange);
238  UInt32 unDataSize = 10;
239  GetNodeAttributeOrDefault(t_tree, "rab_data_size", unDataSize, unDataSize);
240  m_pcRABEquippedEntity = new CRABEquippedEntity(
241  this,
242  "rab_0",
243  unDataSize,
244  fRange,
245  m_pcEmbodiedEntity->GetOriginAnchor(),
246  *m_pcEmbodiedEntity);
247  AddComponent(*m_pcRABEquippedEntity);
248  /* Perspective camera equipped entity */
249  bool bPerspCamFront = true;
250  GetNodeAttributeOrDefault(t_tree, "camera_front", bPerspCamFront, bPerspCamFront);
251  Real fPerspCamFocalLength = 0.035;
252  GetNodeAttributeOrDefault(t_tree, "camera_focal_length", fPerspCamFocalLength, fPerspCamFocalLength);
253  Real fPerspCamRange = 2.0;
254  GetNodeAttributeOrDefault(t_tree, "camera_range", fPerspCamRange, fPerspCamRange);
255  CDegrees cAperture(30.0f);
256  GetNodeAttributeOrDefault(t_tree, "camera_aperture", cAperture, cAperture);
258  SAnchor& cPerspCamAnchor = m_pcEmbodiedEntity->AddAnchor("perspective_camera",
259  CVector3(0.0, 0.0, 0.0),
260  cPerspCamOrient);
261  m_pcPerspectiveCameraEquippedEntity =
263  "perspective_camera_0",
264  ToRadians(cAperture),
265  fPerspCamFocalLength,
266  fPerspCamRange,
267  640, 480,
268  cPerspCamAnchor);
269  AddComponent(*m_pcPerspectiveCameraEquippedEntity);
270  /* Controllable entity
271  It must be the last one, for actuators/sensors to link to composing entities correctly */
272  m_pcControllableEntity = new CControllableEntity(this);
273  AddComponent(*m_pcControllableEntity);
274  m_pcControllableEntity->Init(GetNode(t_tree, "controller"));
275  /* Update components */
277  }
278  catch(CARGoSException& ex) {
279  THROW_ARGOSEXCEPTION_NESTED("Failed to initialize entity \"" << GetId() << "\".", ex);
280  }
281  }
282 
283  /****************************************/
284  /****************************************/
285 
287  /* Reset all components */
289  /* Update components */
291  }
292 
293  /****************************************/
294  /****************************************/
295 
296 #define UPDATE(COMPONENT) if(COMPONENT->IsEnabled()) COMPONENT->Update();
297 
299  UPDATE(m_pcRABEquippedEntity);
300  UPDATE(m_pcLEDEquippedEntity);
301  }
302 
303  /****************************************/
304  /****************************************/
305 
307  "eye-bot",
308  "Carlo Pinciroli [ilpincy@gmail.com]",
309  "1.0",
310  "The eye-bot robot, developed in the Swarmanoid project.",
311  "The eye-bot is a quad-rotor developed in the Swarmanoid Project. It is a\n"
312  "fully autonomous robot with a rich set of sensors and actuators. For more\n"
313  "information, refer to the dedicated web page\n"
314  "(http://www.swarmanoid.org/swarmanoid_hardware.php).\n\n"
315  "REQUIRED XML CONFIGURATION\n\n"
316  " <arena ...>\n"
317  " ...\n"
318  " <eye-bot id=\"eb0\">\n"
319  " <body position=\"0.4,2.3,0.25\" orientation=\"45,0,0\" />\n"
320  " <controller config=\"mycntrl\" />\n"
321  " </eye-bot>\n"
322  " ...\n"
323  " </arena>\n\n"
324  "The 'id' attribute is necessary and must be unique among the entities. If two\n"
325  "entities share the same id, initialization aborts.\n"
326  "The 'body/position' attribute specifies the position of the bottom point of the\n"
327  "eye-bot in the arena. When the robot is untranslated and unrotated, the\n"
328  "bottom point is in the origin and it is defined as the middle point between\n"
329  "the two wheels on the XY plane and the lowest point of the robot on the Z\n"
330  "axis, that is the point where the wheels touch the floor. The attribute values\n"
331  "are in the X,Y,Z order.\n"
332  "The 'body/orientation' attribute specifies the orientation of the eye-bot. All\n"
333  "rotations are performed with respect to the bottom point. The order of the\n"
334  "angles is Z,Y,X, which means that the first number corresponds to the rotation\n"
335  "around the Z axis, the second around Y and the last around X. This reflects\n"
336  "the internal convention used in ARGoS, in which rotations are performed in\n"
337  "that order. Angles are expressed in degrees. When the robot is unrotated, it\n"
338  "is oriented along the X axis.\n"
339  "The 'controller/config' attribute is used to assign a controller to the\n"
340  "eye-bot. The value of the attribute must be set to the id of a previously\n"
341  "defined controller. Controllers are defined in the <controllers> XML subtree.\n\n"
342  "OPTIONAL XML CONFIGURATION\n\n"
343  "You can set the emission range of the range-and-bearing system. By default, a\n"
344  "message sent by an eye-bot can be received up to 3m. By using the 'rab_range'\n"
345  "attribute, you can change it to, i.e., 4m as follows:\n\n"
346  " <arena ...>\n"
347  " ...\n"
348  " <eye-bot id=\"eb0\" rab_range=\"4\">\n"
349  " <body position=\"0.4,2.3,0.25\" orientation=\"45,0,0\" />\n"
350  " <controller config=\"mycntrl\" />\n"
351  " </eye-bot>\n"
352  " ...\n"
353  " </arena>\n\n"
354  "You can also set the data sent at each time step through the range-and-bearing\n"
355  "system. By default, a message sent by a eye-bot is 10 bytes long. By using the\n"
356  "'rab_data_size' attribute, you can change it to, i.e., 20 bytes as follows:\n\n"
357  " <arena ...>\n"
358  " ...\n"
359  " <eye-bot id=\"eb0\" rab_data_size=\"20\">\n"
360  " <body position=\"0.4,2.3,0.25\" orientation=\"45,0,0\" />\n"
361  " <controller config=\"mycntrl\" />\n"
362  " </eye-bot>\n"
363  " ...\n"
364  " </arena>\n\n"
365  "Finally, you can change the parameters of the camera. You can set its aperture,\n"
366  "focal length, and range with the attributes 'camera_aperture',\n"
367  "'camera_focal_length', and 'camera_range', respectively. The default values are:\n"
368  "30 degrees for aperture, 0.035 for focal length, and 2 meters for range. Check\n"
369  "the following example:\n\n"
370  " <arena ...>\n"
371  " ...\n"
372  " <eye-bot id=\"eb0\"\n"
373  " camera_aperture=\"45\"\n"
374  " camera_focal_length=\"0.07\"\n"
375  " camera_range=\"10\">\n"
376  " <body position=\"0.4,2.3,0.25\" orientation=\"45,0,0\" />\n"
377  " <controller config=\"mycntrl\" />\n"
378  " </eye-bot>\n"
379  " ...\n"
380  " </arena>\n\n"
381  ,
382  "Usable"
383  );
384 
385  /****************************************/
386  /****************************************/
387 
389 
390  /****************************************/
391  /****************************************/
392 
393 }
ARGOS_PI
#define ARGOS_PI
To be used when initializing static variables.
Definition: angles.h:32
argos::CEmbodiedEntity::GetOriginAnchor
const SAnchor & GetOriginAnchor() const
Returns a const reference to the origin anchor associated to this entity.
Definition: embodied_entity.h:119
argos::CLEDEquippedEntity::AddLEDRing
void AddLEDRing(const CVector3 &c_center, Real f_radius, const CRadians &c_start_angle, UInt32 un_num_leds, SAnchor &s_anchor, const CColor &c_color=CColor::BLACK)
Adds a ring of LEDs to this entity.
Definition: led_equipped_entity.cpp:144
argos::CEntity::GetId
const std::string & GetId() const
Returns the id of this entity.
Definition: entity.h:157
argos
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
argos::CVector3
A 3D vector class.
Definition: vector3.h:29
argos::CPerspectiveCameraEquippedEntity
Definition: perspective_camera_equipped_entity.h:23
argos::CRadians
It defines the basic type CRadians, used to store an angle value in radians.
Definition: angles.h:42
argos::CComposableEntity
Basic class for an entity that contains other entities.
Definition: composable_entity.h:32
argos::GetNode
TConfigurationNode & GetNode(TConfigurationNode &t_node, const std::string &str_tag)
Given a tree root node, returns the first of its child nodes with the wanted name.
Definition: argos_configuration.h:63
argos::CLightSensorEquippedEntity
Definition: light_sensor_equipped_entity.h:21
argos::CARGoSException
The exception that wraps all errors in ARGoS.
Definition: argos_exception.h:61
argos::CRadians::PI_OVER_TWO
static const CRadians PI_OVER_TWO
Set to PI / 2.
Definition: angles.h:59
eyebot_entity.h
argos::CComposableEntity::Reset
virtual void Reset()
Resets the state of the entity to whatever it was after Init() or the standalone constructor was call...
Definition: composable_entity.cpp:29
argos::CVector3::RotateZ
CVector3 & RotateZ(const CRadians &c_angle)
Rotates this vector wrt the z axis.
Definition: vector3.h:265
argos::CEmbodiedEntity
This entity is a link to a body in the physics engine.
Definition: embodied_entity.h:48
argos::TConfigurationNode
ticpp::Element TConfigurationNode
The ARGoS configuration XML node.
Definition: argos_configuration.h:27
argos::CEyeBotEntity::Reset
virtual void Reset()
Resets the state of the entity to whatever it was after Init() or the standalone constructor was call...
Definition: eyebot_entity.cpp:286
argos::CRABEquippedEntity
Definition: rab_equipped_entity.h:25
argos::CComposableEntity::AddComponent
void AddComponent(CEntity &c_component)
Adds a component to this composable entity.
Definition: composable_entity.cpp:72
argos::CLEDEquippedEntity
A container of CLEDEntity.
Definition: led_equipped_entity.h:36
argos::CEyeBotEntity::CEyeBotEntity
CEyeBotEntity()
Definition: eyebot_entity.cpp:39
argos::CControllableEntity::Init
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
Definition: controllable_entity.cpp:44
argos::CVector3::Y
static const CVector3 Y
The y axis.
Definition: vector3.h:37
argos::CQuaternion
Definition: quaternion.h:14
THROW_ARGOSEXCEPTION_NESTED
#define THROW_ARGOSEXCEPTION_NESTED(message, nested)
This macro throws an ARGoS exception with the passed message and nesting the passed exception.
Definition: argos_exception.h:115
argos::REGISTER_STANDARD_SPACE_OPERATIONS_ON_COMPOSABLE
REGISTER_STANDARD_SPACE_OPERATIONS_ON_COMPOSABLE(CComposableEntity)
UPDATE
#define UPDATE(COMPONENT)
Definition: eyebot_entity.cpp:296
argos::CEyeBotEntity::UpdateComponents
virtual void UpdateComponents()
Calls the Update() method on all the components.
Definition: eyebot_entity.cpp:298
argos::CRadians::PI_OVER_FOUR
static const CRadians PI_OVER_FOUR
Set to PI / 4.
Definition: angles.h:69
argos::SAnchor
An anchor related to the body of an entity.
Definition: physics_model.h:38
argos::CProximitySensorEquippedEntity::AddSensorRing
void AddSensorRing(const CVector3 &c_center, Real f_radius, const CRadians &c_start_angle, Real f_range, UInt32 un_num_sensors, SAnchor &s_anchor)
Definition: proximity_sensor_equipped_entity.cpp:154
argos::CControllableEntity::SetController
void SetController(const std::string &str_controller_id)
Creates and assigns a controller with the given id.
Definition: controllable_entity.cpp:139
argos::CEyeBotEntity
Definition: eyebot_entity.h:26
argos::CEyeBotEntity::Init
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
Definition: eyebot_entity.cpp:170
argos::CProximitySensorEquippedEntity
Definition: proximity_sensor_equipped_entity.h:21
argos::REGISTER_ENTITY
REGISTER_ENTITY(CFloorEntity, "floor", "Carlo Pinciroli [ilpincy@gmail.com]", "1.0", "It contains the properties of the arena floor.", "The floor entity contains the properties of the arena floor. In the current\n" "implementation, it contains only the color of the floor. The floor color is\n" "detected by the robots' ground sensors.\n\n" "REQUIRED XML CONFIGURATION\n\n" " <arena ...>\n" " ...\n" " <floor id=\"floor\"\n" " source=\"SOURCE\" />\n" " ...\n" " </arena>\n\n" "The 'id' attribute is necessary and must be unique among the entities. If two\n" "entities share the same id, initialization aborts.\n" "The 'source' attribute specifies where to get the color of the floor from. Its\n" "value, here denoted as SOURCE, can assume the following values:\n\n" " image The color is calculated from the passed image file\n" " loop_functions The color is calculated calling the loop functions\n\n" "When 'source' is set to 'image', as showed in the following example, you have\n" "to specify the image path in the additional attribute 'path':\n\n" " <arena ...>\n" " ...\n" " <floor id=\"floor\"\n" " source=\"image\"\n" " path=\"/path/to/imagefile.ext\" />\n" " ...\n" " </arena>\n\n" "Many image formats are available, such as PNG, JPG, BMP, GIF and many more.\n" "Refer to the FreeImage webpage for a complete list of supported image formats\n" "(http://freeimage.sourceforge.net/features.html).\n\n" "When 'source' is set to 'loop_functions', as showed in the following example,\n" "an image is implicitly created to be used as texture for graphical\n" "visualizations. The algorithm that creates the texture needs to convert from\n" "meters (in the arena) to pixels (of the texture). You control how many pixels\n" "per meter are used with the attribute 'pixels_per_meter'. Clearly, the higher\n" "value, the higher the quality, but also the slower the algorithm and the bigger\n" "the texture. The algorithm is called only once at init time, so the fact that\n" "it is slow is not so important. However, the image size is limited by OpenGL.\n" "Every implementation has its own limit, and you should check yours if any\n" "texture-related problem arises. Now for the example:\n\n" " <arena ...>\n" " ...\n" " <floor id=\"floor\"\n" " source=\"loop_functions\"\n" " pixels_per_meter=\"100\" />\n" " ...\n" " </arena>\n\n" "OPTIONAL XML CONFIGURATION\n\n" "None for the time being.\n", "Usable")
argos::CLightSensorEquippedEntity::AddSensorRing
void AddSensorRing(const CVector3 &c_center, Real f_radius, const CRadians &c_start_angle, Real f_range, UInt32 un_num_sensors, SAnchor &s_anchor)
Definition: light_sensor_equipped_entity.cpp:154
UInt32
unsigned int UInt32
32-bit unsigned integer.
Definition: datatypes.h:97
argos::GetNodeAttributeOrDefault
void GetNodeAttributeOrDefault(TConfigurationNode &t_node, const std::string &str_attribute, T &t_buffer, const T &t_default)
Returns the value of a node's attribute, or the passed default value.
Definition: argos_configuration.h:318
argos::CEmbodiedEntity::Init
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
Definition: embodied_entity.cpp:68
argos::CQuadRotorEntity
Definition: quadrotor_entity.h:15
argos::CEmbodiedEntity::AddAnchor
SAnchor & AddAnchor(const std::string &str_id, const CVector3 &c_rel_position=CVector3(), const CQuaternion &c_rel_orientation=CQuaternion())
Adds an anchor to the embodied entity.
Definition: embodied_entity.cpp:121
argos::CDegrees
It defines the basic type CDegrees, used to store an angle value in degrees.
Definition: angles.h:288
argos::CControllableEntity
An entity that contains a pointer to the user-defined controller.
Definition: controllable_entity.h:26
argos::ToRadians
CRadians ToRadians(const CDegrees &c_degrees)
Converts CDegrees to CRadians.
Definition: angles.h:498
Real
float Real
Collects all ARGoS code.
Definition: datatypes.h:39
argos::CEntity::Init
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
Definition: entity.cpp:36
argos::CLEDEquippedEntity::AddLED
void AddLED(const CVector3 &c_offset, SAnchor &s_anchor, const CColor &c_color=CColor::BLACK)
Adds an LED to this entity.
Definition: led_equipped_entity.cpp:128