Warning: include(php/utility.php): Failed to open stream: No such file or directory in /home/argos/argos3/doc/api/embedded/a00753_source.php on line 2

Warning: include(): Failed opening 'php/utility.php' for inclusion (include_path='.:/usr/lib64/php') in /home/argos/argos3/doc/api/embedded/a00753_source.php on line 2
The ARGoS Website

ground_sensor_equipped_entity.h
Go to the documentation of this file.
1 
7 #ifndef GROUND_SENSOR_EQUIPPED_ENTITY_H
8 #define GROUND_SENSOR_EQUIPPED_ENTITY_H
9 
10 namespace argos {
11  class CGroundSensorEquippedEntity;
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  enum ESensorType {
30  };
31 
32  struct SSensor {
33  typedef std::vector<SSensor*> TList;
34 
38 
39  SSensor(const CVector2& c_position,
40  ESensorType e_type,
41  SAnchor& s_anchor) :
42  Offset(c_position),
43  Type(e_type),
44  Anchor(s_anchor) {}
45  };
46 
47  public:
48 
50 
52  const std::string& str_id);
53 
55 
56  virtual void Init(TConfigurationNode& t_tree);
57 
58  virtual std::string GetTypeDescription() const {
59  return "ground_sensors";
60  }
61 
62  virtual void Enable();
63 
64  virtual void Disable();
65 
66  inline size_t GetNumSensors() const {
67  return m_tSensors.size();
68  }
69 
70  inline SSensor& GetSensor(size_t un_idx) {
71  return *m_tSensors[un_idx];
72  }
73 
75  return m_tSensors;
76  }
77 
78  void AddSensor(const CVector2& c_offset,
79  ESensorType e_type,
80  SAnchor& s_anchor);
81 
82  void AddSensorRing(const CVector2& c_center,
83  Real f_radius,
84  const CRadians& c_start_angle,
85  ESensorType e_type,
86  UInt32 un_num_sensors,
87  SAnchor& s_anchor);
88 
89  protected:
90 
91  ESensorType ParseType(const std::string& str_type) const;
92 
93  protected:
94 
97 
98  };
99 
100 }
101 
102 #endif
ESensorType ParseType(const std::string &str_type) const
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
float Real
Collects all ARGoS code.
Definition: datatypes.h:39
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
CGroundSensorEquippedEntity(CComposableEntity *pc_parent)
unsigned int UInt32
32-bit unsigned integer.
Definition: datatypes.h:97
Basic class for an entity that contains other entities.
A 2D vector class.
Definition: vector2.h:25
An anchor related to the body of an entity.
Definition: physics_model.h:38
SSensor::TList m_tSensors
The list of sensors.
virtual std::string GetTypeDescription() const
Returns a string label for this class.
void AddSensor(const CVector2 &c_offset, ESensorType e_type, SAnchor &s_anchor)
SSensor(const CVector2 &c_position, ESensorType e_type, SAnchor &s_anchor)
void AddSensorRing(const CVector2 &c_center, Real f_radius, const CRadians &c_start_angle, ESensorType e_type, UInt32 un_num_sensors, SAnchor &s_anchor)
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12