ARGoS
3
A parallel, multi-engine simulator for swarm robotics
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
38
Real
CCI_AltitudeSensor::GetReading
()
const
{
39
return
m_fReading
;
40
}
41
42
}
argos::CCI_AltitudeSensor::m_fReading
Real m_fReading
Definition:
ci_altitude_sensor.h:39
argos
The namespace containing all the ARGoS related code.
Definition:
ci_actuator.h:12
ci_altitude_sensor.h
argos::CCI_AltitudeSensor::GetReading
Real GetReading() const
Returns the current altitude.
Definition:
ci_altitude_sensor.cpp:38
argos::CLuaUtility::AddToTable
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...
Definition:
lua_utility.cpp:337
Real
float Real
Collects all ARGoS code.
Definition:
datatypes.h:39
plugins
robots
generic
control_interface
ci_altitude_sensor.cpp
Generated on Wed Aug 4 2021 00:15:55 for ARGoS by
1.8.17