ci_altitude_sensor.cpp
Go to the documentation of this file.
1 
7 #include "ci_altitude_sensor.h"
8 
9 #ifdef ARGOS_WITH_LUA
10 #include <argos3/core/wrappers/lua/lua_utility.h>
11 #endif
12 
13 namespace 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 
39  return m_fReading;
40  }
41 
42 }
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.
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
float Real
Collects all ARGoS code.
Definition: datatypes.h:39