ARGoS
3
A parallel, multi-engine simulator for swarm robotics
|
Go to the documentation of this file.
18 #include <argos3/core/utility/logging/argos_log.h>
19 #include <argos3/core/utility/math/rng.h>
52 const std::string& str_filename);
61 const std::string& str_function);
118 const std::string& str_key);
137 const std::string& str_key);
157 static void EndTable(lua_State* pt_state);
168 const std::string& str_key,
180 const std::string& str_key,
181 lua_CFunction pt_data);
192 const std::string& str_key,
203 const std::string& str_key,
204 const std::string& str_data);
227 const std::string& str_key,
253 const std::string& str_key,
281 const std::string& str_key,
309 const std::string& str_key,
337 const std::string& str_key,
366 const std::string& str_key) {
367 lua_getglobal(pt_state,
"robot");
368 lua_getfield(pt_state, -1, str_key.c_str());
369 lua_getfield(pt_state, -1,
"_instance");
370 T* ptRetVal =
reinterpret_cast<T*
>(lua_touserdata(pt_state, -1));
371 lua_pop(pt_state, 3);
377 static int LOGWrapper(lua_State* pt_state);
379 static int LOGERRWrapper(lua_State* pt_state);
381 static int LoggerWrapper(
CARGoSLog& c_log,
382 lua_State* pt_state);
static bool LoadScript(lua_State *pt_state, const std::string &str_filename)
Loads the given Lua script.
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.
It defines the basic type CRadians, used to store an angle value in radians.
static void RegisterRNG(lua_State *pt_state, CRandom::CRNG *pc_rng)
Registers the given random number generator in the Lua state.
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 RegisterLoggerWrapper(lua_State *pt_state)
Registers LOG and LOGERR in the Lua state.
static void EndTable(lua_State *pt_state)
Adds a table to the Lua stack.
static void CloseRobotStateTable(lua_State *pt_state)
Closes a table in the robot state.
static T * GetDeviceInstance(lua_State *pt_state, const std::string &str_key)
Returns a pointer to the instance to the wanted device.
static void PrintGlobals(CARGoSLog &c_log, lua_State *pt_state)
Prints the global Lua symbols on the specified log.
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 PrintStack(CARGoSLog &c_log, lua_State *pt_state)
Prints the Lua stack on the specified log.
float Real
Collects all ARGoS code.
static bool CallLuaFunction(lua_State *pt_state, const std::string &str_function)
Calls a parameter-less function in the Lua script.