real_robot.h
Go to the documentation of this file.
1 #ifndef REAL_ROBOT_H
2 #define REAL_ROBOT_H
3 
4 #include <argos3/core/utility/configuration/argos_configuration.h>
5 #include <argos3/core/control_interface/ci_controller.h>
6 
7 namespace argos {
8 
9  class CRealRobot {
10 
11  public:
12 
16  CRealRobot();
17 
21  virtual ~CRealRobot();
22 
27  virtual void Init(const std::string& str_conf_fname,
28  const std::string& str_controller_id);
29 
33  virtual void InitRobot() = 0;
34 
38  virtual void Destroy() = 0;
39 
44  virtual CCI_Actuator* MakeActuator(const std::string& str_name) = 0;
45 
50  virtual CCI_Sensor* MakeSensor(const std::string& str_name) = 0;
51 
55  virtual void Sense() = 0;
56 
60  virtual void Control();
61 
65  virtual void Act() = 0;
66 
70  virtual void Execute();
71 
75  static void Cleanup(int);
76 
77  protected:
78 
80  ticpp::Document m_tConfiguration;
85 
86  };
87 
88 }
89 
90 #endif
CCI_Controller * m_pcController
Definition: real_robot.h:79
static CRealRobot * m_pcInstance
Definition: real_robot.h:84
virtual void Init(const std::string &str_conf_fname, const std::string &str_controller_id)
Initializes the robot and the controller.
Definition: real_robot.cpp:27
virtual void InitRobot()=0
Put your robot initialization code here.
The basic interface for all actuators.
Definition: ci_actuator.h:34
float Real
Collects all ARGoS code.
Definition: datatypes.h:39
virtual void Control()
Execute the robot controller.
Definition: real_robot.cpp:126
ticpp::Element TConfigurationNode
The ARGoS configuration XML node.
virtual void Act()=0
Send data to the actuators.
TConfigurationNode * m_ptControllerConfRoot
Definition: real_robot.h:82
static void Cleanup(int)
Cleanup function called when the controller is stopped.
Definition: real_robot.cpp:151
CRealRobot()
Class constructor.
Definition: real_robot.cpp:18
The basic interface for all sensors.
Definition: ci_sensor.h:34
virtual void Sense()=0
Collect data from the sensors.
virtual CCI_Actuator * MakeActuator(const std::string &str_name)=0
Creates an actuator given its name.
TConfigurationNode m_tConfRoot
Definition: real_robot.h:81
virtual ~CRealRobot()
Class destructor.
Definition: real_robot.cpp:118
virtual void Destroy()=0
Put your robot cleanup code here.
ticpp::Document m_tConfiguration
Definition: real_robot.h:80
virtual void Execute()
Performs the main loop.
Definition: real_robot.cpp:133
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
The basic interface for a robot controller.
Definition: ci_controller.h:30
virtual CCI_Sensor * MakeSensor(const std::string &str_name)=0
Creates a sensor given its name.