proximity_sensor_equipped_entity.h
Go to the documentation of this file.
1 
7 #ifndef PROXIMITY_SENSOR_EQUIPPED_ENTITY_H
8 #define PROXIMITY_SENSOR_EQUIPPED_ENTITY_H
9 
10 namespace argos {
11  class CProximitySensorEquippedEntity;
12 }
13 
14 #include <argos3/core/utility/math/vector3.h>
15 #include <argos3/core/simulator/entity/entity.h>
16 #include <argos3/core/simulator/entity/embodied_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_offset,
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 "proximity_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_offset,
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  void AddSensorFan(const CVector3& c_center,
84  Real f_radius,
85  const CRadians& c_start_angle,
86  const CRadians& c_end_angle,
87  Real f_range,
88  UInt32 un_num_sensors,
89  SAnchor& s_anchor);
90 
91  protected:
92 
95 
96  };
97 
98 }
99 
100 #endif
A 3D vector class.
Definition: vector3.h:29
virtual std::string GetTypeDescription() const
Returns a string label for this class.
void AddSensorFan(const CVector3 &c_center, Real f_radius, const CRadians &c_start_angle, const CRadians &c_end_angle, Real f_range, UInt32 un_num_sensors, SAnchor &s_anchor)
float Real
Collects all ARGoS code.
Definition: datatypes.h:39
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
The basic entity type.
Definition: entity.h:89
ticpp::Element TConfigurationNode
The ARGoS configuration XML node.
It defines the basic type CRadians, used to store an angle value in radians.
Definition: angles.h:42
unsigned int UInt32
32-bit unsigned integer.
Definition: datatypes.h:97
SSensor(const CVector3 &c_offset, const CVector3 &c_direction, Real f_range, SAnchor &s_anchor)
Basic class for an entity that contains other entities.
An anchor related to the body of an entity.
Definition: physics_model.h:38
CProximitySensorEquippedEntity(CComposableEntity *pc_parent)
void AddSensorRing(const CVector3 &c_center, Real f_radius, const CRadians &c_start_angle, Real f_range, UInt32 un_num_sensors, SAnchor &s_anchor)
SSensor::TList m_tSensors
The list of sensors.
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
void AddSensor(const CVector3 &c_offset, const CVector3 &c_direction, Real f_range, SAnchor &s_anchor)