10 #include <argos3/core/wrappers/lua/lua_utility.h>
26 void CCI_BatterySensor::CreateLuaState(lua_State* pt_lua_state) {
38 void CCI_BatterySensor::ReadingsToLuaState(lua_State* pt_lua_state) {
39 lua_getfield(pt_lua_state, -1,
"battery");
41 lua_setfield(pt_lua_state, -2,
"available_charge");
43 lua_setfield(pt_lua_state, -2,
"time_left");
44 lua_pop(pt_lua_state, 1);
The namespace containing all the ARGoS related code.
static void EndTable(lua_State *pt_state)
Adds a table to the Lua stack.
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...
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.
const SReading & GetReading() const
Real AvailableCharge
Available charge, between 0 and 1.
Real TimeLeft
Time left in seconds.