gusimplewhiteboard
SensorsBodySensors.hpp
Go to the documentation of this file.
1/*
2 * file SensorsBodySensors.hpp
3 *
4 * This file was generated by classgenerator from sensors_body_sensors.gen.
5 * DO NOT CHANGE MANUALLY!
6 *
7 * Copyright © 2021 Carl Lusty. All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 *
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 *
16 * 2. Redistributions in binary form must reproduce the above
17 * copyright notice, this list of conditions and the following
18 * disclaimer in the documentation and/or other materials
19 * provided with the distribution.
20 *
21 * 3. All advertising materials mentioning features or use of this
22 * software must display the following acknowledgement:
23 *
24 * This product includes software developed by Carl Lusty.
25 *
26 * 4. Neither the name of the author nor the names of contributors
27 * may be used to endorse or promote products derived from this
28 * software without specific prior written permission.
29 *
30 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
31 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
32 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
33 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
34 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
35 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
36 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
37 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
38 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
39 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
40 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41 *
42 * -----------------------------------------------------------------------
43 * This program is free software; you can redistribute it and/or
44 * modify it under the above terms or under the terms of the GNU
45 * General Public License as published by the Free Software Foundation;
46 * either version 2 of the License, or (at your option) any later version.
47 *
48 * This program is distributed in the hope that it will be useful,
49 * but WITHOUT ANY WARRANTY; without even the implied warranty of
50 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
51 * GNU General Public License for more details.
52 *
53 * You should have received a copy of the GNU General Public License
54 * along with this program; if not, see http://www.gnu.org/licenses/
55 * or write to the Free Software Foundation, Inc., 51 Franklin Street,
56 * Fifth Floor, Boston, MA 02110-1301, USA.
57 *
58 */
59
60#ifndef guWhiteboard_SensorsBodySensors_h
61#define guWhiteboard_SensorsBodySensors_h
62
63#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
64#include <cstdlib>
65#include <string.h>
66#include <sstream>
67#endif
68
69#include <gu_util.h>
71#include <float.h>
72
73#undef guWhiteboard_SensorsBodySensors_DEFINED
74#define guWhiteboard_SensorsBodySensors_DEFINED
75
76#undef SensorsBodySensors_DEFINED
77#define SensorsBodySensors_DEFINED
78
79namespace guWhiteboard {
80
85
86 private:
87
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) {
92 set_DCM_Time(t_DCM_Time);
93 set_InertialSensor_AccX(t_InertialSensor_AccX);
94 set_InertialSensor_AccY(t_InertialSensor_AccY);
95 set_InertialSensor_AccZ(t_InertialSensor_AccZ);
96 set_InertialSensor_GyrX(t_InertialSensor_GyrX);
97 set_InertialSensor_GyrY(t_InertialSensor_GyrY);
98 set_InertialSensor_GyrZ(t_InertialSensor_GyrZ);
99 set_InertialSensor_AngleX(t_InertialSensor_AngleX);
100 set_InertialSensor_AngleY(t_InertialSensor_AngleY);
101 set_InertialSensor_AngleZ(t_InertialSensor_AngleZ);
102 set_InertialSensor_AccelerometerX(t_InertialSensor_AccelerometerX);
103 set_InertialSensor_AccelerometerY(t_InertialSensor_AccelerometerY);
104 set_InertialSensor_AccelerometerZ(t_InertialSensor_AccelerometerZ);
105 set_InertialSensor_GyroscopeX(t_InertialSensor_GyroscopeX);
106 set_InertialSensor_GyroscopeY(t_InertialSensor_GyroscopeY);
107 set_InertialSensor_GyroscopeZ(t_InertialSensor_GyroscopeZ);
108 set_Battery_Charge(t_Battery_Charge);
109 set_Battery_Current(t_Battery_Current);
110 set_US(t_US);
111 set_ChestBoard_Button(t_ChestBoard_Button);
112 }
113
114 public:
115
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);
121 }
122
128 }
129
135 }
136
142 return *this;
143 }
144
150 return *this;
151 }
152
153 bool operator ==(const SensorsBodySensors &t_other) const
154 {
155 return DCM_Time() == t_other.DCM_Time()
156 && fabsf(InertialSensor_AccX() - t_other.InertialSensor_AccX()) < FLT_EPSILON
157 && fabsf(InertialSensor_AccY() - t_other.InertialSensor_AccY()) < FLT_EPSILON
158 && fabsf(InertialSensor_AccZ() - t_other.InertialSensor_AccZ()) < FLT_EPSILON
159 && fabsf(InertialSensor_GyrX() - t_other.InertialSensor_GyrX()) < FLT_EPSILON
160 && fabsf(InertialSensor_GyrY() - t_other.InertialSensor_GyrY()) < FLT_EPSILON
161 && fabsf(InertialSensor_GyrZ() - t_other.InertialSensor_GyrZ()) < FLT_EPSILON
162 && fabsf(InertialSensor_AngleX() - t_other.InertialSensor_AngleX()) < FLT_EPSILON
163 && fabsf(InertialSensor_AngleY() - t_other.InertialSensor_AngleY()) < FLT_EPSILON
164 && fabsf(InertialSensor_AngleZ() - t_other.InertialSensor_AngleZ()) < FLT_EPSILON
165 && fabsf(InertialSensor_AccelerometerX() - t_other.InertialSensor_AccelerometerX()) < FLT_EPSILON
166 && fabsf(InertialSensor_AccelerometerY() - t_other.InertialSensor_AccelerometerY()) < FLT_EPSILON
167 && fabsf(InertialSensor_AccelerometerZ() - t_other.InertialSensor_AccelerometerZ()) < FLT_EPSILON
168 && fabsf(InertialSensor_GyroscopeX() - t_other.InertialSensor_GyroscopeX()) < FLT_EPSILON
169 && fabsf(InertialSensor_GyroscopeY() - t_other.InertialSensor_GyroscopeY()) < FLT_EPSILON
170 && fabsf(InertialSensor_GyroscopeZ() - t_other.InertialSensor_GyroscopeZ()) < FLT_EPSILON
171 && Battery_Charge() == t_other.Battery_Charge()
172 && Battery_Current() == t_other.Battery_Current()
173 && fabsf(US() - t_other.US()) < FLT_EPSILON
174 && ChestBoard_Button() == t_other.ChestBoard_Button();
175 }
176
177 bool operator !=(const SensorsBodySensors &t_other) const
178 {
179 return !(*this == t_other);
180 }
181
182 bool operator ==(const wb_sensors_body_sensors &t_other) const
183 {
184 return *this == SensorsBodySensors(t_other);
185 }
186
187 bool operator !=(const wb_sensors_body_sensors &t_other) const
188 {
189 return !(*this == t_other);
190 }
191
192 signed int & DCM_Time()
193 {
195 }
196
197 const signed int & DCM_Time() const
198 {
200 }
201
202 void set_DCM_Time(const signed int &t_newValue)
203 {
205 }
206
208 {
210 }
211
212 const float & InertialSensor_AccX() const
213 {
215 }
216
217 void set_InertialSensor_AccX(const float &t_newValue)
218 {
220 }
221
223 {
225 }
226
227 const float & InertialSensor_AccY() const
228 {
230 }
231
232 void set_InertialSensor_AccY(const float &t_newValue)
233 {
235 }
236
238 {
240 }
241
242 const float & InertialSensor_AccZ() const
243 {
245 }
246
247 void set_InertialSensor_AccZ(const float &t_newValue)
248 {
250 }
251
253 {
255 }
256
257 const float & InertialSensor_GyrX() const
258 {
260 }
261
262 void set_InertialSensor_GyrX(const float &t_newValue)
263 {
265 }
266
268 {
270 }
271
272 const float & InertialSensor_GyrY() const
273 {
275 }
276
277 void set_InertialSensor_GyrY(const float &t_newValue)
278 {
280 }
281
283 {
285 }
286
287 const float & InertialSensor_GyrZ() const
288 {
290 }
291
292 void set_InertialSensor_GyrZ(const float &t_newValue)
293 {
295 }
296
298 {
300 }
301
302 const float & InertialSensor_AngleX() const
303 {
305 }
306
307 void set_InertialSensor_AngleX(const float &t_newValue)
308 {
310 }
311
313 {
315 }
316
317 const float & InertialSensor_AngleY() const
318 {
320 }
321
322 void set_InertialSensor_AngleY(const float &t_newValue)
323 {
325 }
326
328 {
330 }
331
332 const float & InertialSensor_AngleZ() const
333 {
335 }
336
337 void set_InertialSensor_AngleZ(const float &t_newValue)
338 {
340 }
341
343 {
345 }
346
347 const float & InertialSensor_AccelerometerX() const
348 {
350 }
351
352 void set_InertialSensor_AccelerometerX(const float &t_newValue)
353 {
355 }
356
358 {
360 }
361
362 const float & InertialSensor_AccelerometerY() const
363 {
365 }
366
367 void set_InertialSensor_AccelerometerY(const float &t_newValue)
368 {
370 }
371
373 {
375 }
376
377 const float & InertialSensor_AccelerometerZ() const
378 {
380 }
381
382 void set_InertialSensor_AccelerometerZ(const float &t_newValue)
383 {
385 }
386
388 {
390 }
391
392 const float & InertialSensor_GyroscopeX() const
393 {
395 }
396
397 void set_InertialSensor_GyroscopeX(const float &t_newValue)
398 {
400 }
401
403 {
405 }
406
407 const float & InertialSensor_GyroscopeY() const
408 {
410 }
411
412 void set_InertialSensor_GyroscopeY(const float &t_newValue)
413 {
415 }
416
418 {
420 }
421
422 const float & InertialSensor_GyroscopeZ() const
423 {
425 }
426
427 void set_InertialSensor_GyroscopeZ(const float &t_newValue)
428 {
430 }
431
432 uint8_t & Battery_Charge()
433 {
435 }
436
437 const uint8_t & Battery_Charge() const
438 {
440 }
441
442 void set_Battery_Charge(const uint8_t &t_newValue)
443 {
445 }
446
447 uint8_t & Battery_Current()
448 {
450 }
451
452 const uint8_t & Battery_Current() const
453 {
455 }
456
457 void set_Battery_Current(const uint8_t &t_newValue)
458 {
460 }
461
462 float & US()
463 {
465 }
466
467 const float & US() const
468 {
470 }
471
472 void set_US(const float &t_newValue)
473 {
474 wb_sensors_body_sensors::US = t_newValue;
475 }
476
478 {
480 }
481
482 const bool & ChestBoard_Button() const
483 {
485 }
486
487 void set_ChestBoard_Button(const bool &t_newValue)
488 {
490 }
491
492#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
496 SensorsBodySensors(const std::string &t_str) {
497 this->init();
498 this->from_string(t_str);
499 }
500
501 std::string description() {
502#ifdef USE_WB_SENSORS_BODY_SENSORS_C_CONVERSION
504 wb_sensors_body_sensors_description(this, buffer, sizeof(buffer));
505 std::string descr = buffer;
506 return descr;
507#else
508 std::ostringstream ss;
509 ss << "DCM_Time=" << static_cast<signed>(this->DCM_Time());
510 ss << ", ";
511 ss << "InertialSensor_AccX=" << this->InertialSensor_AccX();
512 ss << ", ";
513 ss << "InertialSensor_AccY=" << this->InertialSensor_AccY();
514 ss << ", ";
515 ss << "InertialSensor_AccZ=" << this->InertialSensor_AccZ();
516 ss << ", ";
517 ss << "InertialSensor_GyrX=" << this->InertialSensor_GyrX();
518 ss << ", ";
519 ss << "InertialSensor_GyrY=" << this->InertialSensor_GyrY();
520 ss << ", ";
521 ss << "InertialSensor_GyrZ=" << this->InertialSensor_GyrZ();
522 ss << ", ";
523 ss << "InertialSensor_AngleX=" << this->InertialSensor_AngleX();
524 ss << ", ";
525 ss << "InertialSensor_AngleY=" << this->InertialSensor_AngleY();
526 ss << ", ";
527 ss << "InertialSensor_AngleZ=" << this->InertialSensor_AngleZ();
528 ss << ", ";
529 ss << "InertialSensor_AccelerometerX=" << this->InertialSensor_AccelerometerX();
530 ss << ", ";
531 ss << "InertialSensor_AccelerometerY=" << this->InertialSensor_AccelerometerY();
532 ss << ", ";
533 ss << "InertialSensor_AccelerometerZ=" << this->InertialSensor_AccelerometerZ();
534 ss << ", ";
535 ss << "InertialSensor_GyroscopeX=" << this->InertialSensor_GyroscopeX();
536 ss << ", ";
537 ss << "InertialSensor_GyroscopeY=" << this->InertialSensor_GyroscopeY();
538 ss << ", ";
539 ss << "InertialSensor_GyroscopeZ=" << this->InertialSensor_GyroscopeZ();
540 ss << ", ";
541 ss << "Battery_Charge=" << static_cast<unsigned>(this->Battery_Charge());
542 ss << ", ";
543 ss << "Battery_Current=" << static_cast<unsigned>(this->Battery_Current());
544 ss << ", ";
545 ss << "US=" << this->US();
546 ss << ", ";
547 ss << "ChestBoard_Button=" << (this->ChestBoard_Button() ? "true" : "false");
548 return ss.str();
549#endif
550 }
551
552 std::string to_string() {
553#ifdef USE_WB_SENSORS_BODY_SENSORS_C_CONVERSION
555 wb_sensors_body_sensors_to_string(this, buffer, sizeof(buffer));
556 std::string toString = buffer;
557 return toString;
558#else
559 std::ostringstream ss;
560 ss << static_cast<signed>(this->DCM_Time());
561 ss << ", ";
562 ss << this->InertialSensor_AccX();
563 ss << ", ";
564 ss << this->InertialSensor_AccY();
565 ss << ", ";
566 ss << this->InertialSensor_AccZ();
567 ss << ", ";
568 ss << this->InertialSensor_GyrX();
569 ss << ", ";
570 ss << this->InertialSensor_GyrY();
571 ss << ", ";
572 ss << this->InertialSensor_GyrZ();
573 ss << ", ";
574 ss << this->InertialSensor_AngleX();
575 ss << ", ";
576 ss << this->InertialSensor_AngleY();
577 ss << ", ";
578 ss << this->InertialSensor_AngleZ();
579 ss << ", ";
580 ss << this->InertialSensor_AccelerometerX();
581 ss << ", ";
582 ss << this->InertialSensor_AccelerometerY();
583 ss << ", ";
584 ss << this->InertialSensor_AccelerometerZ();
585 ss << ", ";
586 ss << this->InertialSensor_GyroscopeX();
587 ss << ", ";
588 ss << this->InertialSensor_GyroscopeY();
589 ss << ", ";
590 ss << this->InertialSensor_GyroscopeZ();
591 ss << ", ";
592 ss << static_cast<unsigned>(this->Battery_Charge());
593 ss << ", ";
594 ss << static_cast<unsigned>(this->Battery_Current());
595 ss << ", ";
596 ss << this->US();
597 ss << ", ";
598 ss << (this->ChestBoard_Button() ? "true" : "false");
599 return ss.str();
600#endif
601 }
602
603#ifdef USE_WB_SENSORS_BODY_SENSORS_C_CONVERSION
604 void from_string(const std::string &t_str) {
605 wb_sensors_body_sensors_from_string(this, t_str.c_str());
606#else
607 void from_string(const std::string &t_str) {
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;
611 if (length < 1 || length > SENSORS_BODY_SENSORS_DESC_BUFFER_SIZE) {
612 return;
613 }
614 char var_str_buffer[SENSORS_BODY_SENSORS_DESC_BUFFER_SIZE + 1];
615 char* var_str = &var_str_buffer[0];
616 char key_buffer[30];
617 char* key = &key_buffer[0];
618 int bracecount = 0;
619 int startVar = 0;
620 int index = 0;
621 int startKey = 0;
622 int endKey = -1;
623 int varIndex = 0;
624 if (index == 0 && str_cstr[0] == '{') {
625 index = 1;
626 }
627 startVar = index;
628 startKey = startVar;
629 do {
630 for (int i = index; i < length; i++) {
631 index = i + 1;
632 if (bracecount == 0 && str_cstr[i] == '=') {
633 endKey = i - 1;
634 startVar = index;
635 continue;
636 }
637 if (bracecount == 0 && isspace(str_cstr[i])) {
638 startVar = index;
639 if (endKey == -1) {
640 startKey = index;
641 }
642 continue;
643 }
644 if (bracecount == 0 && str_cstr[i] == ',') {
645 index = i - 1;
646 break;
647 }
648 if (str_cstr[i] == '{') {
649 bracecount++;
650 continue;
651 }
652 if (str_cstr[i] == '}') {
653 bracecount--;
654 if (bracecount < 0) {
655 index = i - 1;
656 break;
657 }
658 }
659 if (i == length - 1) {
660 index = i;
661 }
662 }
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;
666 } else {
667 key[0] = 0;
668 }
669 strncpy(var_str, str_cstr + startVar, static_cast<size_t>((index - startVar) + 1));
670 var_str[(index - startVar) + 1] = 0;
671 bracecount = 0;
672 index += 2;
673 startVar = index;
674 startKey = startVar;
675 endKey = -1;
676 if (strlen(key) > 0) {
677 if (0 == strcmp("DCM_Time", key)) {
678 varIndex = 0;
679 } else if (0 == strcmp("InertialSensor_AccX", key)) {
680 varIndex = 1;
681 } else if (0 == strcmp("InertialSensor_AccY", key)) {
682 varIndex = 2;
683 } else if (0 == strcmp("InertialSensor_AccZ", key)) {
684 varIndex = 3;
685 } else if (0 == strcmp("InertialSensor_GyrX", key)) {
686 varIndex = 4;
687 } else if (0 == strcmp("InertialSensor_GyrY", key)) {
688 varIndex = 5;
689 } else if (0 == strcmp("InertialSensor_GyrZ", key)) {
690 varIndex = 6;
691 } else if (0 == strcmp("InertialSensor_AngleX", key)) {
692 varIndex = 7;
693 } else if (0 == strcmp("InertialSensor_AngleY", key)) {
694 varIndex = 8;
695 } else if (0 == strcmp("InertialSensor_AngleZ", key)) {
696 varIndex = 9;
697 } else if (0 == strcmp("InertialSensor_AccelerometerX", key)) {
698 varIndex = 10;
699 } else if (0 == strcmp("InertialSensor_AccelerometerY", key)) {
700 varIndex = 11;
701 } else if (0 == strcmp("InertialSensor_AccelerometerZ", key)) {
702 varIndex = 12;
703 } else if (0 == strcmp("InertialSensor_GyroscopeX", key)) {
704 varIndex = 13;
705 } else if (0 == strcmp("InertialSensor_GyroscopeY", key)) {
706 varIndex = 14;
707 } else if (0 == strcmp("InertialSensor_GyroscopeZ", key)) {
708 varIndex = 15;
709 } else if (0 == strcmp("Battery_Charge", key)) {
710 varIndex = 16;
711 } else if (0 == strcmp("Battery_Current", key)) {
712 varIndex = 17;
713 } else if (0 == strcmp("US", key)) {
714 varIndex = 18;
715 } else if (0 == strcmp("ChestBoard_Button", key)) {
716 varIndex = 19;
717 } else {
718 varIndex = -1;
719 }
720 }
721 switch (varIndex) {
722 case -1: { break; }
723 case 0:
724 {
725 this->set_DCM_Time(static_cast<signed int>(atoi(var_str)));
726 break;
727 }
728 case 1:
729 {
730 this->set_InertialSensor_AccX(static_cast<float>(atof(var_str)));
731 break;
732 }
733 case 2:
734 {
735 this->set_InertialSensor_AccY(static_cast<float>(atof(var_str)));
736 break;
737 }
738 case 3:
739 {
740 this->set_InertialSensor_AccZ(static_cast<float>(atof(var_str)));
741 break;
742 }
743 case 4:
744 {
745 this->set_InertialSensor_GyrX(static_cast<float>(atof(var_str)));
746 break;
747 }
748 case 5:
749 {
750 this->set_InertialSensor_GyrY(static_cast<float>(atof(var_str)));
751 break;
752 }
753 case 6:
754 {
755 this->set_InertialSensor_GyrZ(static_cast<float>(atof(var_str)));
756 break;
757 }
758 case 7:
759 {
760 this->set_InertialSensor_AngleX(static_cast<float>(atof(var_str)));
761 break;
762 }
763 case 8:
764 {
765 this->set_InertialSensor_AngleY(static_cast<float>(atof(var_str)));
766 break;
767 }
768 case 9:
769 {
770 this->set_InertialSensor_AngleZ(static_cast<float>(atof(var_str)));
771 break;
772 }
773 case 10:
774 {
775 this->set_InertialSensor_AccelerometerX(static_cast<float>(atof(var_str)));
776 break;
777 }
778 case 11:
779 {
780 this->set_InertialSensor_AccelerometerY(static_cast<float>(atof(var_str)));
781 break;
782 }
783 case 12:
784 {
785 this->set_InertialSensor_AccelerometerZ(static_cast<float>(atof(var_str)));
786 break;
787 }
788 case 13:
789 {
790 this->set_InertialSensor_GyroscopeX(static_cast<float>(atof(var_str)));
791 break;
792 }
793 case 14:
794 {
795 this->set_InertialSensor_GyroscopeY(static_cast<float>(atof(var_str)));
796 break;
797 }
798 case 15:
799 {
800 this->set_InertialSensor_GyroscopeZ(static_cast<float>(atof(var_str)));
801 break;
802 }
803 case 16:
804 {
805 this->set_Battery_Charge(static_cast<uint8_t>(atoi(var_str)));
806 break;
807 }
808 case 17:
809 {
810 this->set_Battery_Current(static_cast<uint8_t>(atoi(var_str)));
811 break;
812 }
813 case 18:
814 {
815 this->set_US(static_cast<float>(atof(var_str)));
816 break;
817 }
818 case 19:
819 {
820 this->set_ChestBoard_Button(strcmp(var_str, "true") == 0 || strcmp(var_str, "1") == 0);
821 break;
822 }
823 }
824 if (varIndex >= 0) {
825 varIndex++;
826 }
827 } while(index < length);
828#endif
829 }
830#endif
831 };
832
833}
834
835#endif
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)
const float & InertialSensor_AngleY() const
void set_InertialSensor_AccelerometerY(const float &t_newValue)
const signed int & DCM_Time() const
void set_InertialSensor_GyroscopeY(const float &t_newValue)
void set_InertialSensor_AccZ(const float &t_newValue)
void set_InertialSensor_GyroscopeX(const float &t_newValue)
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)
const float & InertialSensor_AccZ() const
const float & InertialSensor_GyroscopeY() const
bool operator==(const SensorsBodySensors &t_other) const
const float & InertialSensor_AccelerometerZ() const
const float & InertialSensor_AccX() const
const float & InertialSensor_GyroscopeX() const
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
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.
const float & InertialSensor_AccelerometerX() const
void set_InertialSensor_AngleX(const float &t_newValue)
const float & InertialSensor_GyrZ() const
void set_InertialSensor_GyrY(const float &t_newValue)
const float & InertialSensor_AngleX() const
const float & InertialSensor_AngleZ() const
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
void from_string(const std::string &t_str)
void set_InertialSensor_AccX(const float &t_newValue)
/file APM_Interface.h
WHITEBOARD_POSTER_STRING_CONVERSION.
float InertialSensor_GyroscopeY
new Gyro Y value
float InertialSensor_GyrZ
gyro Z value (Nao V5 have a Z axis)
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....
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