ARGoS  3
A parallel, multi-engine simulator for swarm robotics
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 
24  ENABLE_VTABLE();
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
argos::CFootBotTurretEntity::SetMode
void SetMode(UInt32 un_mode)
Definition: footbot_turret_entity.h:51
argos
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
argos::CFootBotTurretEntity::MODE_OFF
@ MODE_OFF
Definition: footbot_turret_entity.h:27
argos::CFootBotTurretEntity::SetDesiredRotation
void SetDesiredRotation(const CRadians &c_rotation)
Definition: footbot_turret_entity.cpp:103
argos::CRadians
It defines the basic type CRadians, used to store an angle value in radians.
Definition: angles.h:42
argos::CComposableEntity
Basic class for an entity that contains other entities.
Definition: composable_entity.h:32
argos::CFootBotTurretEntity::MODE_SPEED_CONTROL
@ MODE_SPEED_CONTROL
Definition: footbot_turret_entity.h:29
argos::CFootBotTurretEntity::GetRotationSpeed
Real GetRotationSpeed() const
Definition: footbot_turret_entity.cpp:82
argos::CFootBotTurretEntity::GetRotation
CRadians GetRotation() const
Definition: footbot_turret_entity.cpp:73
argos::CFootBotTurretEntity::SetDesiredRotationSpeed
void SetDesiredRotationSpeed(Real f_speed)
Definition: footbot_turret_entity.cpp:111
argos::CFootBotTurretEntity::GetDesiredRotationSpeed
Real GetDesiredRotationSpeed() const
Definition: footbot_turret_entity.cpp:96
argos::CFootBotTurretEntity::MODE_POSITION_CONTROL
@ MODE_POSITION_CONTROL
Definition: footbot_turret_entity.h:30
argos::TConfigurationNode
ticpp::Element TConfigurationNode
The ARGoS configuration XML node.
Definition: argos_configuration.h:27
argos::CFootBotTurretEntity::GetMode
UInt32 GetMode() const
Definition: footbot_turret_entity.h:47
argos::CFootBotTurretEntity::GetDesiredRotation
const CRadians & GetDesiredRotation() const
Definition: footbot_turret_entity.cpp:89
argos::SAnchor
An anchor related to the body of an entity.
Definition: physics_model.h:38
argos::CFootBotTurretEntity::GetTypeDescription
virtual std::string GetTypeDescription() const
Returns a string label for this class.
Definition: footbot_turret_entity.h:67
argos::CEntity
The basic entity type.
Definition: entity.h:89
argos::CFootBotTurretEntity
Definition: footbot_turret_entity.h:20
argos::CFootBotTurretEntity::Update
virtual void Update()
Updates the state of this entity.
Definition: footbot_turret_entity.cpp:59
UInt32
unsigned int UInt32
32-bit unsigned integer.
Definition: datatypes.h:97
argos::CFootBotTurretEntity::Reset
virtual void Reset()
Resets the state of the entity to whatever it was after Init() or the standalone constructor was call...
Definition: footbot_turret_entity.cpp:45
argos::CFootBotTurretEntity::MODE_PASSIVE
@ MODE_PASSIVE
Definition: footbot_turret_entity.h:28
argos::CFootBotTurretEntity::CFootBotTurretEntity
CFootBotTurretEntity(CComposableEntity *pc_parent)
Definition: footbot_turret_entity.cpp:17
argos::CFootBotTurretEntity::EMode
EMode
Definition: footbot_turret_entity.h:26
Real
float Real
Collects all ARGoS code.
Definition: datatypes.h:39
argos::CFootBotTurretEntity::ENABLE_VTABLE
ENABLE_VTABLE()
argos::CFootBotTurretEntity::Init
virtual void Init(TConfigurationNode &t_tree)
Initializes the state of the entity from the XML configuration tree.
Definition: footbot_turret_entity.cpp:39