ARGoS  3
A parallel, multi-engine simulator for swarm robotics
cylinder_entity.h
Go to the documentation of this file.
1 
8 #ifndef CYLINDER_ENTITY_H
9 #define CYLINDER_ENTITY_H
10 
11 namespace argos {
12  class CCylinderEntity;
13  class CEmbodiedEntity;
14  class CLEDEquippedEntity;
15 }
16 
17 #include <argos3/core/simulator/entity/embodied_entity.h>
18 #include <argos3/core/simulator/entity/composable_entity.h>
19 #include <argos3/plugins/simulator/entities/led_equipped_entity.h>
20 
21 namespace argos {
22 
24 
25  public:
26 
27  ENABLE_VTABLE();
28 
30 
31  CCylinderEntity(const std::string& str_id,
32  const CVector3& c_position,
33  const CQuaternion& c_orientation,
34  bool b_movable,
35  Real f_radius,
36  Real f_height,
37  Real f_mass = 1.0f);
38 
39  virtual void Init(TConfigurationNode& t_tree);
40  virtual void Reset();
41 
42  /*
43  * Enables the LEDs for this entity.
44  * Adds the LED equipped entity to the given medium.
45  * If you don't call this method, the LEDs added with
46  * CCylinderEntity::AddLED() won't be update correctly.
47  * @param c_medium The medium to which the LEDs must be associated.
48  * @see CCylinderEntity::AddLED()
49  */
50  void EnableLEDs(CLEDMedium& c_medium);
51 
52  /*
53  * Disables the LEDs for this entity.
54  */
55  void DisableLEDs();
56 
65  void AddLED(const CVector3& c_offset,
66  const CColor& c_color = CColor::BLACK);
67 
69  return *m_pcEmbodiedEntity;
70  }
71 
73  return *m_pcLEDEquippedEntity;
74  }
75 
76  inline Real GetRadius() const {
77  return m_fRadius;
78  }
79 
80  inline void SetRadius(Real c_radius) {
81  m_fRadius = c_radius;
82  }
83 
84  inline Real GetHeight() const {
85  return m_fHeight;
86  }
87 
88  inline void SetHeight(Real c_height) {
89  m_fHeight = c_height;
90  }
91 
92  inline Real GetMass() const {
93  return m_fMass;
94  }
95 
96  inline void SetMass(Real f_mass) {
97  m_fMass = f_mass;
98  }
99 
100  virtual std::string GetTypeDescription() const {
101  return "cylinder";
102  }
103 
104  private:
105 
106  CEmbodiedEntity* m_pcEmbodiedEntity;
107  CLEDEquippedEntity* m_pcLEDEquippedEntity;
108  Real m_fRadius;
109  Real m_fHeight;
110  Real m_fMass;
111  CLEDMedium* m_pcLEDMedium;
112 
113  };
114 
115 }
116 
117 #endif
argos::CCylinderEntity::GetEmbodiedEntity
CEmbodiedEntity & GetEmbodiedEntity()
Definition: cylinder_entity.h:68
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::CComposableEntity
Basic class for an entity that contains other entities.
Definition: composable_entity.h:32
argos::CCylinderEntity::GetHeight
Real GetHeight() const
Definition: cylinder_entity.h:84
argos::CEmbodiedEntity
This entity is a link to a body in the physics engine.
Definition: embodied_entity.h:48
argos::TConfigurationNode
ticpp::Element TConfigurationNode
The ARGoS configuration XML node.
Definition: argos_configuration.h:27
argos::CCylinderEntity::Reset
virtual void Reset()
Resets the state of the entity to whatever it was after Init() or the standalone constructor was call...
Definition: cylinder_entity.cpp:102
argos::CLEDMedium
Definition: led_medium.h:15
argos::CLEDEquippedEntity
A container of CLEDEntity.
Definition: led_equipped_entity.h:36
argos::CCylinderEntity::EnableLEDs
void EnableLEDs(CLEDMedium &c_medium)
Definition: cylinder_entity.cpp:113
argos::CCylinderEntity::SetMass
void SetMass(Real f_mass)
Definition: cylinder_entity.h:96
argos::CQuaternion
Definition: quaternion.h:14
argos::CCylinderEntity::CCylinderEntity
CCylinderEntity()
Definition: cylinder_entity.cpp:18
argos::CCylinderEntity::GetRadius
Real GetRadius() const
Definition: cylinder_entity.h:76
argos::CCylinderEntity::SetRadius
void SetRadius(Real c_radius)
Definition: cylinder_entity.h:80
argos::CCylinderEntity::Init
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
Definition: cylinder_entity.cpp:55
argos::CCylinderEntity::SetHeight
void SetHeight(Real c_height)
Definition: cylinder_entity.h:88
argos::CCylinderEntity
Definition: cylinder_entity.h:23
argos::CCylinderEntity::DisableLEDs
void DisableLEDs()
Definition: cylinder_entity.cpp:120
argos::CCylinderEntity::GetMass
Real GetMass() const
Definition: cylinder_entity.h:92
argos::CColor
The basic color type.
Definition: color.h:25
argos::CColor::BLACK
static CColor BLACK
Definition: color.h:29
argos::CCylinderEntity::AddLED
void AddLED(const CVector3 &c_offset, const CColor &c_color=CColor::BLACK)
Adds an LED to this entity.
Definition: cylinder_entity.cpp:127
Real
float Real
Collects all ARGoS code.
Definition: datatypes.h:39
argos::CCylinderEntity::GetLEDEquippedEntity
CLEDEquippedEntity & GetLEDEquippedEntity()
Definition: cylinder_entity.h:72
argos::CCylinderEntity::GetTypeDescription
virtual std::string GetTypeDescription() const
Returns a string label for this class.
Definition: cylinder_entity.h:100
argos::CCylinderEntity::ENABLE_VTABLE
ENABLE_VTABLE()