10 #include <argos3/core/wrappers/lua/lua_utility.h>
19 int LuaDistanceScannerEnable(lua_State* pt_lua_state) {
21 if(lua_gettop(pt_lua_state) != 0) {
22 return luaL_error(pt_lua_state,
"robot.distance_scanner.enable() expects no arguments");
25 CLuaUtility::GetDeviceInstance<CCI_FootBotDistanceScannerActuator>(pt_lua_state,
"distance_scanner")->Enable();
29 int LuaDistanceScannerDisable(lua_State* pt_lua_state) {
31 if(lua_gettop(pt_lua_state) != 0) {
32 return luaL_error(pt_lua_state,
"robot.distance_scanner.disable() expects no arguments");
35 CLuaUtility::GetDeviceInstance<CCI_FootBotDistanceScannerActuator>(pt_lua_state,
"distance_scanner")->Disable();
39 int LuaDistanceScannerSetAngle(lua_State* pt_lua_state) {
41 if(lua_gettop(pt_lua_state) != 1) {
42 return luaL_error(pt_lua_state,
"robot.distance_scanner.set_angle() expects 1 argument");
44 luaL_checktype(pt_lua_state, 1, LUA_TNUMBER);
46 CLuaUtility::GetDeviceInstance<CCI_FootBotDistanceScannerActuator>(pt_lua_state,
"distance_scanner")->SetAngle(CRadians(lua_tonumber(pt_lua_state, 1)));
50 int LuaDistanceScannerSetRPM(lua_State* pt_lua_state) {
52 if(lua_gettop(pt_lua_state) != 1) {
53 return luaL_error(pt_lua_state,
"robot.distance_scanner.set_rpm() expects 1 argument");
55 luaL_checktype(pt_lua_state, 1, LUA_TNUMBER);
57 CLuaUtility::GetDeviceInstance<CCI_FootBotDistanceScannerActuator>(pt_lua_state,
"distance_scanner")->SetRPM(lua_tonumber(pt_lua_state, 1));
66 void CCI_FootBotDistanceScannerActuator::CreateLuaState(lua_State* pt_lua_state) {
The namespace containing all the ARGoS related code.
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 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.