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(Real f_elapsed_time) = 0;
56 
60  virtual void Control();
61 
65  virtual void Act(Real f_elapsed_time) = 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
float Real
Collects all ARGoS code.
Definition: datatypes.h:39
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
ticpp::Element TConfigurationNode
The ARGoS configuration XML node.
The basic interface for all actuators.
Definition: ci_actuator.h:34
The basic interface for a robot controller.
Definition: ci_controller.h:30
The basic interface for all sensors.
Definition: ci_sensor.h:34
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 Control()
Execute the robot controller.
Definition: real_robot.cpp:130
virtual ~CRealRobot()
Class destructor.
Definition: real_robot.cpp:122
virtual void Destroy()=0
Put your robot cleanup code here.
CCI_Controller * m_pcController
Definition: real_robot.h:79
ticpp::Document m_tConfiguration
Definition: real_robot.h:80
TConfigurationNode * m_ptControllerConfRoot
Definition: real_robot.h:82
virtual void Act(Real f_elapsed_time)=0
Send data to the actuators.
CRealRobot()
Class constructor.
Definition: real_robot.cpp:18
TConfigurationNode m_tConfRoot
Definition: real_robot.h:81
virtual void Execute()
Performs the main loop.
Definition: real_robot.cpp:137
virtual CCI_Actuator * MakeActuator(const std::string &str_name)=0
Creates an actuator given its name.
virtual void Sense(Real f_elapsed_time)=0
Collect data from the sensors.
static void Cleanup(int)
Cleanup function called when the controller is stopped.
Definition: real_robot.cpp:164
virtual CCI_Sensor * MakeSensor(const std::string &str_name)=0
Creates a sensor given its name.
virtual void InitRobot()=0
Put your robot initialization code here.
static CRealRobot * m_pcInstance
Definition: real_robot.h:84