10 #include <argos3/core/wrappers/lua/lua_utility.h>
26 void CCI_FootBotEncoderSensor::CreateLuaState(lua_State* pt_lua_state) {
41 void CCI_FootBotEncoderSensor::ReadingsToLuaState(lua_State* pt_lua_state) {
42 lua_getfield(pt_lua_state, -1,
"wheels");
43 lua_getfield(pt_lua_state, -1,
"encoder");
45 lua_setfield(pt_lua_state, -2,
"distance_left");
47 lua_setfield(pt_lua_state, -2,
"distance_right");
48 lua_pop(pt_lua_state, 2);
static void AddToTable(lua_State *pt_state, const std::string &str_key, void *pt_data)
Adds a pointer to a chunk of data with the given string key to the table located at the top of the st...
Real CoveredDistanceRightWheel
Real CoveredDistanceLeftWheel
The DTO of the encoder It returns the distance covered by the wheels in the last timestep In addition...
static void StartTable(lua_State *pt_state, const std::string &str_key)
Adds a table with the given string key to the table located at the top of the stack.
static void OpenRobotStateTable(lua_State *pt_state, const std::string &str_key)
Opens a table in the robot state, creating it if it does not exist.
The namespace containing all the ARGoS related code.
static void CloseRobotStateTable(lua_State *pt_state)
Closes a table in the robot state.
static void EndTable(lua_State *pt_state)
Adds a table to the Lua stack.
const SReading & GetReading() const
Returns the reading of the encoder sensor Returns the reading of the encoder sensor.