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 }
virtual void SetMode(ETurretModes e_mode)
Sets the turret control mode Modes are: angular position control, rotation speed control, passive mode, off.
signed int SInt32
32-bit signed integer.
Definition: datatypes.h:93
virtual void SetRotation(const CRadians &c_angle)
Sets the turret rotation Turret rotation is expressed in radians, positive values rotate the turret c...
virtual void SetRotationSpeed(SInt32 n_speed_pulses)
Sets the turret rotation speed Turret rotation speed is expressed in motor pulses, positive values rotate the turret clockwise when looking from above.
void Enable()
Enables the entity.
Definition: entity.h:265
virtual void Reset()
Resets the actuator to the state it had just after Init().
float Real
Collects all ARGoS code.
Definition: datatypes.h:39
const Real RPM_TO_RADIANS_PER_SEC
virtual void SetRobot(CComposableEntity &c_entity)
Sets the entity associated to this 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")
It defines the basic type CRadians, used to store an angle value in radians.
Definition: angles.h:42
void SetDesiredRotation(const CRadians &c_rotation)
Basic class for an entity that contains other entities.
virtual void Update()
Updates the state of the entity associated to this actuator.
#define ARGOS_PI
To be used when initializing static variables.
Definition: angles.h:32
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
void SetDesiredRotationSpeed(Real f_speed)
CEntity & GetComponent(const std::string &str_component)
Returns the component with the passed string label.