1#ifndef NXT_Two_Touch_Status_DEFINED
2#define NXT_Two_Touch_Status_DEFINED
22#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
30 std::ostringstream ss;
33 ss << static_cast<int>(aButton.is_pressed()) <<
",";
43 l.set_is_pressed(
false);
44 r.set_is_pressed(
false);
45 vector<string> elements = components_of_string_separated(str,
',',
true);
47 if (elements.size() == 0)
return;
50 if (0!=atoi(elements[0].c_str() )) l.set_is_pressed(
true);
51 if (elements.size() < 2)
return;
52 if (0!=atoi(elements[1].c_str() )) r.set_is_pressed(
true);
60 wb_button otherButton =s.touch_sensors(b);
61 if (aButton.is_pressed()!= otherButton.is_pressed() )
Class for controlling differential robots Defines whiteboard message.
bool operator==(const NXT_Two_Touch_Status &s)
override equality operator so we can compare instances
NXT_Two_Touch_Status()
Designated constructor.
void from_string(std::string str)
string conversion
std::string description()
get message description
NXT_Two_Touch_Status(const std::string &name)
String constructor.