ARGoS 3
A parallel, multi-engine simulator for swarm robotics
footbot_turret_default_actuator.cpp
Go to the documentation of this file.
1
8
9namespace argos {
10
12
13 /****************************************/
14 /****************************************/
15
17 m_pcTurretEntity(nullptr),
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
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}
#define ARGOS_PI
To be used when initializing static variables.
Definition angles.h:32
signed int SInt32
32-bit signed integer.
Definition datatypes.h:93
float Real
Collects all ARGoS code.
Definition datatypes.h:39
#define REGISTER_ACTUATOR(CLASSNAME, LABEL, IMPLEMENTATION, AUTHOR, VERSION, BRIEF_DESCRIPTION, LONG_DESCRIPTION, STATUS)
Registers a new actuator model inside ARGoS.
Definition actuator.h:59
The namespace containing all the ARGoS related code.
Definition ci_actuator.h:12
Basic class for an entity that contains other entities.
CEntity & GetComponent(const std::string &str_component)
Returns the component with the passed string label.
void Enable()
Enables the entity.
Definition entity.h:265
It defines the basic type CRadians, used to store an angle value in radians.
Definition angles.h:42
virtual void Update()
Updates the state of the entity associated to this actuator.
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 Reset()
Resets the actuator to the state it had just after Init().
virtual void SetRobot(CComposableEntity &c_entity)
Sets the entity associated to this actuator.
virtual void SetRotationSpeed(SInt32 n_speed_pulses)
Sets the turret rotation speed Turret rotation speed is expressed in motor pulses,...
virtual void SetMode(ETurretModes e_mode)
Sets the turret control mode Modes are: angular position control, rotation speed control,...
void SetDesiredRotation(const CRadians &c_rotation)