60#ifndef guWhiteboard_SensorsBodySensors_h
61#define guWhiteboard_SensorsBodySensors_h
63#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
73#undef guWhiteboard_SensorsBodySensors_DEFINED
74#define guWhiteboard_SensorsBodySensors_DEFINED
76#undef SensorsBodySensors_DEFINED
77#define SensorsBodySensors_DEFINED
91 void init(
signed int t_DCM_Time = 0,
float t_InertialSensor_AccX = 0.0f,
float t_InertialSensor_AccY = 0.0f,
float t_InertialSensor_AccZ = 0.0f,
float t_InertialSensor_GyrX = 0.0f,
float t_InertialSensor_GyrY = 0.0f,
float t_InertialSensor_GyrZ = 0.0f,
float t_InertialSensor_AngleX = 0.0f,
float t_InertialSensor_AngleY = 0.0f,
float t_InertialSensor_AngleZ = 0.0f,
float t_InertialSensor_AccelerometerX = 0.0f,
float t_InertialSensor_AccelerometerY = 0.0f,
float t_InertialSensor_AccelerometerZ = 0.0f,
float t_InertialSensor_GyroscopeX = 0.0f,
float t_InertialSensor_GyroscopeY = 0.0f,
float t_InertialSensor_GyroscopeZ = 0.0f, uint8_t t_Battery_Charge = 0, uint8_t t_Battery_Current = 0,
float t_US = 0.0f,
bool t_ChestBoard_Button =
true) {
119 SensorsBodySensors(
signed int t_DCM_Time = 0,
float t_InertialSensor_AccX = 0.0f,
float t_InertialSensor_AccY = 0.0f,
float t_InertialSensor_AccZ = 0.0f,
float t_InertialSensor_GyrX = 0.0f,
float t_InertialSensor_GyrY = 0.0f,
float t_InertialSensor_GyrZ = 0.0f,
float t_InertialSensor_AngleX = 0.0f,
float t_InertialSensor_AngleY = 0.0f,
float t_InertialSensor_AngleZ = 0.0f,
float t_InertialSensor_AccelerometerX = 0.0f,
float t_InertialSensor_AccelerometerY = 0.0f,
float t_InertialSensor_AccelerometerZ = 0.0f,
float t_InertialSensor_GyroscopeX = 0.0f,
float t_InertialSensor_GyroscopeY = 0.0f,
float t_InertialSensor_GyroscopeZ = 0.0f, uint8_t t_Battery_Charge = 0, uint8_t t_Battery_Current = 0,
float t_US = 0.0f,
bool t_ChestBoard_Button =
true) {
120 this->init(t_DCM_Time, t_InertialSensor_AccX, t_InertialSensor_AccY, t_InertialSensor_AccZ, t_InertialSensor_GyrX, t_InertialSensor_GyrY, t_InertialSensor_GyrZ, t_InertialSensor_AngleX, t_InertialSensor_AngleY, t_InertialSensor_AngleZ, t_InertialSensor_AccelerometerX, t_InertialSensor_AccelerometerY, t_InertialSensor_AccelerometerZ, t_InertialSensor_GyroscopeX, t_InertialSensor_GyroscopeY, t_InertialSensor_GyroscopeZ, t_Battery_Charge, t_Battery_Current, t_US, t_ChestBoard_Button);
127 this->init(t_other.
DCM_Time(), t_other.
InertialSensor_AccX(), t_other.
InertialSensor_AccY(), t_other.
InertialSensor_AccZ(), t_other.
InertialSensor_GyrX(), t_other.
InertialSensor_GyrY(), t_other.
InertialSensor_GyrZ(), t_other.
InertialSensor_AngleX(), t_other.
InertialSensor_AngleY(), t_other.
InertialSensor_AngleZ(), t_other.
InertialSensor_AccelerometerX(), t_other.
InertialSensor_AccelerometerY(), t_other.
InertialSensor_AccelerometerZ(), t_other.
InertialSensor_GyroscopeX(), t_other.
InertialSensor_GyroscopeY(), t_other.
InertialSensor_GyroscopeZ(), t_other.
Battery_Charge(), t_other.
Battery_Current(), t_other.
US(), t_other.
ChestBoard_Button());
134 this->init(t_other.
DCM_Time, t_other.
InertialSensor_AccX, t_other.
InertialSensor_AccY, t_other.
InertialSensor_AccZ, t_other.
InertialSensor_GyrX, t_other.
InertialSensor_GyrY, t_other.
InertialSensor_GyrZ, t_other.
InertialSensor_AngleX, t_other.
InertialSensor_AngleY, t_other.
InertialSensor_AngleZ, t_other.
InertialSensor_AccelerometerX, t_other.
InertialSensor_AccelerometerY, t_other.
InertialSensor_AccelerometerZ, t_other.
InertialSensor_GyroscopeX, t_other.
InertialSensor_GyroscopeY, t_other.
InertialSensor_GyroscopeZ, t_other.
Battery_Charge, t_other.
Battery_Current, t_other.
US, t_other.
ChestBoard_Button);
141 this->init(t_other.
DCM_Time(), t_other.
InertialSensor_AccX(), t_other.
InertialSensor_AccY(), t_other.
InertialSensor_AccZ(), t_other.
InertialSensor_GyrX(), t_other.
InertialSensor_GyrY(), t_other.
InertialSensor_GyrZ(), t_other.
InertialSensor_AngleX(), t_other.
InertialSensor_AngleY(), t_other.
InertialSensor_AngleZ(), t_other.
InertialSensor_AccelerometerX(), t_other.
InertialSensor_AccelerometerY(), t_other.
InertialSensor_AccelerometerZ(), t_other.
InertialSensor_GyroscopeX(), t_other.
InertialSensor_GyroscopeY(), t_other.
InertialSensor_GyroscopeZ(), t_other.
Battery_Charge(), t_other.
Battery_Current(), t_other.
US(), t_other.
ChestBoard_Button());
149 this->init(t_other.
DCM_Time, t_other.
InertialSensor_AccX, t_other.
InertialSensor_AccY, t_other.
InertialSensor_AccZ, t_other.
InertialSensor_GyrX, t_other.
InertialSensor_GyrY, t_other.
InertialSensor_GyrZ, t_other.
InertialSensor_AngleX, t_other.
InertialSensor_AngleY, t_other.
InertialSensor_AngleZ, t_other.
InertialSensor_AccelerometerX, t_other.
InertialSensor_AccelerometerY, t_other.
InertialSensor_AccelerometerZ, t_other.
InertialSensor_GyroscopeX, t_other.
InertialSensor_GyroscopeY, t_other.
InertialSensor_GyroscopeZ, t_other.
Battery_Charge, t_other.
Battery_Current, t_other.
US, t_other.
ChestBoard_Button);
173 && fabsf(
US() - t_other.
US()) < FLT_EPSILON
179 return !(*
this == t_other);
189 return !(*
this == t_other);
467 const float &
US()
const
492#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
502#ifdef USE_WB_SENSORS_BODY_SENSORS_C_CONVERSION
505 std::string descr = buffer;
508 std::ostringstream ss;
509 ss <<
"DCM_Time=" <<
static_cast<signed>(this->
DCM_Time());
541 ss <<
"Battery_Charge=" <<
static_cast<unsigned>(this->
Battery_Charge());
543 ss <<
"Battery_Current=" <<
static_cast<unsigned>(this->
Battery_Current());
545 ss <<
"US=" << this->
US();
553#ifdef USE_WB_SENSORS_BODY_SENSORS_C_CONVERSION
556 std::string toString = buffer;
559 std::ostringstream ss;
560 ss << static_cast<signed>(this->
DCM_Time());
603#ifdef USE_WB_SENSORS_BODY_SENSORS_C_CONVERSION
608 char * str_cstr =
const_cast<char *
>(t_str.c_str());
609 size_t temp_length = strlen(str_cstr);
610 int length = (temp_length <= INT_MAX) ? static_cast<int>(
static_cast<ssize_t
>(temp_length)) : -1;
615 char* var_str = &var_str_buffer[0];
617 char* key = &key_buffer[0];
624 if (index == 0 && str_cstr[0] ==
'{') {
630 for (
int i = index; i < length; i++) {
632 if (bracecount == 0 && str_cstr[i] ==
'=') {
637 if (bracecount == 0 && isspace(str_cstr[i])) {
644 if (bracecount == 0 && str_cstr[i] ==
',') {
648 if (str_cstr[i] ==
'{') {
652 if (str_cstr[i] ==
'}') {
654 if (bracecount < 0) {
659 if (i == length - 1) {
663 if (endKey >= startKey && endKey - startKey < length) {
664 strncpy(key, str_cstr + startKey,
static_cast<size_t>((endKey - startKey) + 1));
665 key[(endKey - startKey) + 1] = 0;
669 strncpy(var_str, str_cstr + startVar,
static_cast<size_t>((index - startVar) + 1));
670 var_str[(index - startVar) + 1] = 0;
676 if (strlen(key) > 0) {
677 if (0 == strcmp(
"DCM_Time", key)) {
679 }
else if (0 == strcmp(
"InertialSensor_AccX", key)) {
681 }
else if (0 == strcmp(
"InertialSensor_AccY", key)) {
683 }
else if (0 == strcmp(
"InertialSensor_AccZ", key)) {
685 }
else if (0 == strcmp(
"InertialSensor_GyrX", key)) {
687 }
else if (0 == strcmp(
"InertialSensor_GyrY", key)) {
689 }
else if (0 == strcmp(
"InertialSensor_GyrZ", key)) {
691 }
else if (0 == strcmp(
"InertialSensor_AngleX", key)) {
693 }
else if (0 == strcmp(
"InertialSensor_AngleY", key)) {
695 }
else if (0 == strcmp(
"InertialSensor_AngleZ", key)) {
697 }
else if (0 == strcmp(
"InertialSensor_AccelerometerX", key)) {
699 }
else if (0 == strcmp(
"InertialSensor_AccelerometerY", key)) {
701 }
else if (0 == strcmp(
"InertialSensor_AccelerometerZ", key)) {
703 }
else if (0 == strcmp(
"InertialSensor_GyroscopeX", key)) {
705 }
else if (0 == strcmp(
"InertialSensor_GyroscopeY", key)) {
707 }
else if (0 == strcmp(
"InertialSensor_GyroscopeZ", key)) {
709 }
else if (0 == strcmp(
"Battery_Charge", key)) {
711 }
else if (0 == strcmp(
"Battery_Current", key)) {
713 }
else if (0 == strcmp(
"US", key)) {
715 }
else if (0 == strcmp(
"ChestBoard_Button", key)) {
725 this->
set_DCM_Time(
static_cast<signed int>(atoi(var_str)));
815 this->
set_US(
static_cast<float>(atof(var_str)));
827 }
while(index < length);
Provides a C++ wrapper around wb_sensors_body_sensors.
const uint8_t & Battery_Current() const
const float & InertialSensor_GyroscopeZ() const
bool operator!=(const SensorsBodySensors &t_other) const
void set_InertialSensor_AccY(const float &t_newValue)
float & InertialSensor_AngleX()
const float & InertialSensor_AngleY() const
float & InertialSensor_AccY()
float & InertialSensor_GyroscopeZ()
void set_InertialSensor_AccelerometerY(const float &t_newValue)
float & InertialSensor_GyrZ()
const signed int & DCM_Time() const
void set_InertialSensor_GyroscopeY(const float &t_newValue)
void set_InertialSensor_AccZ(const float &t_newValue)
float & InertialSensor_AccZ()
void set_InertialSensor_GyroscopeX(const float &t_newValue)
float & InertialSensor_AccelerometerZ()
bool & ChestBoard_Button()
const float & InertialSensor_GyrX() const
void set_InertialSensor_AccelerometerX(const float &t_newValue)
void set_ChestBoard_Button(const bool &t_newValue)
SensorsBodySensors(signed int t_DCM_Time=0, float t_InertialSensor_AccX=0.0f, float t_InertialSensor_AccY=0.0f, float t_InertialSensor_AccZ=0.0f, float t_InertialSensor_GyrX=0.0f, float t_InertialSensor_GyrY=0.0f, float t_InertialSensor_GyrZ=0.0f, float t_InertialSensor_AngleX=0.0f, float t_InertialSensor_AngleY=0.0f, float t_InertialSensor_AngleZ=0.0f, float t_InertialSensor_AccelerometerX=0.0f, float t_InertialSensor_AccelerometerY=0.0f, float t_InertialSensor_AccelerometerZ=0.0f, float t_InertialSensor_GyroscopeX=0.0f, float t_InertialSensor_GyroscopeY=0.0f, float t_InertialSensor_GyroscopeZ=0.0f, uint8_t t_Battery_Charge=0, uint8_t t_Battery_Current=0, float t_US=0.0f, bool t_ChestBoard_Button=true)
Create a new SensorsBodySensors.
void set_InertialSensor_AngleY(const float &t_newValue)
float & InertialSensor_AngleY()
const float & InertialSensor_AccZ() const
const float & InertialSensor_GyroscopeY() const
float & InertialSensor_GyrY()
bool operator==(const SensorsBodySensors &t_other) const
std::string description()
const float & InertialSensor_AccelerometerZ() const
const float & InertialSensor_AccX() const
const float & InertialSensor_GyroscopeX() const
float & InertialSensor_AccX()
float & InertialSensor_GyroscopeY()
void set_Battery_Charge(const uint8_t &t_newValue)
void set_Battery_Current(const uint8_t &t_newValue)
const uint8_t & Battery_Charge() const
void set_DCM_Time(const signed int &t_newValue)
SensorsBodySensors(const std::string &t_str)
String Constructor.
const float & InertialSensor_AccelerometerY() const
const bool & ChestBoard_Button() const
void set_InertialSensor_AccelerometerZ(const float &t_newValue)
const float & InertialSensor_AccY() const
SensorsBodySensors(const SensorsBodySensors &t_other)
Copy Constructor.
SensorsBodySensors(const struct wb_sensors_body_sensors &t_other)
Copy Constructor.
float & InertialSensor_GyroscopeX()
const float & InertialSensor_AccelerometerX() const
void set_InertialSensor_AngleX(const float &t_newValue)
const float & InertialSensor_GyrZ() const
uint8_t & Battery_Charge()
float & InertialSensor_AccelerometerY()
void set_InertialSensor_GyrY(const float &t_newValue)
const float & InertialSensor_AngleX() const
const float & InertialSensor_AngleZ() const
float & InertialSensor_AngleZ()
void set_US(const float &t_newValue)
void set_InertialSensor_GyrZ(const float &t_newValue)
void set_InertialSensor_GyrX(const float &t_newValue)
void set_InertialSensor_AngleZ(const float &t_newValue)
SensorsBodySensors & operator=(const SensorsBodySensors &t_other)
Copy Assignment Operator.
void set_InertialSensor_GyroscopeZ(const float &t_newValue)
const float & InertialSensor_GyrY() const
uint8_t & Battery_Current()
float & InertialSensor_GyrX()
void from_string(const std::string &t_str)
float & InertialSensor_AccelerometerX()
void set_InertialSensor_AccX(const float &t_newValue)
WHITEBOARD_POSTER_STRING_CONVERSION.
float InertialSensor_GyroscopeY
new Gyro Y value
float InertialSensor_GyrZ
gyro Z value (Nao V5 have a Z axis)
uint8_t Battery_Charge
% of charge
float InertialSensor_AccelerometerY
new Accelerometer Y value
bool ChestBoard_Button
state of the chest button, on / off.
float InertialSensor_AccelerometerZ
new Accelerometer Z value
signed int DCM_Time
Absolute time used for all timed commands in the DCM, an integer (signed), with 1 ms precision.
float InertialSensor_GyrX
gyro X value
float InertialSensor_AccX
accelerometer X value
float InertialSensor_GyroscopeX
new Gyro X value
float InertialSensor_AngleZ
new acc values: AL_Docs 'Theses are direct acceleration values in m.s-2 (one g is approximately 9....
float InertialSensor_AngleX
new acc values: AL_Docs 'Theses are direct acceleration values in m.s-2 (one g is approximately 9....
uint8_t Battery_Current
Amps.
float InertialSensor_GyrY
gyro Y value
float InertialSensor_AccelerometerX
new Accelerometer X value
float InertialSensor_AccZ
accelerometer Z value
float US
unsure, check naoqi docs! Not sure about this type, might only be 1 byte
float InertialSensor_AccY
accelerometer Y value
float InertialSensor_GyroscopeZ
new Gyro Z value
float InertialSensor_AngleY
new acc values: AL_Docs 'Theses are direct acceleration values in m.s-2 (one g is approximately 9....
struct wb_sensors_body_sensors * wb_sensors_body_sensors_from_string(struct wb_sensors_body_sensors *self, const char *str)
Convert from a string.
const char * wb_sensors_body_sensors_description(const struct wb_sensors_body_sensors *self, char *descString, size_t bufferSize)
Convert to a description string.
const char * wb_sensors_body_sensors_to_string(const struct wb_sensors_body_sensors *self, char *toString, size_t bufferSize)
Convert to a string.
#define SENSORS_BODY_SENSORS_DESC_BUFFER_SIZE
#define SENSORS_BODY_SENSORS_TO_STRING_BUFFER_SIZE