Skip to content

Commit

Permalink
Fix bug in the positioning sensor control interface (was not compatib…
Browse files Browse the repository at this point in the history
…le with CLuaQuaternion)
  • Loading branch information
allsey87 committed Nov 8, 2019
1 parent 5786197 commit b2e97d2
Showing 1 changed file with 3 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,9 @@ namespace argos {
#ifdef ARGOS_WITH_LUA
void CCI_PositioningSensor::ReadingsToLuaState(lua_State* pt_lua_state) {
lua_getfield(pt_lua_state, -1, "positioning");
lua_getfield(pt_lua_state, -1, "position");
lua_pushnumber(pt_lua_state, m_sReading.Position.GetX());
lua_setfield(pt_lua_state, -2, "x");
lua_pushnumber(pt_lua_state, m_sReading.Position.GetY());
lua_setfield(pt_lua_state, -2, "y");
lua_pushnumber(pt_lua_state, m_sReading.Position.GetZ());
lua_setfield(pt_lua_state, -2, "z");
m_sReading.Orientation.ToAngleAxis(m_cAngle, m_cAxis);
lua_getfield (pt_lua_state, -2, "orientation");
lua_pushnumber(pt_lua_state, m_cAngle.GetValue());
lua_setfield (pt_lua_state, -2, "angle");
lua_getfield (pt_lua_state, -1, "axis");
lua_pushnumber(pt_lua_state, m_cAxis.GetX());
lua_setfield (pt_lua_state, -2, "x");
lua_pushnumber(pt_lua_state, m_cAxis.GetY());
lua_setfield (pt_lua_state, -2, "y");
lua_pushnumber(pt_lua_state, m_cAxis.GetZ());
lua_setfield (pt_lua_state, -2, "z");
lua_pop(pt_lua_state, 4);
CLuaUtility::AddToTable(pt_lua_state, "position", m_sReading.Position);
CLuaUtility::AddToTable(pt_lua_state, "orientation", m_sReading.Orientation);
lua_pop(pt_lua_state, 1);
}
#endif

Expand Down

0 comments on commit b2e97d2

Please sign in to comment.