60#ifndef guWhiteboard_TeleoperationControlVR_h
61#define guWhiteboard_TeleoperationControlVR_h
63#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
73#undef guWhiteboard_TeleoperationControlVR_DEFINED
74#define guWhiteboard_TeleoperationControlVR_DEFINED
76#undef TeleoperationControlVR_DEFINED
77#define TeleoperationControlVR_DEFINED
91 void init(uint8_t t_ip = 0, int32_t t_action = 0,
float t_HeadYaw = 0,
float t_HeadPitch = 0, int32_t t_stance = 0, int32_t t_streamType = 0, int32_t t_selectedCamera = 0, std::string t_sayString =
"", int32_t t_walk = 0, int32_t t_turn = 0, int32_t t_timestamp = 0) {
99 gu_strlcpy(
const_cast<char *
>(this->
sayString()), t_sayString.c_str(), 30);
110 TeleoperationControlVR(uint8_t t_ip = 0, int32_t t_action = 0,
float t_HeadYaw = 0,
float t_HeadPitch = 0, int32_t t_stance = 0, int32_t t_streamType = 0, int32_t t_selectedCamera = 0, std::string t_sayString =
"", int32_t t_walk = 0, int32_t t_turn = 0, int32_t t_timestamp = 0) {
111 this->init(t_ip, t_action, t_HeadYaw, t_HeadPitch, t_stance, t_streamType, t_selectedCamera, t_sayString, t_walk, t_turn, t_timestamp);
118 this->init(t_other.
ip(), t_other.
action(), t_other.
HeadYaw(), t_other.
HeadPitch(), t_other.
stance(), t_other.
streamType(), t_other.
selectedCamera(), t_other.
sayString(), t_other.
walk(), t_other.
turn(), t_other.
timestamp());
125 this->init(t_other.
ip, t_other.
action, t_other.
HeadYaw, t_other.
HeadPitch, t_other.
stance, t_other.
streamType, t_other.
selectedCamera, t_other.
sayString, t_other.
walk, t_other.
turn, t_other.
timestamp);
132 this->init(t_other.
ip(), t_other.
action(), t_other.
HeadYaw(), t_other.
HeadPitch(), t_other.
stance(), t_other.
streamType(), t_other.
selectedCamera(), t_other.
sayString(), t_other.
walk(), t_other.
turn(), t_other.
timestamp());
140 this->init(t_other.
ip, t_other.
action, t_other.
HeadYaw, t_other.
HeadPitch, t_other.
stance, t_other.
streamType, t_other.
selectedCamera, t_other.
sayString, t_other.
walk, t_other.
turn, t_other.
timestamp);
146 return ip() == t_other.
ip()
161 return !(*
this == t_other);
171 return !(*
this == t_other);
179 const uint8_t &
ip()
const
349#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
359#ifdef USE_WB_TELEOPERATION_CONTROL_V_R_C_CONVERSION
362 std::string descr = buffer;
365 std::ostringstream ss;
366 ss <<
"ip=" <<
static_cast<unsigned>(this->
ip());
368 ss <<
"action=" <<
static_cast<signed>(this->
action());
370 ss <<
"HeadYaw=" << this->
HeadYaw();
374 ss <<
"stance=" <<
static_cast<signed>(this->
stance());
376 ss <<
"streamType=" <<
static_cast<signed>(this->
streamType());
378 ss <<
"selectedCamera=" <<
static_cast<signed>(this->
selectedCamera());
380 if (0 == strncmp(
"", this->
sayString(), 1)) {
381 ss <<
"sayString=" <<
"";
386 ss <<
"walk=" <<
static_cast<signed>(this->
walk());
388 ss <<
"turn=" <<
static_cast<signed>(this->
turn());
390 ss <<
"timestamp=" <<
static_cast<signed>(this->
timestamp());
396#ifdef USE_WB_TELEOPERATION_CONTROL_V_R_C_CONVERSION
399 std::string toString = buffer;
402 std::ostringstream ss;
403 ss << static_cast<unsigned>(this->
ip());
405 ss << static_cast<signed>(this->
action());
411 ss << static_cast<signed>(this->
stance());
413 ss << static_cast<signed>(this->
streamType());
417 if (0 == strncmp(
"", this->
sayString(), 1)) {
423 ss << static_cast<signed>(this->
walk());
425 ss << static_cast<signed>(this->
turn());
427 ss << static_cast<signed>(this->
timestamp());
432#ifdef USE_WB_TELEOPERATION_CONTROL_V_R_C_CONVERSION
437 char * str_cstr =
const_cast<char *
>(t_str.c_str());
438 size_t temp_length = strlen(str_cstr);
439 int length = (temp_length <= INT_MAX) ? static_cast<int>(
static_cast<ssize_t
>(temp_length)) : -1;
444 char* var_str = &var_str_buffer[0];
446 char* key = &key_buffer[0];
453 if (index == 0 && str_cstr[0] ==
'{') {
459 for (
int i = index; i < length; i++) {
461 if (bracecount == 0 && str_cstr[i] ==
'=') {
466 if (bracecount == 0 && isspace(str_cstr[i])) {
473 if (bracecount == 0 && str_cstr[i] ==
',') {
477 if (str_cstr[i] ==
'{') {
481 if (str_cstr[i] ==
'}') {
483 if (bracecount < 0) {
488 if (i == length - 1) {
492 if (endKey >= startKey && endKey - startKey < length) {
493 strncpy(key, str_cstr + startKey,
static_cast<size_t>((endKey - startKey) + 1));
494 key[(endKey - startKey) + 1] = 0;
498 strncpy(var_str, str_cstr + startVar,
static_cast<size_t>((index - startVar) + 1));
499 var_str[(index - startVar) + 1] = 0;
505 if (strlen(key) > 0) {
506 if (0 == strcmp(
"ip", key)) {
508 }
else if (0 == strcmp(
"action", key)) {
510 }
else if (0 == strcmp(
"HeadYaw", key)) {
512 }
else if (0 == strcmp(
"HeadPitch", key)) {
514 }
else if (0 == strcmp(
"stance", key)) {
516 }
else if (0 == strcmp(
"streamType", key)) {
518 }
else if (0 == strcmp(
"selectedCamera", key)) {
520 }
else if (0 == strcmp(
"sayString", key)) {
522 }
else if (0 == strcmp(
"walk", key)) {
524 }
else if (0 == strcmp(
"turn", key)) {
526 }
else if (0 == strcmp(
"timestamp", key)) {
536 this->
set_ip(
static_cast<uint8_t
>(atoi(var_str)));
541 this->
set_action(
static_cast<int32_t
>(atoi(var_str)));
546 this->
set_HeadYaw(
static_cast<float>(atof(var_str)));
556 this->
set_stance(
static_cast<int32_t
>(atoi(var_str)));
576 this->
set_walk(
static_cast<int32_t
>(atoi(var_str)));
581 this->
set_turn(
static_cast<int32_t
>(atoi(var_str)));
593 }
while(index < length);
Provides a C++ wrapper around wb_teleoperation_control_v_r.
TeleoperationControlVR(uint8_t t_ip=0, int32_t t_action=0, float t_HeadYaw=0, float t_HeadPitch=0, int32_t t_stance=0, int32_t t_streamType=0, int32_t t_selectedCamera=0, std::string t_sayString="", int32_t t_walk=0, int32_t t_turn=0, int32_t t_timestamp=0)
Create a new TeleoperationControlVR.
const int32_t & action() const
const char * sayString() const
const int32_t & streamType() const
size_t sayString_size() const
const int32_t & turn() const
const int32_t & stance() const
TeleoperationControlVR(const std::string &t_str)
String Constructor.
bool operator!=(const TeleoperationControlVR &t_other) const
std::string description()
TeleoperationControlVR(const TeleoperationControlVR &t_other)
Copy Constructor.
void set_action(const int32_t &t_newValue)
void set_HeadYaw(const float &t_newValue)
void set_streamType(const int32_t &t_newValue)
const int32_t & walk() const
const int32_t & timestamp() const
const float & HeadYaw() const
TeleoperationControlVR & operator=(const TeleoperationControlVR &t_other)
Copy Assignment Operator.
const float & HeadPitch() const
char & sayString(int t_i)
void set_selectedCamera(const int32_t &t_newValue)
void set_turn(const int32_t &t_newValue)
void set_HeadPitch(const float &t_newValue)
void set_stance(const int32_t &t_newValue)
void set_sayString(const char *t_newValue)
const uint8_t & ip() const
void set_walk(const int32_t &t_newValue)
void set_ip(const uint8_t &t_newValue)
const char & sayString(int t_i) const
int32_t & selectedCamera()
TeleoperationControlVR(const struct wb_teleoperation_control_v_r &t_other)
Copy Constructor.
void set_timestamp(const int32_t &t_newValue)
bool operator==(const TeleoperationControlVR &t_other) const
void from_string(const std::string &t_str)
const int32_t & selectedCamera() const
WHITEBOARD_POSTER_STRING_CONVERSION.
int32_t action
Use guWhiteboard::Motions::action enum values!
float HeadPitch
Head pos in RAD.
float HeadYaw
Head pos in RAD.
int32_t selectedCamera
VisionCamera.
int32_t stance
guWhiteboard::Motions::stance
char sayString[30]
String passed to Say_t.
int32_t timestamp
Timestamp for task distinguishing.
int32_t streamType
Use enum StreamingType (Vision_Control.h)
uint8_t ip
Last octet of IP address.
struct wb_teleoperation_control_v_r * wb_teleoperation_control_v_r_from_string(struct wb_teleoperation_control_v_r *self, const char *str)
Convert from a string.
const char * wb_teleoperation_control_v_r_description(const struct wb_teleoperation_control_v_r *self, char *descString, size_t bufferSize)
Convert to a description string.
const char * wb_teleoperation_control_v_r_to_string(const struct wb_teleoperation_control_v_r *self, char *toString, size_t bufferSize)
Convert to a string.
#define TELEOPERATIONCONTROLVR_TO_STRING_BUFFER_SIZE
#define TELEOPERATIONCONTROLVR_DESC_BUFFER_SIZE