ARGoS  3
A parallel, multi-engine simulator for swarm robotics
light_sensor_equipped_entity.h
Go to the documentation of this file.
1 
7 #ifndef LIGHT_SENSOR_EQUIPPED_ENTITY_H
8 #define LIGHT_SENSOR_EQUIPPED_ENTITY_H
9 
10 namespace argos {
11  class CLightSensorEquippedEntity;
12  struct SAnchor;
13 }
14 
15 #include <argos3/core/utility/math/vector3.h>
16 #include <argos3/core/simulator/entity/entity.h>
17 #include <map>
18 
19 namespace argos {
20 
22 
23  public:
24 
25  ENABLE_VTABLE();
26 
27  struct SSensor {
28  typedef std::vector<SSensor*> TList;
29 
33 
34  SSensor(const CVector3& c_position,
35  const CVector3& c_direction,
36  Real f_range,
37  SAnchor& s_anchor);
38  };
39 
40  public:
41 
43 
45  const std::string& str_id);
46 
48 
49  virtual void Init(TConfigurationNode& t_tree);
50 
51  virtual std::string GetTypeDescription() const {
52  return "light_sensors";
53  }
54 
55  virtual void Enable();
56 
57  virtual void Disable();
58 
59  inline size_t GetNumSensors() const {
60  return m_tSensors.size();
61  }
62 
63  inline SSensor& GetSensor(size_t un_idx) {
64  return *m_tSensors[un_idx];
65  }
66 
68  return m_tSensors;
69  }
70 
71  void AddSensor(const CVector3& c_position,
72  const CVector3& c_direction,
73  Real f_range,
74  SAnchor& s_anchor);
75 
76  void AddSensorRing(const CVector3& c_center,
77  Real f_radius,
78  const CRadians& c_start_angle,
79  Real f_range,
80  UInt32 un_num_sensors,
81  SAnchor& s_anchor);
82 
83  protected:
84 
87 
88  };
89 
90 }
91 
92 #endif
argos::CLightSensorEquippedEntity::Disable
virtual void Disable()
Definition: light_sensor_equipped_entity.cpp:134
argos::CLightSensorEquippedEntity::CLightSensorEquippedEntity
CLightSensorEquippedEntity(CComposableEntity *pc_parent)
Definition: light_sensor_equipped_entity.cpp:30
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::CLightSensorEquippedEntity::Init
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
Definition: light_sensor_equipped_entity.cpp:57
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::CLightSensorEquippedEntity
Definition: light_sensor_equipped_entity.h:21
argos::CLightSensorEquippedEntity::m_tSensors
SSensor::TList m_tSensors
The list of sensors.
Definition: light_sensor_equipped_entity.h:86
argos::CLightSensorEquippedEntity::GetNumSensors
size_t GetNumSensors() const
Definition: light_sensor_equipped_entity.h:59
argos::CLightSensorEquippedEntity::GetSensors
SSensor::TList & GetSensors()
Definition: light_sensor_equipped_entity.h:67
argos::TConfigurationNode
ticpp::Element TConfigurationNode
The ARGoS configuration XML node.
Definition: argos_configuration.h:27
argos::CLightSensorEquippedEntity::SSensor::SSensor
SSensor(const CVector3 &c_position, const CVector3 &c_direction, Real f_range, SAnchor &s_anchor)
Definition: light_sensor_equipped_entity.cpp:16
argos::CLightSensorEquippedEntity::SSensor::Direction
CVector3 Direction
Definition: light_sensor_equipped_entity.h:31
argos::SAnchor
An anchor related to the body of an entity.
Definition: physics_model.h:38
argos::CLightSensorEquippedEntity::SSensor::Anchor
SAnchor & Anchor
Definition: light_sensor_equipped_entity.h:32
argos::CLightSensorEquippedEntity::ENABLE_VTABLE
ENABLE_VTABLE()
argos::CLightSensorEquippedEntity::AddSensor
void AddSensor(const CVector3 &c_position, const CVector3 &c_direction, Real f_range, SAnchor &s_anchor)
Definition: light_sensor_equipped_entity.cpp:144
argos::CEntity
The basic entity type.
Definition: entity.h:89
argos::CLightSensorEquippedEntity::GetTypeDescription
virtual std::string GetTypeDescription() const
Returns a string label for this class.
Definition: light_sensor_equipped_entity.h:51
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::CLightSensorEquippedEntity::Enable
virtual void Enable()
Definition: light_sensor_equipped_entity.cpp:124
argos::CLightSensorEquippedEntity::SSensor::TList
std::vector< SSensor * > TList
Definition: light_sensor_equipped_entity.h:28
argos::CLightSensorEquippedEntity::GetSensor
SSensor & GetSensor(size_t un_idx)
Definition: light_sensor_equipped_entity.h:63
argos::CLightSensorEquippedEntity::SSensor
Definition: light_sensor_equipped_entity.h:27
argos::CLightSensorEquippedEntity::~CLightSensorEquippedEntity
virtual ~CLightSensorEquippedEntity()
Definition: light_sensor_equipped_entity.cpp:47
argos::CLightSensorEquippedEntity::SSensor::Position
CVector3 Position
Definition: light_sensor_equipped_entity.h:30
Real
float Real
Collects all ARGoS code.
Definition: datatypes.h:39