#include <lua_controller.h>
Public Member Functions | |
CLuaController () | |
virtual | ~CLuaController () |
virtual void | Init (TConfigurationNode &t_tree) |
Initializes the controller. More... | |
virtual void | ControlStep () |
Executes a control step. More... | |
virtual void | Reset () |
Resets the state of the controller to what it was right after Init() was executed. More... | |
virtual void | Destroy () |
The default implementation of this method does nothing. More... | |
lua_State * | GetLuaState () |
virtual void | SetLuaScript (const std::string &str_script, TConfigurationNode &t_tree) |
virtual void | SetLuaScript (const std::string &str_script) |
virtual void | CreateLuaState () |
virtual void | SensorReadingsToLuaState () |
virtual void | ParametersToLuaState (TConfigurationNode &t_tree) |
bool | IsOK () const |
std::string | GetErrorMessage () |
Public Member Functions inherited from argos::CCI_Controller | |
virtual | ~CCI_Controller () |
Class destructor. More... | |
const std::string & | GetId () const |
Returns the id of the robot associated to this controller. More... | |
void | SetId (const std::string &str_id) |
Sets the id of the robot associated to this controller. More... | |
template<typename ACTUATOR_IMPL > | |
ACTUATOR_IMPL * | GetActuator (const std::string &str_actuator_type) |
Returns a pointer to the an actuator, given its type. More... | |
template<typename SENSOR_IMPL > | |
SENSOR_IMPL * | GetSensor (const std::string &str_sensor_type) |
Returns a pointer to the an sensor, given its type. More... | |
bool | HasActuator (const std::string &str_actuator_type) const |
Returns true if an actuator with the passed type is associated to this controller. More... | |
bool | HasSensor (const std::string &str_sensor_type) const |
Returns true if an sensor with the passed type is associated to this controller. More... | |
CCI_Actuator::TMap & | GetAllActuators () |
Returns a map of the associated actuators. More... | |
CCI_Sensor::TMap & | GetAllSensors () |
Returns a map of the associated sensors. More... | |
void | AddActuator (const std::string &str_actuator_type, CCI_Actuator *pc_actuator) |
Adds an actuator to this controller. More... | |
void | AddSensor (const std::string &str_sensor_type, CCI_Sensor *pc_sensor) |
Adds an sensor to this controller. More... | |
Public Member Functions inherited from argos::CBaseConfigurableResource | |
virtual | ~CBaseConfigurableResource () |
Class destructor. More... | |
Additional Inherited Members | |
Protected Attributes inherited from argos::CCI_Controller | |
CCI_Actuator::TMap | m_mapActuators |
A map containing all the actuators associated to this controller. More... | |
CCI_Sensor::TMap | m_mapSensors |
A map containing all the sensors associated to this controller. More... | |
std::string | m_strId |
The id of the robot associated to this controller More... | |
Definition at line 16 of file lua_controller.h.
argos::CLuaController::CLuaController | ( | ) |
Definition at line 20 of file lua_controller.cpp.
|
virtual |
Definition at line 30 of file lua_controller.cpp.
|
virtual |
Executes a control step.
The logic of your controller goes here. The default implementation does nothing.
Reimplemented from argos::CCI_Controller.
Definition at line 67 of file lua_controller.cpp.
|
virtual |
Definition at line 162 of file lua_controller.cpp.
|
virtual |
The default implementation of this method does nothing.
Reimplemented from argos::CCI_Controller.
Definition at line 95 of file lua_controller.cpp.
std::string argos::CLuaController::GetErrorMessage | ( | ) |
Definition at line 232 of file lua_controller.cpp.
|
inline |
Definition at line 32 of file lua_controller.h.
|
virtual |
Initializes the controller.
You should always perform all your memory allocation and configuration in this method, and not in the constructor. The default implementation of this method does nothing.
t_node | The <params> XML tree associated to this controller. |
Reimplemented from argos::CCI_Controller.
Definition at line 36 of file lua_controller.cpp.
|
inline |
Definition at line 47 of file lua_controller.h.
|
virtual |
Definition at line 211 of file lua_controller.cpp.
|
virtual |
Resets the state of the controller to what it was right after Init() was executed.
Note that the state of the robot, as well as the state of sensors and actuators is automatically reset by ARGoS outside this class. The default implementation of this method does nothing.
Reimplemented from argos::CCI_Controller.
Definition at line 81 of file lua_controller.cpp.
|
virtual |
Definition at line 195 of file lua_controller.cpp.
|
virtual |
Definition at line 154 of file lua_controller.cpp.
|
virtual |
Definition at line 107 of file lua_controller.cpp.