ARGoS 3
A parallel, multi-engine simulator for swarm robotics
ci_altitude_sensor.cpp
Go to the documentation of this file.
1
8
9#ifdef ARGOS_WITH_LUA
10#include <argos3/core/wrappers/lua/lua_utility.h>
11#endif
12
13namespace argos {
14
15 /****************************************/
16 /****************************************/
17
18#ifdef ARGOS_WITH_LUA
19 void CCI_AltitudeSensor::CreateLuaState(lua_State* pt_lua_state) {
20 CLuaUtility::AddToTable(pt_lua_state, "altitude", m_fReading);
21 }
22#endif
23
24 /****************************************/
25 /****************************************/
26
27#ifdef ARGOS_WITH_LUA
28 void CCI_AltitudeSensor::ReadingsToLuaState(lua_State* pt_lua_state) {
29 lua_pushnumber(pt_lua_state, m_fReading);
30 lua_setfield(pt_lua_state, -2, "altitude");
31 }
32#endif
33
34
35 /****************************************/
36 /****************************************/
37
41
42}
float Real
Collects all ARGoS code.
Definition datatypes.h:39
The namespace containing all the ARGoS related code.
Definition ci_actuator.h:12
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...
Real GetReading() const
Returns the current altitude.