ARGoS 3
A parallel, multi-engine simulator for swarm robotics
directional_led_equipped_entity.h
Go to the documentation of this file.
1
6
7#ifndef DIRECTIONAL_LED_EQUIPPED_ENTITY_H
8#define DIRECTIONAL_LED_EQUIPPED_ENTITY_H
9
10namespace argos {
13}
14
15#include <argos3/core/simulator/entity/composable_entity.h>
16#include <argos3/plugins/simulator/entities/directional_led_entity.h>
17#include <vector>
18
19namespace argos {
20
31
32 public:
33
35
36 public:
37
38 struct SInstance {
44 SAnchor& s_anchor,
45 const CVector3& c_position_offset,
46 const CQuaternion& c_orientation_offset);
47 using TVector = std::vector<SInstance>;
48 };
49
50 public:
51
57
64 const std::string& str_id);
65
66
68
69 virtual void Init(TConfigurationNode& t_tree);
70
71 virtual void Enable();
72
73 virtual void Disable();
74
86 void AddLED(const std::string& str_id,
87 const CVector3& c_position,
88 const CQuaternion& c_orientation,
89 SAnchor& s_anchor,
90 const CRadians& c_observable_angle,
91 const CColor& c_color);
92
100
107 const CDirectionalLEDEntity& GetLED(UInt32 un_index) const;
108
115 return m_vecInstances;
116 }
117
123 inline const SInstance::TVector& GetInstances() const {
124 return m_vecInstances;
125 }
126
132 void SetLEDColor(UInt32 un_index, const CColor& c_color);
133
139 void SetLEDColors(const CColor& c_color);
140
148 void SetLEDColors(const std::vector<CColor>& vec_colors);
149
155 void SetMedium(CDirectionalLEDMedium& c_medium);
156
157 virtual std::string GetTypeDescription() const {
158 return "directional_leds";
159 }
160
161 protected:
162
163 virtual void UpdateComponents();
164
165 protected:
166
169 };
170
171}
172
173#endif
unsigned int UInt32
32-bit unsigned integer.
Definition datatypes.h:97
The namespace containing all the ARGoS related code.
Definition ci_actuator.h:12
ticpp::Element TConfigurationNode
The ARGoS configuration XML node.
CComposableEntity(CComposableEntity *pc_parent)
Class constructor.
An anchor related to the body of an entity.
The basic color type.
Definition color.h:25
It defines the basic type CRadians, used to store an angle value in radians.
Definition angles.h:42
A 3D vector class.
Definition vector3.h:31
A container of CDirectionalLEDEntity.
virtual void UpdateComponents()
Calls the Update() method on all the components.
virtual std::string GetTypeDescription() const
Returns a string label for this class.
void AddLED(const std::string &str_id, const CVector3 &c_position, const CQuaternion &c_orientation, SAnchor &s_anchor, const CRadians &c_observable_angle, const CColor &c_color)
Programmatically creates a new directional LED.
void SetLEDColor(UInt32 un_index, const CColor &c_color)
Sets the color of an LED.
void SetLEDColors(const CColor &c_color)
Sets the color of all the LEDs to the same value.
CDirectionalLEDEquippedEntity(CComposableEntity *pc_parent)
Class constructor.
const SInstance::TVector & GetInstances() const
Returns the LEDs as a const reference.
SInstance::TVector m_vecInstances
List of the LEDs managed by this entity.
void SetMedium(CDirectionalLEDMedium &c_medium)
Sets the medium associated to this entity.
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
CDirectionalLEDEntity & GetLED(UInt32 un_index)
Returns an LED by numeric index.
SInstance::TVector & GetInstances()
Returns all the LEDs.
SInstance(CDirectionalLEDEntity &c_led, SAnchor &s_anchor, const CVector3 &c_position_offset, const CQuaternion &c_orientation_offset)