10 #include <argos3/core/wrappers/lua/lua_utility.h>
47 for(
size_t i = 0; i < 8; ++i)
59 void CCI_EPuckProximitySensor::CreateLuaState(lua_State* pt_lua_state) {
75 void CCI_EPuckProximitySensor::ReadingsToLuaState(lua_State* pt_lua_state) {
76 lua_getfield(pt_lua_state, -1,
"proximity");
78 lua_pushnumber(pt_lua_state, i+1 );
79 lua_gettable (pt_lua_state, -2 );
81 lua_setfield (pt_lua_state, -2,
"value" );
82 lua_pop(pt_lua_state, 1);
84 lua_pop(pt_lua_state, 1);
94 c_os <<
"Value=<" << s_reading.
Value
95 <<
">, Angle=<" << s_reading.
Angle <<
">";
104 if(! t_readings.empty()) {
105 c_os <<
"{ " << t_readings[0].Value <<
" }";
106 for(
UInt32 i = 1; i < t_readings.size(); ++i) {
107 c_os <<
" { " << t_readings[0].Value <<
" }";
unsigned int UInt32
32-bit unsigned integer.
The namespace containing all the ARGoS related code.
std::ostream & operator<<(std::ostream &c_os, const CByteArray &c_byte_array)
static const CRadians PI
The PI constant.
static const CRadians PI_OVER_TWO
Set to PI / 2.
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.
CCI_EPuckProximitySensor()
const TReadings & GetReadings() const
std::vector< SReading > TReadings