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 
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
unsigned int UInt32
32-bit unsigned integer.
Definition: datatypes.h:97
float Real
Collects all ARGoS code.
Definition: datatypes.h:39
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
ticpp::Element TConfigurationNode
The ARGoS configuration XML node.
Basic class for an entity that contains other entities.
The basic entity type.
Definition: entity.h:90
An anchor related to the body of an entity.
Definition: physics_model.h:38
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
void AddSensor(const CVector3 &c_position, const CVector3 &c_direction, Real f_range, SAnchor &s_anchor)
void AddSensorRing(const CVector3 &c_center, Real f_radius, const CRadians &c_start_angle, Real f_range, UInt32 un_num_sensors, SAnchor &s_anchor)
CLightSensorEquippedEntity(CComposableEntity *pc_parent)
SSensor::TList m_tSensors
The list of sensors.
virtual std::string GetTypeDescription() const
Returns a string label for this class.
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
SSensor(const CVector3 &c_position, const CVector3 &c_direction, Real f_range, SAnchor &s_anchor)