gusimplewhiteboard
SensorsFootSensors.hpp
Go to the documentation of this file.
1/*
2 * file SensorsFootSensors.hpp
3 *
4 * This file was generated by classgenerator from sensors_foot_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_SensorsFootSensors_h
61#define guWhiteboard_SensorsFootSensors_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_SensorsFootSensors_DEFINED
74#define guWhiteboard_SensorsFootSensors_DEFINED
75
76#undef SensorsFootSensors_DEFINED
77#define SensorsFootSensors_DEFINED
78
79namespace guWhiteboard {
80
85
86 private:
87
91 void init(float t_LFoot_FSR_FrontLeft = 0.0f, float t_LFoot_FSR_FrontRight = 0.0f, float t_LFoot_FSR_RearLeft = 0.0f, float t_LFoot_FSR_RearRight = 0.0f, float t_LFoot_FSR_CenterOfPressure_X = 0.0f, float t_LFoot_FSR_CenterOfPressure_Y = 0.0f, float t_LFoot_FSR_TotalWeight = 0.0f, float t_RFoot_FSR_FrontLeft = 0.0f, float t_RFoot_FSR_FrontRight = 0.0f, float t_RFoot_FSR_RearLeft = 0.0f, float t_RFoot_FSR_RearRight = 0.0f, float t_RFoot_FSR_CenterOfPressure_X = 0.0f, float t_RFoot_FSR_CenterOfPressure_Y = 0.0f, float t_RFoot_FSR_TotalWeight = 0.0f, bool t_LFoot_Bumper_Left = true, bool t_LFoot_Bumper_Right = true, bool t_RFoot_Bumper_Left = true, bool t_RFoot_Bumper_Right = true) {
92 set_LFoot_FSR_FrontLeft(t_LFoot_FSR_FrontLeft);
93 set_LFoot_FSR_FrontRight(t_LFoot_FSR_FrontRight);
94 set_LFoot_FSR_RearLeft(t_LFoot_FSR_RearLeft);
95 set_LFoot_FSR_RearRight(t_LFoot_FSR_RearRight);
96 set_LFoot_FSR_CenterOfPressure_X(t_LFoot_FSR_CenterOfPressure_X);
97 set_LFoot_FSR_CenterOfPressure_Y(t_LFoot_FSR_CenterOfPressure_Y);
98 set_LFoot_FSR_TotalWeight(t_LFoot_FSR_TotalWeight);
99 set_RFoot_FSR_FrontLeft(t_RFoot_FSR_FrontLeft);
100 set_RFoot_FSR_FrontRight(t_RFoot_FSR_FrontRight);
101 set_RFoot_FSR_RearLeft(t_RFoot_FSR_RearLeft);
102 set_RFoot_FSR_RearRight(t_RFoot_FSR_RearRight);
103 set_RFoot_FSR_CenterOfPressure_X(t_RFoot_FSR_CenterOfPressure_X);
104 set_RFoot_FSR_CenterOfPressure_Y(t_RFoot_FSR_CenterOfPressure_Y);
105 set_RFoot_FSR_TotalWeight(t_RFoot_FSR_TotalWeight);
106 set_LFoot_Bumper_Left(t_LFoot_Bumper_Left);
107 set_LFoot_Bumper_Right(t_LFoot_Bumper_Right);
108 set_RFoot_Bumper_Left(t_RFoot_Bumper_Left);
109 set_RFoot_Bumper_Right(t_RFoot_Bumper_Right);
110 }
111
112 public:
113
117 SensorsFootSensors(float t_LFoot_FSR_FrontLeft = 0.0f, float t_LFoot_FSR_FrontRight = 0.0f, float t_LFoot_FSR_RearLeft = 0.0f, float t_LFoot_FSR_RearRight = 0.0f, float t_LFoot_FSR_CenterOfPressure_X = 0.0f, float t_LFoot_FSR_CenterOfPressure_Y = 0.0f, float t_LFoot_FSR_TotalWeight = 0.0f, float t_RFoot_FSR_FrontLeft = 0.0f, float t_RFoot_FSR_FrontRight = 0.0f, float t_RFoot_FSR_RearLeft = 0.0f, float t_RFoot_FSR_RearRight = 0.0f, float t_RFoot_FSR_CenterOfPressure_X = 0.0f, float t_RFoot_FSR_CenterOfPressure_Y = 0.0f, float t_RFoot_FSR_TotalWeight = 0.0f, bool t_LFoot_Bumper_Left = true, bool t_LFoot_Bumper_Right = true, bool t_RFoot_Bumper_Left = true, bool t_RFoot_Bumper_Right = true) {
118 this->init(t_LFoot_FSR_FrontLeft, t_LFoot_FSR_FrontRight, t_LFoot_FSR_RearLeft, t_LFoot_FSR_RearRight, t_LFoot_FSR_CenterOfPressure_X, t_LFoot_FSR_CenterOfPressure_Y, t_LFoot_FSR_TotalWeight, t_RFoot_FSR_FrontLeft, t_RFoot_FSR_FrontRight, t_RFoot_FSR_RearLeft, t_RFoot_FSR_RearRight, t_RFoot_FSR_CenterOfPressure_X, t_RFoot_FSR_CenterOfPressure_Y, t_RFoot_FSR_TotalWeight, t_LFoot_Bumper_Left, t_LFoot_Bumper_Right, t_RFoot_Bumper_Left, t_RFoot_Bumper_Right);
119 }
120
126 }
127
133 }
134
140 return *this;
141 }
142
148 return *this;
149 }
150
151 bool operator ==(const SensorsFootSensors &t_other) const
152 {
153 return fabsf(LFoot_FSR_FrontLeft() - t_other.LFoot_FSR_FrontLeft()) < FLT_EPSILON
154 && fabsf(LFoot_FSR_FrontRight() - t_other.LFoot_FSR_FrontRight()) < FLT_EPSILON
155 && fabsf(LFoot_FSR_RearLeft() - t_other.LFoot_FSR_RearLeft()) < FLT_EPSILON
156 && fabsf(LFoot_FSR_RearRight() - t_other.LFoot_FSR_RearRight()) < FLT_EPSILON
157 && fabsf(LFoot_FSR_CenterOfPressure_X() - t_other.LFoot_FSR_CenterOfPressure_X()) < FLT_EPSILON
158 && fabsf(LFoot_FSR_CenterOfPressure_Y() - t_other.LFoot_FSR_CenterOfPressure_Y()) < FLT_EPSILON
159 && fabsf(LFoot_FSR_TotalWeight() - t_other.LFoot_FSR_TotalWeight()) < FLT_EPSILON
160 && fabsf(RFoot_FSR_FrontLeft() - t_other.RFoot_FSR_FrontLeft()) < FLT_EPSILON
161 && fabsf(RFoot_FSR_FrontRight() - t_other.RFoot_FSR_FrontRight()) < FLT_EPSILON
162 && fabsf(RFoot_FSR_RearLeft() - t_other.RFoot_FSR_RearLeft()) < FLT_EPSILON
163 && fabsf(RFoot_FSR_RearRight() - t_other.RFoot_FSR_RearRight()) < FLT_EPSILON
164 && fabsf(RFoot_FSR_CenterOfPressure_X() - t_other.RFoot_FSR_CenterOfPressure_X()) < FLT_EPSILON
165 && fabsf(RFoot_FSR_CenterOfPressure_Y() - t_other.RFoot_FSR_CenterOfPressure_Y()) < FLT_EPSILON
166 && fabsf(RFoot_FSR_TotalWeight() - t_other.RFoot_FSR_TotalWeight()) < FLT_EPSILON
167 && LFoot_Bumper_Left() == t_other.LFoot_Bumper_Left()
168 && LFoot_Bumper_Right() == t_other.LFoot_Bumper_Right()
169 && RFoot_Bumper_Left() == t_other.RFoot_Bumper_Left()
170 && RFoot_Bumper_Right() == t_other.RFoot_Bumper_Right();
171 }
172
173 bool operator !=(const SensorsFootSensors &t_other) const
174 {
175 return !(*this == t_other);
176 }
177
178 bool operator ==(const wb_sensors_foot_sensors &t_other) const
179 {
180 return *this == SensorsFootSensors(t_other);
181 }
182
183 bool operator !=(const wb_sensors_foot_sensors &t_other) const
184 {
185 return !(*this == t_other);
186 }
187
189 {
191 }
192
193 const float & LFoot_FSR_FrontLeft() const
194 {
196 }
197
198 void set_LFoot_FSR_FrontLeft(const float &t_newValue)
199 {
201 }
202
204 {
206 }
207
208 const float & LFoot_FSR_FrontRight() const
209 {
211 }
212
213 void set_LFoot_FSR_FrontRight(const float &t_newValue)
214 {
216 }
217
219 {
221 }
222
223 const float & LFoot_FSR_RearLeft() const
224 {
226 }
227
228 void set_LFoot_FSR_RearLeft(const float &t_newValue)
229 {
231 }
232
234 {
236 }
237
238 const float & LFoot_FSR_RearRight() const
239 {
241 }
242
243 void set_LFoot_FSR_RearRight(const float &t_newValue)
244 {
246 }
247
249 {
251 }
252
253 const float & LFoot_FSR_CenterOfPressure_X() const
254 {
256 }
257
258 void set_LFoot_FSR_CenterOfPressure_X(const float &t_newValue)
259 {
261 }
262
264 {
266 }
267
268 const float & LFoot_FSR_CenterOfPressure_Y() const
269 {
271 }
272
273 void set_LFoot_FSR_CenterOfPressure_Y(const float &t_newValue)
274 {
276 }
277
279 {
281 }
282
283 const float & LFoot_FSR_TotalWeight() const
284 {
286 }
287
288 void set_LFoot_FSR_TotalWeight(const float &t_newValue)
289 {
291 }
292
294 {
296 }
297
298 const float & RFoot_FSR_FrontLeft() const
299 {
301 }
302
303 void set_RFoot_FSR_FrontLeft(const float &t_newValue)
304 {
306 }
307
309 {
311 }
312
313 const float & RFoot_FSR_FrontRight() const
314 {
316 }
317
318 void set_RFoot_FSR_FrontRight(const float &t_newValue)
319 {
321 }
322
324 {
326 }
327
328 const float & RFoot_FSR_RearLeft() const
329 {
331 }
332
333 void set_RFoot_FSR_RearLeft(const float &t_newValue)
334 {
336 }
337
339 {
341 }
342
343 const float & RFoot_FSR_RearRight() const
344 {
346 }
347
348 void set_RFoot_FSR_RearRight(const float &t_newValue)
349 {
351 }
352
354 {
356 }
357
358 const float & RFoot_FSR_CenterOfPressure_X() const
359 {
361 }
362
363 void set_RFoot_FSR_CenterOfPressure_X(const float &t_newValue)
364 {
366 }
367
369 {
371 }
372
373 const float & RFoot_FSR_CenterOfPressure_Y() const
374 {
376 }
377
378 void set_RFoot_FSR_CenterOfPressure_Y(const float &t_newValue)
379 {
381 }
382
384 {
386 }
387
388 const float & RFoot_FSR_TotalWeight() const
389 {
391 }
392
393 void set_RFoot_FSR_TotalWeight(const float &t_newValue)
394 {
396 }
397
399 {
401 }
402
403 const bool & LFoot_Bumper_Left() const
404 {
406 }
407
408 void set_LFoot_Bumper_Left(const bool &t_newValue)
409 {
411 }
412
414 {
416 }
417
418 const bool & LFoot_Bumper_Right() const
419 {
421 }
422
423 void set_LFoot_Bumper_Right(const bool &t_newValue)
424 {
426 }
427
429 {
431 }
432
433 const bool & RFoot_Bumper_Left() const
434 {
436 }
437
438 void set_RFoot_Bumper_Left(const bool &t_newValue)
439 {
441 }
442
444 {
446 }
447
448 const bool & RFoot_Bumper_Right() const
449 {
451 }
452
453 void set_RFoot_Bumper_Right(const bool &t_newValue)
454 {
456 }
457
458#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
462 SensorsFootSensors(const std::string &t_str) {
463 this->init();
464 this->from_string(t_str);
465 }
466
467 std::string description() {
468#ifdef USE_WB_SENSORS_FOOT_SENSORS_C_CONVERSION
470 wb_sensors_foot_sensors_description(this, buffer, sizeof(buffer));
471 std::string descr = buffer;
472 return descr;
473#else
474 std::ostringstream ss;
475 ss << "LFoot_FSR_FrontLeft=" << this->LFoot_FSR_FrontLeft();
476 ss << ", ";
477 ss << "LFoot_FSR_FrontRight=" << this->LFoot_FSR_FrontRight();
478 ss << ", ";
479 ss << "LFoot_FSR_RearLeft=" << this->LFoot_FSR_RearLeft();
480 ss << ", ";
481 ss << "LFoot_FSR_RearRight=" << this->LFoot_FSR_RearRight();
482 ss << ", ";
483 ss << "LFoot_FSR_CenterOfPressure_X=" << this->LFoot_FSR_CenterOfPressure_X();
484 ss << ", ";
485 ss << "LFoot_FSR_CenterOfPressure_Y=" << this->LFoot_FSR_CenterOfPressure_Y();
486 ss << ", ";
487 ss << "LFoot_FSR_TotalWeight=" << this->LFoot_FSR_TotalWeight();
488 ss << ", ";
489 ss << "RFoot_FSR_FrontLeft=" << this->RFoot_FSR_FrontLeft();
490 ss << ", ";
491 ss << "RFoot_FSR_FrontRight=" << this->RFoot_FSR_FrontRight();
492 ss << ", ";
493 ss << "RFoot_FSR_RearLeft=" << this->RFoot_FSR_RearLeft();
494 ss << ", ";
495 ss << "RFoot_FSR_RearRight=" << this->RFoot_FSR_RearRight();
496 ss << ", ";
497 ss << "RFoot_FSR_CenterOfPressure_X=" << this->RFoot_FSR_CenterOfPressure_X();
498 ss << ", ";
499 ss << "RFoot_FSR_CenterOfPressure_Y=" << this->RFoot_FSR_CenterOfPressure_Y();
500 ss << ", ";
501 ss << "RFoot_FSR_TotalWeight=" << this->RFoot_FSR_TotalWeight();
502 ss << ", ";
503 ss << "LFoot_Bumper_Left=" << (this->LFoot_Bumper_Left() ? "true" : "false");
504 ss << ", ";
505 ss << "LFoot_Bumper_Right=" << (this->LFoot_Bumper_Right() ? "true" : "false");
506 ss << ", ";
507 ss << "RFoot_Bumper_Left=" << (this->RFoot_Bumper_Left() ? "true" : "false");
508 ss << ", ";
509 ss << "RFoot_Bumper_Right=" << (this->RFoot_Bumper_Right() ? "true" : "false");
510 return ss.str();
511#endif
512 }
513
514 std::string to_string() {
515#ifdef USE_WB_SENSORS_FOOT_SENSORS_C_CONVERSION
517 wb_sensors_foot_sensors_to_string(this, buffer, sizeof(buffer));
518 std::string toString = buffer;
519 return toString;
520#else
521 std::ostringstream ss;
522 ss << this->LFoot_FSR_FrontLeft();
523 ss << ", ";
524 ss << this->LFoot_FSR_FrontRight();
525 ss << ", ";
526 ss << this->LFoot_FSR_RearLeft();
527 ss << ", ";
528 ss << this->LFoot_FSR_RearRight();
529 ss << ", ";
530 ss << this->LFoot_FSR_CenterOfPressure_X();
531 ss << ", ";
532 ss << this->LFoot_FSR_CenterOfPressure_Y();
533 ss << ", ";
534 ss << this->LFoot_FSR_TotalWeight();
535 ss << ", ";
536 ss << this->RFoot_FSR_FrontLeft();
537 ss << ", ";
538 ss << this->RFoot_FSR_FrontRight();
539 ss << ", ";
540 ss << this->RFoot_FSR_RearLeft();
541 ss << ", ";
542 ss << this->RFoot_FSR_RearRight();
543 ss << ", ";
544 ss << this->RFoot_FSR_CenterOfPressure_X();
545 ss << ", ";
546 ss << this->RFoot_FSR_CenterOfPressure_Y();
547 ss << ", ";
548 ss << this->RFoot_FSR_TotalWeight();
549 ss << ", ";
550 ss << (this->LFoot_Bumper_Left() ? "true" : "false");
551 ss << ", ";
552 ss << (this->LFoot_Bumper_Right() ? "true" : "false");
553 ss << ", ";
554 ss << (this->RFoot_Bumper_Left() ? "true" : "false");
555 ss << ", ";
556 ss << (this->RFoot_Bumper_Right() ? "true" : "false");
557 return ss.str();
558#endif
559 }
560
561#ifdef USE_WB_SENSORS_FOOT_SENSORS_C_CONVERSION
562 void from_string(const std::string &t_str) {
563 wb_sensors_foot_sensors_from_string(this, t_str.c_str());
564#else
565 void from_string(const std::string &t_str) {
566 char * str_cstr = const_cast<char *>(t_str.c_str());
567 size_t temp_length = strlen(str_cstr);
568 int length = (temp_length <= INT_MAX) ? static_cast<int>(static_cast<ssize_t>(temp_length)) : -1;
569 if (length < 1 || length > SENSORS_FOOT_SENSORS_DESC_BUFFER_SIZE) {
570 return;
571 }
572 char var_str_buffer[SENSORS_FOOT_SENSORS_DESC_BUFFER_SIZE + 1];
573 char* var_str = &var_str_buffer[0];
574 char key_buffer[29];
575 char* key = &key_buffer[0];
576 int bracecount = 0;
577 int startVar = 0;
578 int index = 0;
579 int startKey = 0;
580 int endKey = -1;
581 int varIndex = 0;
582 if (index == 0 && str_cstr[0] == '{') {
583 index = 1;
584 }
585 startVar = index;
586 startKey = startVar;
587 do {
588 for (int i = index; i < length; i++) {
589 index = i + 1;
590 if (bracecount == 0 && str_cstr[i] == '=') {
591 endKey = i - 1;
592 startVar = index;
593 continue;
594 }
595 if (bracecount == 0 && isspace(str_cstr[i])) {
596 startVar = index;
597 if (endKey == -1) {
598 startKey = index;
599 }
600 continue;
601 }
602 if (bracecount == 0 && str_cstr[i] == ',') {
603 index = i - 1;
604 break;
605 }
606 if (str_cstr[i] == '{') {
607 bracecount++;
608 continue;
609 }
610 if (str_cstr[i] == '}') {
611 bracecount--;
612 if (bracecount < 0) {
613 index = i - 1;
614 break;
615 }
616 }
617 if (i == length - 1) {
618 index = i;
619 }
620 }
621 if (endKey >= startKey && endKey - startKey < length) {
622 strncpy(key, str_cstr + startKey, static_cast<size_t>((endKey - startKey) + 1));
623 key[(endKey - startKey) + 1] = 0;
624 } else {
625 key[0] = 0;
626 }
627 strncpy(var_str, str_cstr + startVar, static_cast<size_t>((index - startVar) + 1));
628 var_str[(index - startVar) + 1] = 0;
629 bracecount = 0;
630 index += 2;
631 startVar = index;
632 startKey = startVar;
633 endKey = -1;
634 if (strlen(key) > 0) {
635 if (0 == strcmp("LFoot_FSR_FrontLeft", key)) {
636 varIndex = 0;
637 } else if (0 == strcmp("LFoot_FSR_FrontRight", key)) {
638 varIndex = 1;
639 } else if (0 == strcmp("LFoot_FSR_RearLeft", key)) {
640 varIndex = 2;
641 } else if (0 == strcmp("LFoot_FSR_RearRight", key)) {
642 varIndex = 3;
643 } else if (0 == strcmp("LFoot_FSR_CenterOfPressure_X", key)) {
644 varIndex = 4;
645 } else if (0 == strcmp("LFoot_FSR_CenterOfPressure_Y", key)) {
646 varIndex = 5;
647 } else if (0 == strcmp("LFoot_FSR_TotalWeight", key)) {
648 varIndex = 6;
649 } else if (0 == strcmp("RFoot_FSR_FrontLeft", key)) {
650 varIndex = 7;
651 } else if (0 == strcmp("RFoot_FSR_FrontRight", key)) {
652 varIndex = 8;
653 } else if (0 == strcmp("RFoot_FSR_RearLeft", key)) {
654 varIndex = 9;
655 } else if (0 == strcmp("RFoot_FSR_RearRight", key)) {
656 varIndex = 10;
657 } else if (0 == strcmp("RFoot_FSR_CenterOfPressure_X", key)) {
658 varIndex = 11;
659 } else if (0 == strcmp("RFoot_FSR_CenterOfPressure_Y", key)) {
660 varIndex = 12;
661 } else if (0 == strcmp("RFoot_FSR_TotalWeight", key)) {
662 varIndex = 13;
663 } else if (0 == strcmp("LFoot_Bumper_Left", key)) {
664 varIndex = 14;
665 } else if (0 == strcmp("LFoot_Bumper_Right", key)) {
666 varIndex = 15;
667 } else if (0 == strcmp("RFoot_Bumper_Left", key)) {
668 varIndex = 16;
669 } else if (0 == strcmp("RFoot_Bumper_Right", key)) {
670 varIndex = 17;
671 } else {
672 varIndex = -1;
673 }
674 }
675 switch (varIndex) {
676 case -1: { break; }
677 case 0:
678 {
679 this->set_LFoot_FSR_FrontLeft(static_cast<float>(atof(var_str)));
680 break;
681 }
682 case 1:
683 {
684 this->set_LFoot_FSR_FrontRight(static_cast<float>(atof(var_str)));
685 break;
686 }
687 case 2:
688 {
689 this->set_LFoot_FSR_RearLeft(static_cast<float>(atof(var_str)));
690 break;
691 }
692 case 3:
693 {
694 this->set_LFoot_FSR_RearRight(static_cast<float>(atof(var_str)));
695 break;
696 }
697 case 4:
698 {
699 this->set_LFoot_FSR_CenterOfPressure_X(static_cast<float>(atof(var_str)));
700 break;
701 }
702 case 5:
703 {
704 this->set_LFoot_FSR_CenterOfPressure_Y(static_cast<float>(atof(var_str)));
705 break;
706 }
707 case 6:
708 {
709 this->set_LFoot_FSR_TotalWeight(static_cast<float>(atof(var_str)));
710 break;
711 }
712 case 7:
713 {
714 this->set_RFoot_FSR_FrontLeft(static_cast<float>(atof(var_str)));
715 break;
716 }
717 case 8:
718 {
719 this->set_RFoot_FSR_FrontRight(static_cast<float>(atof(var_str)));
720 break;
721 }
722 case 9:
723 {
724 this->set_RFoot_FSR_RearLeft(static_cast<float>(atof(var_str)));
725 break;
726 }
727 case 10:
728 {
729 this->set_RFoot_FSR_RearRight(static_cast<float>(atof(var_str)));
730 break;
731 }
732 case 11:
733 {
734 this->set_RFoot_FSR_CenterOfPressure_X(static_cast<float>(atof(var_str)));
735 break;
736 }
737 case 12:
738 {
739 this->set_RFoot_FSR_CenterOfPressure_Y(static_cast<float>(atof(var_str)));
740 break;
741 }
742 case 13:
743 {
744 this->set_RFoot_FSR_TotalWeight(static_cast<float>(atof(var_str)));
745 break;
746 }
747 case 14:
748 {
749 this->set_LFoot_Bumper_Left(strcmp(var_str, "true") == 0 || strcmp(var_str, "1") == 0);
750 break;
751 }
752 case 15:
753 {
754 this->set_LFoot_Bumper_Right(strcmp(var_str, "true") == 0 || strcmp(var_str, "1") == 0);
755 break;
756 }
757 case 16:
758 {
759 this->set_RFoot_Bumper_Left(strcmp(var_str, "true") == 0 || strcmp(var_str, "1") == 0);
760 break;
761 }
762 case 17:
763 {
764 this->set_RFoot_Bumper_Right(strcmp(var_str, "true") == 0 || strcmp(var_str, "1") == 0);
765 break;
766 }
767 }
768 if (varIndex >= 0) {
769 varIndex++;
770 }
771 } while(index < length);
772#endif
773 }
774#endif
775 };
776
777}
778
779#endif
Provides a C++ wrapper around wb_sensors_foot_sensors.
void set_LFoot_FSR_TotalWeight(const float &t_newValue)
void set_RFoot_FSR_FrontRight(const float &t_newValue)
const float & RFoot_FSR_FrontRight() const
const float & LFoot_FSR_FrontRight() const
void set_RFoot_FSR_TotalWeight(const float &t_newValue)
void set_RFoot_FSR_CenterOfPressure_X(const float &t_newValue)
SensorsFootSensors & operator=(const SensorsFootSensors &t_other)
Copy Assignment Operator.
void set_LFoot_FSR_FrontRight(const float &t_newValue)
void set_RFoot_Bumper_Right(const bool &t_newValue)
const float & LFoot_FSR_CenterOfPressure_Y() const
const float & RFoot_FSR_TotalWeight() const
void set_LFoot_FSR_FrontLeft(const float &t_newValue)
const float & LFoot_FSR_RearRight() const
const float & RFoot_FSR_CenterOfPressure_Y() const
void set_LFoot_FSR_RearLeft(const float &t_newValue)
void set_LFoot_FSR_RearRight(const float &t_newValue)
void set_LFoot_FSR_CenterOfPressure_Y(const float &t_newValue)
const float & LFoot_FSR_CenterOfPressure_X() const
SensorsFootSensors(const SensorsFootSensors &t_other)
Copy Constructor.
const float & LFoot_FSR_RearLeft() const
const float & LFoot_FSR_TotalWeight() const
void set_LFoot_Bumper_Left(const bool &t_newValue)
void set_RFoot_FSR_RearLeft(const float &t_newValue)
bool operator==(const SensorsFootSensors &t_other) const
const float & RFoot_FSR_RearRight() const
SensorsFootSensors(float t_LFoot_FSR_FrontLeft=0.0f, float t_LFoot_FSR_FrontRight=0.0f, float t_LFoot_FSR_RearLeft=0.0f, float t_LFoot_FSR_RearRight=0.0f, float t_LFoot_FSR_CenterOfPressure_X=0.0f, float t_LFoot_FSR_CenterOfPressure_Y=0.0f, float t_LFoot_FSR_TotalWeight=0.0f, float t_RFoot_FSR_FrontLeft=0.0f, float t_RFoot_FSR_FrontRight=0.0f, float t_RFoot_FSR_RearLeft=0.0f, float t_RFoot_FSR_RearRight=0.0f, float t_RFoot_FSR_CenterOfPressure_X=0.0f, float t_RFoot_FSR_CenterOfPressure_Y=0.0f, float t_RFoot_FSR_TotalWeight=0.0f, bool t_LFoot_Bumper_Left=true, bool t_LFoot_Bumper_Right=true, bool t_RFoot_Bumper_Left=true, bool t_RFoot_Bumper_Right=true)
Create a new SensorsFootSensors.
SensorsFootSensors(const struct wb_sensors_foot_sensors &t_other)
Copy Constructor.
void set_RFoot_Bumper_Left(const bool &t_newValue)
SensorsFootSensors(const std::string &t_str)
String Constructor.
const float & RFoot_FSR_FrontLeft() const
const float & LFoot_FSR_FrontLeft() const
bool operator!=(const SensorsFootSensors &t_other) const
void set_RFoot_FSR_RearRight(const float &t_newValue)
void from_string(const std::string &t_str)
const float & RFoot_FSR_CenterOfPressure_X() const
void set_RFoot_FSR_FrontLeft(const float &t_newValue)
void set_LFoot_Bumper_Right(const bool &t_newValue)
void set_LFoot_FSR_CenterOfPressure_X(const float &t_newValue)
const float & RFoot_FSR_RearLeft() const
void set_RFoot_FSR_CenterOfPressure_Y(const float &t_newValue)
/file APM_Interface.h
WHITEBOARD_POSTER_STRING_CONVERSION.
bool LFoot_Bumper_Left
left bumper on the left foot (on / off)
float RFoot_FSR_FrontLeft
front left force sensor on the right foot
bool LFoot_Bumper_Right
right bumper on the left foot (on / off)
float LFoot_FSR_RearLeft
rear left force sensor on the left foot
float RFoot_FSR_RearRight
rear right force sensor on the right foot
bool RFoot_Bumper_Right
right bumper on the right foot (on / off)
float RFoot_FSR_FrontRight
front right force sensor on the right foot
float LFoot_FSR_CenterOfPressure_X
left foot center of pressure X
float LFoot_FSR_FrontLeft
front left force sensor on the left foot
float RFoot_FSR_CenterOfPressure_Y
right foot center of pressure Y
float LFoot_FSR_FrontRight
front right force sensor on the left foot
float LFoot_FSR_CenterOfPressure_Y
left foot center of pressure Y
bool RFoot_Bumper_Left
left bumper on the right foot (on / off)
float LFoot_FSR_TotalWeight
Total weight on left foot (kg)
float RFoot_FSR_TotalWeight
Total weight right foot (kg)
float RFoot_FSR_RearLeft
rear left force sensor on the right foot
float RFoot_FSR_CenterOfPressure_X
right foot center of pressure X
float LFoot_FSR_RearRight
rear right force sensor on the left foot
const char * wb_sensors_foot_sensors_to_string(const struct wb_sensors_foot_sensors *self, char *toString, size_t bufferSize)
Convert to a string.
const char * wb_sensors_foot_sensors_description(const struct wb_sensors_foot_sensors *self, char *descString, size_t bufferSize)
Convert to a description string.
struct wb_sensors_foot_sensors * wb_sensors_foot_sensors_from_string(struct wb_sensors_foot_sensors *self, const char *str)
Convert from a string.
#define SENSORS_FOOT_SENSORS_TO_STRING_BUFFER_SIZE
#define SENSORS_FOOT_SENSORS_DESC_BUFFER_SIZE