18 #include <argos3/core/utility/logging/argos_log.h>
19 #include <argos3/core/utility/math/rng.h>
42 const std::string& str_filename);
51 const std::string& str_function);
108 const std::string& str_key);
127 const std::string& str_key);
147 static void EndTable(lua_State* pt_state);
158 const std::string& str_key);
170 const std::string& str_key,
182 const std::string& str_key,
183 lua_CFunction pt_data);
194 const std::string& str_key,
195 const std::string& str_data);
207 const std::string& str_data);
218 const std::string& str_key,
242 const std::string& str_key,
268 const std::string& str_key,
296 const std::string& str_key,
324 const std::string& str_key,
352 const std::string& str_key,
381 const std::string& str_key) {
382 lua_getglobal(pt_state,
"robot");
383 lua_getfield(pt_state, -1, str_key.c_str());
384 lua_getfield(pt_state, -1,
"_instance");
385 T* ptRetVal =
reinterpret_cast<T*
>(lua_touserdata(pt_state, -1));
386 lua_pop(pt_state, 3);
392 static int LOGWrapper(lua_State* pt_state);
394 static int LOGERRWrapper(lua_State* pt_state);
396 static int LoggerWrapper(
CARGoSLog& c_log,
397 lua_State* pt_state);
float Real
Collects all ARGoS code.
The namespace containing all the ARGoS related code.
It defines the basic type CRadians, used to store an angle value in radians.
static void EndTable(lua_State *pt_state)
Adds a table to the Lua stack.
static T * GetDeviceInstance(lua_State *pt_state, const std::string &str_key)
Returns a pointer to the instance to the wanted device.
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 bool CallLuaFunction(lua_State *pt_state, const std::string &str_function)
Calls a parameter-less function in the Lua script.
static void SetMetatable(lua_State *pt_state, const std::string &str_key)
Sets the metatable with the given string key to the table located at the top of the stack.
static bool LoadScript(lua_State *pt_state, const std::string &str_filename)
Loads the given Lua script.
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 RegisterLoggerWrapper(lua_State *pt_state)
Registers LOG and LOGERR in the Lua state.
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.
static void PrintStack(CARGoSLog &c_log, lua_State *pt_state)
Prints the Lua stack on the specified log.
static void RegisterRNG(lua_State *pt_state, CRandom::CRNG *pc_rng)
Registers the given random number generator in the Lua state.
static void PrintGlobals(CARGoSLog &c_log, lua_State *pt_state)
Prints the global Lua symbols on the specified log.