Modules-old/youbot/lua_youbot.cpp
// Get base position, from encoders, and use YouBot API calculation
Get base position, from encoders, and use YouBot API calculation
Get base position from encoders and use YouBot API calculation
static int lua_get_base_position(lua_State *L) {
	static quantity<si::length> actualLongitudinalPose = 0 * meter;
	static quantity<si::length> actualTransversalPose = 0 * meter;
	static quantity<si::plane_angle> actualAngle = 0 * radian;
	if(!ybBase){return luaL_error(L,"Base is not initialized!");}
	ybBase->getBasePosition(
			actualLongitudinalPose, actualTransversalPose, actualAngle);
	lua_pushnumber(L, actualLongitudinalPose.value() ); 
	lua_pushnumber(L, actualTransversalPose.value() ); 
	lua_pushnumber(L, actualAngle.value() ); 
	return 3;
}
static int lua_get_base_position ( lua_State * L ) { static quantity < si :: length > actualLongitudinalPose = 0 * meter ; static quantity < si :: length > actualTransversalPose = 0 * meter ; static quantity < si :: plane_angle > actualAngle = 0 * radian ; if ( ! ybBase ) { return luaL_error ( L , " " ) ; } ybBase -> getBasePosition ( actualLongitudinalPose , actualTransversalPose , actualAngle ) ; lua_pushnumber ( L , actualLongitudinalPose . value ( ) ) ; lua_pushnumber ( L , actualTransversalPose . value ( ) ) ; lua_pushnumber ( L , actualAngle . value ( ) ) ; return 3 ; }
Get base position, from encoders, and use YouBot API calculation
Get base position from encoders and use YouBot API calculation
// Push the numbers onto the stack //x //y //a