10 #include <argos3/core/wrappers/lua/lua_utility.h>
26 void CCI_RadiosSensor::CreateLuaState(lua_State* pt_lua_state) {
42 void CCI_RadiosSensor::ReadingsToLuaState(lua_State* pt_lua_state) {
43 lua_getfield(pt_lua_state, -1,
"radios");
46 lua_getfield(pt_lua_state, -1,
"rx_data");
47 size_t unLastMessageCount = lua_rawlen(pt_lua_state, -1);
57 for(
size_t j =
m_vecInterfaces[i].Data.size() + 1; j <= unLastMessageCount; ++j) {
58 lua_pushnumber(pt_lua_state, j);
59 lua_pushnil(pt_lua_state);
60 lua_settable(pt_lua_state, -3);
63 lua_pop(pt_lua_state, 1);
64 lua_pop(pt_lua_state, 1);
66 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.
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.
static void CloseRobotStateTable(lua_State *pt_state)
Closes a table in the robot state.
SInterface::TVector m_vecInterfaces
const SInterface::TVector & GetInterfaces() const
Returns a const reference to the radio interfaces.
std::vector< SInterface > TVector