footbot_turret_entity.h
Go to the documentation of this file.
1 
7 #ifndef FOOTBOT_TURRET_ENTITY_H
8 #define FOOTBOT_TURRET_ENTITY_H
9 
10 namespace argos {
11  class CFootBotTurretEntity;
12  struct SAnchor;
13 }
14 
15 #include <argos3/core/simulator/entity/entity.h>
16 #include <argos3/core/utility/math/vector3.h>
17 
18 namespace argos {
19 
20  class CFootBotTurretEntity : public CEntity {
21 
22  public:
23 
25 
26  enum EMode {
31  };
32 
33  public:
34 
36 
38  const std::string& str_id,
39  SAnchor& s_anchor);
40 
41  virtual void Init(TConfigurationNode& t_tree);
42 
43  virtual void Reset();
44 
45  virtual void Update();
46 
47  inline UInt32 GetMode() const {
48  return m_unMode;
49  }
50 
51  inline void SetMode(UInt32 un_mode) {
52  m_unMode = un_mode;
53  }
54 
55  CRadians GetRotation() const;
56 
57  Real GetRotationSpeed() const;
58 
59  const CRadians& GetDesiredRotation() const;
60 
62 
63  void SetDesiredRotation(const CRadians& c_rotation);
64 
65  void SetDesiredRotationSpeed(Real f_speed);
66 
67  virtual std::string GetTypeDescription() const {
68  return "turret";
69  }
70 
71  private:
72 
73  /* Anchor associated to this turret */
74  SAnchor* m_psAnchor;
75  /* Operational mode (off, passive, rotation control, speed control */
76  UInt32 m_unMode;
77  /* Desired rotation set by the actuator */
78  CRadians m_cDesRot;
79  /* Desired rotation speed set by the actuator */
80  Real m_fDesRotSpeed;
81  /* Current rotation speed */
82  Real m_fCurRotSpeed;
83  /* Rotation at previous time step */
84  CRadians m_cOldRot;
85 
86  };
87 }
88 
89 #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
const CRadians & GetDesiredRotation() const
void SetDesiredRotationSpeed(Real f_speed)
CFootBotTurretEntity(CComposableEntity *pc_parent)
virtual std::string GetTypeDescription() const
Returns a string label for this class.
void SetDesiredRotation(const CRadians &c_rotation)
virtual void Update()
Updates the state of this entity.
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
virtual void Reset()
Resets the state of the entity to whatever it was after Init() or the standalone constructor was call...