ARGoS 3
A parallel, multi-engine simulator for swarm robotics
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
10namespace 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
19namespace argos {
20
22
23 public:
24
26
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
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.
It defines the basic type CRadians, used to store an angle value in radians.
Definition angles.h:42
A 2D vector class.
Definition vector2.h:27
void AddSensor(const CVector2 &c_offset, ESensorType e_type, SAnchor &s_anchor)
virtual std::string GetTypeDescription() const
Returns a string label for this class.
CGroundSensorEquippedEntity(CComposableEntity *pc_parent)
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
ESensorType ParseType(const std::string &str_type) const
SSensor::TList m_tSensors
The list of sensors.
void AddSensorRing(const CVector2 &c_center, Real f_radius, const CRadians &c_start_angle, ESensorType e_type, UInt32 un_num_sensors, SAnchor &s_anchor)
SSensor(const CVector2 &c_position, ESensorType e_type, SAnchor &s_anchor)