9#ifndef NAO_State_DEFINED
10#define NAO_State_DEFINED
14#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
22#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
35 "KickingWithLeftFoot",
36 "KickingWithRightFoot"
40 static const char *Robot_Walk_stringValues[
NUM_OF_WALKS] =
70#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
83 ss << Robot_Stance_stringValues[int(
stance())] <<
", " << Robot_Walk_stringValues[int(walk())] <<
", " << (chest_pressed_long() ?
"L" :
"") <<
int(chest_pressed()) <<
" @chest, " << (left_foot_pressed_long() ?
"L" :
"") <<
int(left_foot_pressed()) <<
" @lfoot, " << (right_foot_pressed_long() ?
"L" :
"") <<
int(right_foot_pressed()) <<
" @rfoot";
93 std::istringstream iss(str);
95 getline(iss, token,
',');
98 if (token.length() && (token[0] ==
'l' || token[0] ==
'L' || isdigit(*token.c_str())))
goto chest_button;
102 if (token == Robot_Stance_stringValues[i])
109 if (!getline(iss, token,
','))
return;
114 if (token == Robot_Walk_stringValues[i])
121 if (!getline(iss, token,
','))
return;
127 const char *value = token.c_str();
128 if (*value ==
'l' || *value ==
'L')
130 set_chest_pressed_long(
true);
133 set_chest_pressed(
bool(value));
136 if (!getline(iss, token,
','))
return;
140 const char *value = token.c_str();
141 if (*value ==
'l' || *value ==
'L')
143 set_left_foot_pressed_long(
true);
146 set_left_foot_pressed(
bool(value));
149 if (!getline(iss, token,
','))
return;
153 const char *value = token.c_str();
154 if (*value ==
'l' || *value ==
'L')
156 set_right_foot_pressed_long(
true);
159 set_right_foot_pressed(
bool(value));
This class is for the robot to report its current state.
std::string description()
pretty print method for showing the current property values
bool fallen() const
Convenience method for checking the Fallen values.
void from_string(const std::string &str)
parse class properties from a string
NAO_State(const std::string &command)
string constructor (see from_string() below)
NAO_State()
Constructor, calls the data structs default constructor, which sets some default values.
stance
enum values for all stances
Robot_Stance
/file wb_nao_state.h
Robot_Walk
which type of walk engine is currently running