ARGoS  3
A parallel, multi-engine simulator for swarm robotics
footbot_turret_default_actuator.cpp
Go to the documentation of this file.
1 
8 
9 namespace argos {
10 
12 
13  /****************************************/
14  /****************************************/
15 
17  m_pcTurretEntity(NULL),
18  m_unDesiredMode(CFootBotTurretEntity::MODE_OFF) {}
19 
20  /****************************************/
21  /****************************************/
22 
24  m_pcTurretEntity = &(c_entity.GetComponent<CFootBotTurretEntity>("turret"));
25  m_pcTurretEntity->Enable();
26  }
27 
28  /****************************************/
29  /****************************************/
30 
32  m_pcTurretEntity->SetDesiredRotation(c_angle);
33  }
34 
35  /****************************************/
36  /****************************************/
37 
39  m_pcTurretEntity->SetDesiredRotationSpeed(RPM_TO_RADIANS_PER_SEC * n_speed_pulses);
40  }
41 
42  /****************************************/
43  /****************************************/
44 
46  m_unDesiredMode = e_mode;
47  }
48 
49  /****************************************/
50  /****************************************/
51 
53  m_pcTurretEntity->SetMode(m_unDesiredMode);
54  }
55 
56  /****************************************/
57  /****************************************/
58 
60  m_unDesiredMode = CFootBotTurretEntity::MODE_OFF;
61  }
62 
63  /****************************************/
64  /****************************************/
65 
67  "footbot_turret", "default",
68  "Carlo Pinciroli [ilpincy@gmail.com]",
69  "1.0",
70  "The foot-bot turret actuator.",
71  "This actuator controls the foot-bot turret. For a complete\n"
72  "description of its usage, refer to the ci_footbot_turret_actuator\n"
73  "file.\n\n"
74  "REQUIRED XML CONFIGURATION\n\n"
75  " <controllers>\n"
76  " ...\n"
77  " <my_controller ...>\n"
78  " ...\n"
79  " <actuators>\n"
80  " ...\n"
81  " <footbot_turret implementation=\"default\" />\n"
82  " ...\n"
83  " </actuators>\n"
84  " ...\n"
85  " </my_controller>\n"
86  " ...\n"
87  " </controllers>\n\n"
88  "OPTIONAL XML CONFIGURATION\n\n"
89  "None for the time being.\n",
90  "Usable"
91  );
92 
93 }
ARGOS_PI
#define ARGOS_PI
To be used when initializing static variables.
Definition: angles.h:32
argos::CFootBotTurretEntity::SetMode
void SetMode(UInt32 un_mode)
Definition: footbot_turret_entity.h:51
argos::CCI_FootBotTurretActuator::ETurretModes
ETurretModes
Turret modes.
Definition: ci_footbot_turret_actuator.h:60
argos::CFootBotTurretDefaultActuator::Update
virtual void Update()
Updates the state of the entity associated to this actuator.
Definition: footbot_turret_default_actuator.cpp:52
footbot_turret_default_actuator.h
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::CComposableEntity::GetComponent
CEntity & GetComponent(const std::string &str_component)
Returns the component with the passed string label.
Definition: composable_entity.cpp:109
argos::MODE_OFF
@ MODE_OFF
Definition: dynamics2d_footbot_model.cpp:34
argos::RPM_TO_RADIANS_PER_SEC
const Real RPM_TO_RADIANS_PER_SEC
Definition: footbot_turret_default_actuator.cpp:11
argos::CFootBotTurretEntity::SetDesiredRotationSpeed
void SetDesiredRotationSpeed(Real f_speed)
Definition: footbot_turret_entity.cpp:111
argos::CEntity::Enable
void Enable()
Enables the entity.
Definition: entity.h:239
argos::CFootBotTurretDefaultActuator
Definition: footbot_turret_default_actuator.h:24
argos::CFootBotTurretDefaultActuator::SetRobot
virtual void SetRobot(CComposableEntity &c_entity)
Sets the entity associated to this actuator.
Definition: footbot_turret_default_actuator.cpp:23
argos::CFootBotTurretDefaultActuator::CFootBotTurretDefaultActuator
CFootBotTurretDefaultActuator()
Definition: footbot_turret_default_actuator.cpp:16
argos::CFootBotTurretDefaultActuator::SetMode
virtual void SetMode(ETurretModes e_mode)
Sets the turret control mode Modes are: angular position control, rotation speed control,...
Definition: footbot_turret_default_actuator.cpp:45
argos::REGISTER_ACTUATOR
REGISTER_ACTUATOR(CFootBotDistanceScannerDefaultActuator, "footbot_distance_scanner", "default", "Carlo Pinciroli [ilpincy@gmail.com]", "1.0", "The foot-bot distance scanner actuator.", "This actuator controls the foot-bot distance scanner. For a complete\n" "description of its usage, refer to the ci_footbot_distance_scanner_actuator\n" "file.\n\n" "REQUIRED XML CONFIGURATION\n\n" " <controllers>\n" " ...\n" " <my_controller ...>\n" " ...\n" " <actuators>\n" " ...\n" " <footbot_distance_scanner implementation=\"default\" />\n" " ...\n" " </actuators>\n" " ...\n" " </my_controller>\n" " ...\n" " </controllers>\n\n" "OPTIONAL XML CONFIGURATION\n\n" "None for the time being.\n", "Usable")
argos::CFootBotTurretDefaultActuator::SetRotation
virtual void SetRotation(const CRadians &c_angle)
Sets the turret rotation Turret rotation is expressed in radians, positive values rotate the turret c...
Definition: footbot_turret_default_actuator.cpp:31
argos::CFootBotTurretDefaultActuator::Reset
virtual void Reset()
Resets the actuator to the state it had just after Init().
Definition: footbot_turret_default_actuator.cpp:59
argos::CFootBotTurretDefaultActuator::SetRotationSpeed
virtual void SetRotationSpeed(SInt32 n_speed_pulses)
Sets the turret rotation speed Turret rotation speed is expressed in motor pulses,...
Definition: footbot_turret_default_actuator.cpp:38
SInt32
signed int SInt32
32-bit signed integer.
Definition: datatypes.h:93
argos::CFootBotTurretEntity
Definition: footbot_turret_entity.h:20
Real
float Real
Collects all ARGoS code.
Definition: datatypes.h:39