60#ifndef guWhiteboard_SENSORSHeadJointSensors_h
61#define guWhiteboard_SENSORSHeadJointSensors_h
63#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
73#undef guWhiteboard_SENSORSHeadJointSensors_DEFINED
74#define guWhiteboard_SENSORSHeadJointSensors_DEFINED
76#undef SENSORSHeadJointSensors_DEFINED
77#define SENSORSHeadJointSensors_DEFINED
91 void init(
float t_HeadYaw = 0.0f,
float t_HeadPitch = 0.0f) {
102 this->init(t_HeadYaw, t_HeadPitch);
143 return !(*
this == t_other);
153 return !(*
this == t_other);
186#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
196#ifdef USE_WB_SENSORS_HEADJOINTSENSORS_C_CONVERSION
199 std::string descr = buffer;
202 std::ostringstream ss;
203 ss <<
"HeadYaw=" << this->
HeadYaw();
211#ifdef USE_WB_SENSORS_HEADJOINTSENSORS_C_CONVERSION
214 std::string toString = buffer;
217 std::ostringstream ss;
225#ifdef USE_WB_SENSORS_HEADJOINTSENSORS_C_CONVERSION
230 char * str_cstr =
const_cast<char *
>(t_str.c_str());
231 size_t temp_length = strlen(str_cstr);
232 int length = (temp_length <= INT_MAX) ? static_cast<int>(
static_cast<ssize_t
>(temp_length)) : -1;
237 char* var_str = &var_str_buffer[0];
239 char* key = &key_buffer[0];
246 if (index == 0 && str_cstr[0] ==
'{') {
252 for (
int i = index; i < length; i++) {
254 if (bracecount == 0 && str_cstr[i] ==
'=') {
259 if (bracecount == 0 && isspace(str_cstr[i])) {
266 if (bracecount == 0 && str_cstr[i] ==
',') {
270 if (str_cstr[i] ==
'{') {
274 if (str_cstr[i] ==
'}') {
276 if (bracecount < 0) {
281 if (i == length - 1) {
285 if (endKey >= startKey && endKey - startKey < length) {
286 strncpy(key, str_cstr + startKey,
static_cast<size_t>((endKey - startKey) + 1));
287 key[(endKey - startKey) + 1] = 0;
291 strncpy(var_str, str_cstr + startVar,
static_cast<size_t>((index - startVar) + 1));
292 var_str[(index - startVar) + 1] = 0;
298 if (strlen(key) > 0) {
299 if (0 == strcmp(
"HeadYaw", key)) {
301 }
else if (0 == strcmp(
"HeadPitch", key)) {
311 this->
set_HeadYaw(
static_cast<float>(atof(var_str)));
323 }
while(index < length);
Provides a C++ wrapper around wb_sensors_headjointsensors.
const float & HeadYaw() const
SENSORSHeadJointSensors & operator=(const SENSORSHeadJointSensors &t_other)
Copy Assignment Operator.
SENSORSHeadJointSensors(const std::string &t_str)
String Constructor.
bool operator==(const SENSORSHeadJointSensors &t_other) const
void set_HeadPitch(const float &t_newValue)
SENSORSHeadJointSensors(float t_HeadYaw=0.0f, float t_HeadPitch=0.0f)
Create a new SENSORSHeadJointSensors.
void from_string(const std::string &t_str)
SENSORSHeadJointSensors(const SENSORSHeadJointSensors &t_other)
Copy Constructor.
std::string description()
void set_HeadYaw(const float &t_newValue)
SENSORSHeadJointSensors(const struct wb_sensors_headjointsensors &t_other)
Copy Constructor.
const float & HeadPitch() const
bool operator!=(const SENSORSHeadJointSensors &t_other) const
WHITEBOARD_POSTER_STRING_CONVERSION.
float HeadPitch
Head pos in RAD.
float HeadYaw
Head pos in RAD.
const char * wb_sensors_headjointsensors_description(const struct wb_sensors_headjointsensors *self, char *descString, size_t bufferSize)
Convert to a description string.
struct wb_sensors_headjointsensors * wb_sensors_headjointsensors_from_string(struct wb_sensors_headjointsensors *self, const char *str)
Convert from a string.
const char * wb_sensors_headjointsensors_to_string(const struct wb_sensors_headjointsensors *self, char *toString, size_t bufferSize)
Convert to a string.
#define SENSORS_HEADJOINTSENSORS_DESC_BUFFER_SIZE
#define SENSORS_HEADJOINTSENSORS_TO_STRING_BUFFER_SIZE