8 #include <argos3/core/simulator/simulator.h>
9 #include <argos3/core/simulator/space/space.h>
10 #include <argos3/plugins/simulator/media/led_medium.h>
32 m_fIntensity(f_intensity) {}
43 std::string strMedium;
58 "Carlo Pinciroli [ilpincy@gmail.com]",
61 "The light entity is an entity that emits a light detectable by a robot camera\n"
62 "(as a normal LED) or by light sensors. A light is bodyless, therefore it must\n"
63 "not be added to physics engines.\n"
64 "A light is characterized by a color and an intensity. The color of the light\n"
65 "is perceived by cameras. The intensity modifies the reading of the light\n"
66 "sensors. The higher the intensity, the closer the light is perceived.\n\n"
67 "REQUIRED XML CONFIGURATION\n\n"
70 " <light id=\"light0\"\n"
71 " position=\"0.4,2.3,0.25\"\n"
72 " orientation=\"0,0,0\"\n"
74 " intensity=\"1.0\"\n"
75 " medium=\"leds\"/>\n"
78 "The 'id' attribute is necessary and must be unique among the entities. If two\n"
79 "entities share the same id, initialization aborts.\n"
80 "The 'position' attribute specifies the position of the center of the light.\n"
81 "The attribute values are in the X,Y,Z order.\n"
82 "The 'orientation' attribute specifies the orientation of the light. At the\n"
83 "moment this attribute is mandatory but its value is ignored. In the future,\n"
84 "it will be used to implement a directional light.\n"
85 "The 'color' attribute specifies the color of the light.\n"
86 "The 'intensity' attribute sets the intensity of the light. When the value is\n"
87 "1.0, the light emits a normal amount of light. When it is 0.5 the amount of\n"
88 "light is half, and when the value is 2.0 the emission is doubled. The\n"
89 "intensity of the light affects the readings of the light sensors but not\n"
90 "those of the cameras.\n"
91 "The 'medium' attribute is used to add the light the corresponding LED medium.\n\n"
92 "OPTIONAL XML CONFIGURATION\n\n"
#define THROW_ARGOSEXCEPTION_NESTED(message, nested)
This macro throws an ARGoS exception with the passed message and nesting the passed exception.
float Real
Collects all ARGoS code.
The namespace containing all the ARGoS related code.
ticpp::Element TConfigurationNode
The ARGoS configuration XML node.
REGISTER_STANDARD_SPACE_OPERATIONS_ON_ENTITY(CEntity)
void GetNodeAttribute(TConfigurationNode &t_node, const std::string &str_attribute, T &t_buffer)
Returns the value of a node's attribute.
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")
T & GetMedium(const std::string &str_id)
Returns a reference to a medium.
static CSimulator & GetInstance()
Returns the instance to the CSimulator class.
The exception that wraps all errors in ARGoS.
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
void AddEntity(CLEDEntity &c_entity)
Adds the specified entity to the list of managed entities.