gusimplewhiteboard
NaoJointListFloat.hpp
Go to the documentation of this file.
1/*
2 * file NaoJointListFloat.hpp
3 *
4 * This file was generated by classgenerator from nao_joint_list_float.gen.
5 * DO NOT CHANGE MANUALLY!
6 *
7 * Copyright © 2021 Dimitri Joukoff. 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 Dimitri Joukoff.
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_NaoJointListFloat_h
61#define guWhiteboard_NaoJointListFloat_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_NaoJointListFloat_DEFINED
74#define guWhiteboard_NaoJointListFloat_DEFINED
75
76#undef NaoJointListFloat_DEFINED
77#define NaoJointListFloat_DEFINED
78
79namespace guWhiteboard {
80
85
86 private:
87
91 void init(float t_HeadYaw = 0.0f, float t_HeadPitch = 0.0f, float t_LShoulderPitch = 0.0f, float t_LShoulderRoll = 0.0f, float t_LElbowYaw = 0.0f, float t_LElbowRoll = 0.0f, float t_LWristYaw = 0.0f, float t_LHand = 0.0f, float t_RShoulderPitch = 0.0f, float t_RShoulderRoll = 0.0f, float t_RElbowYaw = 0.0f, float t_RElbowRoll = 0.0f, float t_RWristYaw = 0.0f, float t_RHand = 0.0f, float t_LHipYawPitch = 0.0f, float t_LHipRoll = 0.0f, float t_LHipPitch = 0.0f, float t_LKneePitch = 0.0f, float t_LAnklePitch = 0.0f, float t_LAnkleRoll = 0.0f, float t_RHipRoll = 0.0f, float t_RHipPitch = 0.0f, float t_RKneePitch = 0.0f, float t_RAnklePitch = 0.0f, float t_RAnkleRoll = 0.0f) {
92 set_HeadYaw(t_HeadYaw);
93 set_HeadPitch(t_HeadPitch);
94 set_LShoulderPitch(t_LShoulderPitch);
95 set_LShoulderRoll(t_LShoulderRoll);
96 set_LElbowYaw(t_LElbowYaw);
97 set_LElbowRoll(t_LElbowRoll);
98 set_LWristYaw(t_LWristYaw);
99 set_LHand(t_LHand);
100 set_RShoulderPitch(t_RShoulderPitch);
101 set_RShoulderRoll(t_RShoulderRoll);
102 set_RElbowYaw(t_RElbowYaw);
103 set_RElbowRoll(t_RElbowRoll);
104 set_RWristYaw(t_RWristYaw);
105 set_RHand(t_RHand);
106 set_LHipYawPitch(t_LHipYawPitch);
107 set_LHipRoll(t_LHipRoll);
108 set_LHipPitch(t_LHipPitch);
109 set_LKneePitch(t_LKneePitch);
110 set_LAnklePitch(t_LAnklePitch);
111 set_LAnkleRoll(t_LAnkleRoll);
112 set_RHipRoll(t_RHipRoll);
113 set_RHipPitch(t_RHipPitch);
114 set_RKneePitch(t_RKneePitch);
115 set_RAnklePitch(t_RAnklePitch);
116 set_RAnkleRoll(t_RAnkleRoll);
117 }
118
119 public:
120
124 NaoJointListFloat(float t_HeadYaw = 0.0f, float t_HeadPitch = 0.0f, float t_LShoulderPitch = 0.0f, float t_LShoulderRoll = 0.0f, float t_LElbowYaw = 0.0f, float t_LElbowRoll = 0.0f, float t_LWristYaw = 0.0f, float t_LHand = 0.0f, float t_RShoulderPitch = 0.0f, float t_RShoulderRoll = 0.0f, float t_RElbowYaw = 0.0f, float t_RElbowRoll = 0.0f, float t_RWristYaw = 0.0f, float t_RHand = 0.0f, float t_LHipYawPitch = 0.0f, float t_LHipRoll = 0.0f, float t_LHipPitch = 0.0f, float t_LKneePitch = 0.0f, float t_LAnklePitch = 0.0f, float t_LAnkleRoll = 0.0f, float t_RHipRoll = 0.0f, float t_RHipPitch = 0.0f, float t_RKneePitch = 0.0f, float t_RAnklePitch = 0.0f, float t_RAnkleRoll = 0.0f) {
125 this->init(t_HeadYaw, t_HeadPitch, t_LShoulderPitch, t_LShoulderRoll, t_LElbowYaw, t_LElbowRoll, t_LWristYaw, t_LHand, t_RShoulderPitch, t_RShoulderRoll, t_RElbowYaw, t_RElbowRoll, t_RWristYaw, t_RHand, t_LHipYawPitch, t_LHipRoll, t_LHipPitch, t_LKneePitch, t_LAnklePitch, t_LAnkleRoll, t_RHipRoll, t_RHipPitch, t_RKneePitch, t_RAnklePitch, t_RAnkleRoll);
126 }
127
132 this->init(t_other.HeadYaw(), t_other.HeadPitch(), t_other.LShoulderPitch(), t_other.LShoulderRoll(), t_other.LElbowYaw(), t_other.LElbowRoll(), t_other.LWristYaw(), t_other.LHand(), t_other.RShoulderPitch(), t_other.RShoulderRoll(), t_other.RElbowYaw(), t_other.RElbowRoll(), t_other.RWristYaw(), t_other.RHand(), t_other.LHipYawPitch(), t_other.LHipRoll(), t_other.LHipPitch(), t_other.LKneePitch(), t_other.LAnklePitch(), t_other.LAnkleRoll(), t_other.RHipRoll(), t_other.RHipPitch(), t_other.RKneePitch(), t_other.RAnklePitch(), t_other.RAnkleRoll());
133 }
134
139 this->init(t_other.HeadYaw, t_other.HeadPitch, t_other.LShoulderPitch, t_other.LShoulderRoll, t_other.LElbowYaw, t_other.LElbowRoll, t_other.LWristYaw, t_other.LHand, t_other.RShoulderPitch, t_other.RShoulderRoll, t_other.RElbowYaw, t_other.RElbowRoll, t_other.RWristYaw, t_other.RHand, t_other.LHipYawPitch, t_other.LHipRoll, t_other.LHipPitch, t_other.LKneePitch, t_other.LAnklePitch, t_other.LAnkleRoll, t_other.RHipRoll, t_other.RHipPitch, t_other.RKneePitch, t_other.RAnklePitch, t_other.RAnkleRoll);
140 }
141
146 this->init(t_other.HeadYaw(), t_other.HeadPitch(), t_other.LShoulderPitch(), t_other.LShoulderRoll(), t_other.LElbowYaw(), t_other.LElbowRoll(), t_other.LWristYaw(), t_other.LHand(), t_other.RShoulderPitch(), t_other.RShoulderRoll(), t_other.RElbowYaw(), t_other.RElbowRoll(), t_other.RWristYaw(), t_other.RHand(), t_other.LHipYawPitch(), t_other.LHipRoll(), t_other.LHipPitch(), t_other.LKneePitch(), t_other.LAnklePitch(), t_other.LAnkleRoll(), t_other.RHipRoll(), t_other.RHipPitch(), t_other.RKneePitch(), t_other.RAnklePitch(), t_other.RAnkleRoll());
147 return *this;
148 }
149
154 this->init(t_other.HeadYaw, t_other.HeadPitch, t_other.LShoulderPitch, t_other.LShoulderRoll, t_other.LElbowYaw, t_other.LElbowRoll, t_other.LWristYaw, t_other.LHand, t_other.RShoulderPitch, t_other.RShoulderRoll, t_other.RElbowYaw, t_other.RElbowRoll, t_other.RWristYaw, t_other.RHand, t_other.LHipYawPitch, t_other.LHipRoll, t_other.LHipPitch, t_other.LKneePitch, t_other.LAnklePitch, t_other.LAnkleRoll, t_other.RHipRoll, t_other.RHipPitch, t_other.RKneePitch, t_other.RAnklePitch, t_other.RAnkleRoll);
155 return *this;
156 }
157
158 bool operator ==(const NaoJointListFloat &t_other) const
159 {
160 return fabsf(HeadYaw() - t_other.HeadYaw()) < FLT_EPSILON
161 && fabsf(HeadPitch() - t_other.HeadPitch()) < FLT_EPSILON
162 && fabsf(LShoulderPitch() - t_other.LShoulderPitch()) < FLT_EPSILON
163 && fabsf(LShoulderRoll() - t_other.LShoulderRoll()) < FLT_EPSILON
164 && fabsf(LElbowYaw() - t_other.LElbowYaw()) < FLT_EPSILON
165 && fabsf(LElbowRoll() - t_other.LElbowRoll()) < FLT_EPSILON
166 && fabsf(LWristYaw() - t_other.LWristYaw()) < FLT_EPSILON
167 && fabsf(LHand() - t_other.LHand()) < FLT_EPSILON
168 && fabsf(RShoulderPitch() - t_other.RShoulderPitch()) < FLT_EPSILON
169 && fabsf(RShoulderRoll() - t_other.RShoulderRoll()) < FLT_EPSILON
170 && fabsf(RElbowYaw() - t_other.RElbowYaw()) < FLT_EPSILON
171 && fabsf(RElbowRoll() - t_other.RElbowRoll()) < FLT_EPSILON
172 && fabsf(RWristYaw() - t_other.RWristYaw()) < FLT_EPSILON
173 && fabsf(RHand() - t_other.RHand()) < FLT_EPSILON
174 && fabsf(LHipYawPitch() - t_other.LHipYawPitch()) < FLT_EPSILON
175 && fabsf(LHipRoll() - t_other.LHipRoll()) < FLT_EPSILON
176 && fabsf(LHipPitch() - t_other.LHipPitch()) < FLT_EPSILON
177 && fabsf(LKneePitch() - t_other.LKneePitch()) < FLT_EPSILON
178 && fabsf(LAnklePitch() - t_other.LAnklePitch()) < FLT_EPSILON
179 && fabsf(LAnkleRoll() - t_other.LAnkleRoll()) < FLT_EPSILON
180 && fabsf(RHipRoll() - t_other.RHipRoll()) < FLT_EPSILON
181 && fabsf(RHipPitch() - t_other.RHipPitch()) < FLT_EPSILON
182 && fabsf(RKneePitch() - t_other.RKneePitch()) < FLT_EPSILON
183 && fabsf(RAnklePitch() - t_other.RAnklePitch()) < FLT_EPSILON
184 && fabsf(RAnkleRoll() - t_other.RAnkleRoll()) < FLT_EPSILON;
185 }
186
187 bool operator !=(const NaoJointListFloat &t_other) const
188 {
189 return !(*this == t_other);
190 }
191
192 bool operator ==(const wb_nao_joint_list_float &t_other) const
193 {
194 return *this == NaoJointListFloat(t_other);
195 }
196
197 bool operator !=(const wb_nao_joint_list_float &t_other) const
198 {
199 return !(*this == t_other);
200 }
201
202 float & HeadYaw()
203 {
205 }
206
207 const float & HeadYaw() const
208 {
210 }
211
212 void set_HeadYaw(const float &t_newValue)
213 {
215 }
216
217 float & HeadPitch()
218 {
220 }
221
222 const float & HeadPitch() const
223 {
225 }
226
227 void set_HeadPitch(const float &t_newValue)
228 {
230 }
231
233 {
235 }
236
237 const float & LShoulderPitch() const
238 {
240 }
241
242 void set_LShoulderPitch(const float &t_newValue)
243 {
245 }
246
248 {
250 }
251
252 const float & LShoulderRoll() const
253 {
255 }
256
257 void set_LShoulderRoll(const float &t_newValue)
258 {
260 }
261
262 float & LElbowYaw()
263 {
265 }
266
267 const float & LElbowYaw() const
268 {
270 }
271
272 void set_LElbowYaw(const float &t_newValue)
273 {
275 }
276
277 float & LElbowRoll()
278 {
280 }
281
282 const float & LElbowRoll() const
283 {
285 }
286
287 void set_LElbowRoll(const float &t_newValue)
288 {
290 }
291
292 float & LWristYaw()
293 {
295 }
296
297 const float & LWristYaw() const
298 {
300 }
301
302 void set_LWristYaw(const float &t_newValue)
303 {
305 }
306
307 float & LHand()
308 {
310 }
311
312 const float & LHand() const
313 {
315 }
316
317 void set_LHand(const float &t_newValue)
318 {
320 }
321
323 {
325 }
326
327 const float & RShoulderPitch() const
328 {
330 }
331
332 void set_RShoulderPitch(const float &t_newValue)
333 {
335 }
336
338 {
340 }
341
342 const float & RShoulderRoll() const
343 {
345 }
346
347 void set_RShoulderRoll(const float &t_newValue)
348 {
350 }
351
352 float & RElbowYaw()
353 {
355 }
356
357 const float & RElbowYaw() const
358 {
360 }
361
362 void set_RElbowYaw(const float &t_newValue)
363 {
365 }
366
367 float & RElbowRoll()
368 {
370 }
371
372 const float & RElbowRoll() const
373 {
375 }
376
377 void set_RElbowRoll(const float &t_newValue)
378 {
380 }
381
382 float & RWristYaw()
383 {
385 }
386
387 const float & RWristYaw() const
388 {
390 }
391
392 void set_RWristYaw(const float &t_newValue)
393 {
395 }
396
397 float & RHand()
398 {
400 }
401
402 const float & RHand() const
403 {
405 }
406
407 void set_RHand(const float &t_newValue)
408 {
410 }
411
412 float & LHipYawPitch()
413 {
415 }
416
417 const float & LHipYawPitch() const
418 {
420 }
421
422 void set_LHipYawPitch(const float &t_newValue)
423 {
425 }
426
427 float & LHipRoll()
428 {
430 }
431
432 const float & LHipRoll() const
433 {
435 }
436
437 void set_LHipRoll(const float &t_newValue)
438 {
440 }
441
442 float & LHipPitch()
443 {
445 }
446
447 const float & LHipPitch() const
448 {
450 }
451
452 void set_LHipPitch(const float &t_newValue)
453 {
455 }
456
457 float & LKneePitch()
458 {
460 }
461
462 const float & LKneePitch() const
463 {
465 }
466
467 void set_LKneePitch(const float &t_newValue)
468 {
470 }
471
472 float & LAnklePitch()
473 {
475 }
476
477 const float & LAnklePitch() const
478 {
480 }
481
482 void set_LAnklePitch(const float &t_newValue)
483 {
485 }
486
487 float & LAnkleRoll()
488 {
490 }
491
492 const float & LAnkleRoll() const
493 {
495 }
496
497 void set_LAnkleRoll(const float &t_newValue)
498 {
500 }
501
502 float & RHipRoll()
503 {
505 }
506
507 const float & RHipRoll() const
508 {
510 }
511
512 void set_RHipRoll(const float &t_newValue)
513 {
515 }
516
517 float & RHipPitch()
518 {
520 }
521
522 const float & RHipPitch() const
523 {
525 }
526
527 void set_RHipPitch(const float &t_newValue)
528 {
530 }
531
532 float & RKneePitch()
533 {
535 }
536
537 const float & RKneePitch() const
538 {
540 }
541
542 void set_RKneePitch(const float &t_newValue)
543 {
545 }
546
547 float & RAnklePitch()
548 {
550 }
551
552 const float & RAnklePitch() const
553 {
555 }
556
557 void set_RAnklePitch(const float &t_newValue)
558 {
560 }
561
562 float & RAnkleRoll()
563 {
565 }
566
567 const float & RAnkleRoll() const
568 {
570 }
571
572 void set_RAnkleRoll(const float &t_newValue)
573 {
575 }
576
577#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
581 NaoJointListFloat(const std::string &t_str) {
582 this->init();
583 this->from_string(t_str);
584 }
585
586 std::string description() {
587#ifdef USE_WB_NAO_JOINT_LIST_FLOAT_C_CONVERSION
589 wb_nao_joint_list_float_description(this, buffer, sizeof(buffer));
590 std::string descr = buffer;
591 return descr;
592#else
593 std::ostringstream ss;
594 ss << "HeadYaw=" << this->HeadYaw();
595 ss << ", ";
596 ss << "HeadPitch=" << this->HeadPitch();
597 ss << ", ";
598 ss << "LShoulderPitch=" << this->LShoulderPitch();
599 ss << ", ";
600 ss << "LShoulderRoll=" << this->LShoulderRoll();
601 ss << ", ";
602 ss << "LElbowYaw=" << this->LElbowYaw();
603 ss << ", ";
604 ss << "LElbowRoll=" << this->LElbowRoll();
605 ss << ", ";
606 ss << "LWristYaw=" << this->LWristYaw();
607 ss << ", ";
608 ss << "LHand=" << this->LHand();
609 ss << ", ";
610 ss << "RShoulderPitch=" << this->RShoulderPitch();
611 ss << ", ";
612 ss << "RShoulderRoll=" << this->RShoulderRoll();
613 ss << ", ";
614 ss << "RElbowYaw=" << this->RElbowYaw();
615 ss << ", ";
616 ss << "RElbowRoll=" << this->RElbowRoll();
617 ss << ", ";
618 ss << "RWristYaw=" << this->RWristYaw();
619 ss << ", ";
620 ss << "RHand=" << this->RHand();
621 ss << ", ";
622 ss << "LHipYawPitch=" << this->LHipYawPitch();
623 ss << ", ";
624 ss << "LHipRoll=" << this->LHipRoll();
625 ss << ", ";
626 ss << "LHipPitch=" << this->LHipPitch();
627 ss << ", ";
628 ss << "LKneePitch=" << this->LKneePitch();
629 ss << ", ";
630 ss << "LAnklePitch=" << this->LAnklePitch();
631 ss << ", ";
632 ss << "LAnkleRoll=" << this->LAnkleRoll();
633 ss << ", ";
634 ss << "RHipRoll=" << this->RHipRoll();
635 ss << ", ";
636 ss << "RHipPitch=" << this->RHipPitch();
637 ss << ", ";
638 ss << "RKneePitch=" << this->RKneePitch();
639 ss << ", ";
640 ss << "RAnklePitch=" << this->RAnklePitch();
641 ss << ", ";
642 ss << "RAnkleRoll=" << this->RAnkleRoll();
643 return ss.str();
644#endif
645 }
646
647 std::string to_string() {
648#ifdef USE_WB_NAO_JOINT_LIST_FLOAT_C_CONVERSION
650 wb_nao_joint_list_float_to_string(this, buffer, sizeof(buffer));
651 std::string toString = buffer;
652 return toString;
653#else
654 std::ostringstream ss;
655 ss << this->HeadYaw();
656 ss << ", ";
657 ss << this->HeadPitch();
658 ss << ", ";
659 ss << this->LShoulderPitch();
660 ss << ", ";
661 ss << this->LShoulderRoll();
662 ss << ", ";
663 ss << this->LElbowYaw();
664 ss << ", ";
665 ss << this->LElbowRoll();
666 ss << ", ";
667 ss << this->LWristYaw();
668 ss << ", ";
669 ss << this->LHand();
670 ss << ", ";
671 ss << this->RShoulderPitch();
672 ss << ", ";
673 ss << this->RShoulderRoll();
674 ss << ", ";
675 ss << this->RElbowYaw();
676 ss << ", ";
677 ss << this->RElbowRoll();
678 ss << ", ";
679 ss << this->RWristYaw();
680 ss << ", ";
681 ss << this->RHand();
682 ss << ", ";
683 ss << this->LHipYawPitch();
684 ss << ", ";
685 ss << this->LHipRoll();
686 ss << ", ";
687 ss << this->LHipPitch();
688 ss << ", ";
689 ss << this->LKneePitch();
690 ss << ", ";
691 ss << this->LAnklePitch();
692 ss << ", ";
693 ss << this->LAnkleRoll();
694 ss << ", ";
695 ss << this->RHipRoll();
696 ss << ", ";
697 ss << this->RHipPitch();
698 ss << ", ";
699 ss << this->RKneePitch();
700 ss << ", ";
701 ss << this->RAnklePitch();
702 ss << ", ";
703 ss << this->RAnkleRoll();
704 return ss.str();
705#endif
706 }
707
708#ifdef USE_WB_NAO_JOINT_LIST_FLOAT_C_CONVERSION
709 void from_string(const std::string &t_str) {
710 wb_nao_joint_list_float_from_string(this, t_str.c_str());
711#else
712 void from_string(const std::string &t_str) {
713 char * str_cstr = const_cast<char *>(t_str.c_str());
714 size_t temp_length = strlen(str_cstr);
715 int length = (temp_length <= INT_MAX) ? static_cast<int>(static_cast<ssize_t>(temp_length)) : -1;
716 if (length < 1 || length > NAO_JOINT_LIST_FLOAT_DESC_BUFFER_SIZE) {
717 return;
718 }
719 char var_str_buffer[NAO_JOINT_LIST_FLOAT_DESC_BUFFER_SIZE + 1];
720 char* var_str = &var_str_buffer[0];
721 char key_buffer[15];
722 char* key = &key_buffer[0];
723 int bracecount = 0;
724 int startVar = 0;
725 int index = 0;
726 int startKey = 0;
727 int endKey = -1;
728 int varIndex = 0;
729 if (index == 0 && str_cstr[0] == '{') {
730 index = 1;
731 }
732 startVar = index;
733 startKey = startVar;
734 do {
735 for (int i = index; i < length; i++) {
736 index = i + 1;
737 if (bracecount == 0 && str_cstr[i] == '=') {
738 endKey = i - 1;
739 startVar = index;
740 continue;
741 }
742 if (bracecount == 0 && isspace(str_cstr[i])) {
743 startVar = index;
744 if (endKey == -1) {
745 startKey = index;
746 }
747 continue;
748 }
749 if (bracecount == 0 && str_cstr[i] == ',') {
750 index = i - 1;
751 break;
752 }
753 if (str_cstr[i] == '{') {
754 bracecount++;
755 continue;
756 }
757 if (str_cstr[i] == '}') {
758 bracecount--;
759 if (bracecount < 0) {
760 index = i - 1;
761 break;
762 }
763 }
764 if (i == length - 1) {
765 index = i;
766 }
767 }
768 if (endKey >= startKey && endKey - startKey < length) {
769 strncpy(key, str_cstr + startKey, static_cast<size_t>((endKey - startKey) + 1));
770 key[(endKey - startKey) + 1] = 0;
771 } else {
772 key[0] = 0;
773 }
774 strncpy(var_str, str_cstr + startVar, static_cast<size_t>((index - startVar) + 1));
775 var_str[(index - startVar) + 1] = 0;
776 bracecount = 0;
777 index += 2;
778 startVar = index;
779 startKey = startVar;
780 endKey = -1;
781 if (strlen(key) > 0) {
782 if (0 == strcmp("HeadYaw", key)) {
783 varIndex = 0;
784 } else if (0 == strcmp("HeadPitch", key)) {
785 varIndex = 1;
786 } else if (0 == strcmp("LShoulderPitch", key)) {
787 varIndex = 2;
788 } else if (0 == strcmp("LShoulderRoll", key)) {
789 varIndex = 3;
790 } else if (0 == strcmp("LElbowYaw", key)) {
791 varIndex = 4;
792 } else if (0 == strcmp("LElbowRoll", key)) {
793 varIndex = 5;
794 } else if (0 == strcmp("LWristYaw", key)) {
795 varIndex = 6;
796 } else if (0 == strcmp("LHand", key)) {
797 varIndex = 7;
798 } else if (0 == strcmp("RShoulderPitch", key)) {
799 varIndex = 8;
800 } else if (0 == strcmp("RShoulderRoll", key)) {
801 varIndex = 9;
802 } else if (0 == strcmp("RElbowYaw", key)) {
803 varIndex = 10;
804 } else if (0 == strcmp("RElbowRoll", key)) {
805 varIndex = 11;
806 } else if (0 == strcmp("RWristYaw", key)) {
807 varIndex = 12;
808 } else if (0 == strcmp("RHand", key)) {
809 varIndex = 13;
810 } else if (0 == strcmp("LHipYawPitch", key)) {
811 varIndex = 14;
812 } else if (0 == strcmp("LHipRoll", key)) {
813 varIndex = 15;
814 } else if (0 == strcmp("LHipPitch", key)) {
815 varIndex = 16;
816 } else if (0 == strcmp("LKneePitch", key)) {
817 varIndex = 17;
818 } else if (0 == strcmp("LAnklePitch", key)) {
819 varIndex = 18;
820 } else if (0 == strcmp("LAnkleRoll", key)) {
821 varIndex = 19;
822 } else if (0 == strcmp("RHipRoll", key)) {
823 varIndex = 20;
824 } else if (0 == strcmp("RHipPitch", key)) {
825 varIndex = 21;
826 } else if (0 == strcmp("RKneePitch", key)) {
827 varIndex = 22;
828 } else if (0 == strcmp("RAnklePitch", key)) {
829 varIndex = 23;
830 } else if (0 == strcmp("RAnkleRoll", key)) {
831 varIndex = 24;
832 } else {
833 varIndex = -1;
834 }
835 }
836 switch (varIndex) {
837 case -1: { break; }
838 case 0:
839 {
840 this->set_HeadYaw(static_cast<float>(atof(var_str)));
841 break;
842 }
843 case 1:
844 {
845 this->set_HeadPitch(static_cast<float>(atof(var_str)));
846 break;
847 }
848 case 2:
849 {
850 this->set_LShoulderPitch(static_cast<float>(atof(var_str)));
851 break;
852 }
853 case 3:
854 {
855 this->set_LShoulderRoll(static_cast<float>(atof(var_str)));
856 break;
857 }
858 case 4:
859 {
860 this->set_LElbowYaw(static_cast<float>(atof(var_str)));
861 break;
862 }
863 case 5:
864 {
865 this->set_LElbowRoll(static_cast<float>(atof(var_str)));
866 break;
867 }
868 case 6:
869 {
870 this->set_LWristYaw(static_cast<float>(atof(var_str)));
871 break;
872 }
873 case 7:
874 {
875 this->set_LHand(static_cast<float>(atof(var_str)));
876 break;
877 }
878 case 8:
879 {
880 this->set_RShoulderPitch(static_cast<float>(atof(var_str)));
881 break;
882 }
883 case 9:
884 {
885 this->set_RShoulderRoll(static_cast<float>(atof(var_str)));
886 break;
887 }
888 case 10:
889 {
890 this->set_RElbowYaw(static_cast<float>(atof(var_str)));
891 break;
892 }
893 case 11:
894 {
895 this->set_RElbowRoll(static_cast<float>(atof(var_str)));
896 break;
897 }
898 case 12:
899 {
900 this->set_RWristYaw(static_cast<float>(atof(var_str)));
901 break;
902 }
903 case 13:
904 {
905 this->set_RHand(static_cast<float>(atof(var_str)));
906 break;
907 }
908 case 14:
909 {
910 this->set_LHipYawPitch(static_cast<float>(atof(var_str)));
911 break;
912 }
913 case 15:
914 {
915 this->set_LHipRoll(static_cast<float>(atof(var_str)));
916 break;
917 }
918 case 16:
919 {
920 this->set_LHipPitch(static_cast<float>(atof(var_str)));
921 break;
922 }
923 case 17:
924 {
925 this->set_LKneePitch(static_cast<float>(atof(var_str)));
926 break;
927 }
928 case 18:
929 {
930 this->set_LAnklePitch(static_cast<float>(atof(var_str)));
931 break;
932 }
933 case 19:
934 {
935 this->set_LAnkleRoll(static_cast<float>(atof(var_str)));
936 break;
937 }
938 case 20:
939 {
940 this->set_RHipRoll(static_cast<float>(atof(var_str)));
941 break;
942 }
943 case 21:
944 {
945 this->set_RHipPitch(static_cast<float>(atof(var_str)));
946 break;
947 }
948 case 22:
949 {
950 this->set_RKneePitch(static_cast<float>(atof(var_str)));
951 break;
952 }
953 case 23:
954 {
955 this->set_RAnklePitch(static_cast<float>(atof(var_str)));
956 break;
957 }
958 case 24:
959 {
960 this->set_RAnkleRoll(static_cast<float>(atof(var_str)));
961 break;
962 }
963 }
964 if (varIndex >= 0) {
965 varIndex++;
966 }
967 } while(index < length);
968#endif
969 }
970#endif
971 };
972
973}
974
975#endif
Provides a C++ wrapper around wb_nao_joint_list_float.
void set_RElbowRoll(const float &t_newValue)
void set_LShoulderPitch(const float &t_newValue)
NaoJointListFloat(const std::string &t_str)
String Constructor.
void set_HeadYaw(const float &t_newValue)
NaoJointListFloat(const struct wb_nao_joint_list_float &t_other)
Copy Constructor.
void set_LHipPitch(const float &t_newValue)
void set_LHipRoll(const float &t_newValue)
void set_LAnklePitch(const float &t_newValue)
void set_LElbowRoll(const float &t_newValue)
void set_HeadPitch(const float &t_newValue)
bool operator!=(const NaoJointListFloat &t_other) const
void set_LAnkleRoll(const float &t_newValue)
void set_RWristYaw(const float &t_newValue)
void set_RHipRoll(const float &t_newValue)
void from_string(const std::string &t_str)
void set_RKneePitch(const float &t_newValue)
void set_LKneePitch(const float &t_newValue)
void set_LHand(const float &t_newValue)
void set_LHipYawPitch(const float &t_newValue)
NaoJointListFloat(const NaoJointListFloat &t_other)
Copy Constructor.
void set_RAnklePitch(const float &t_newValue)
bool operator==(const NaoJointListFloat &t_other) const
void set_LShoulderRoll(const float &t_newValue)
void set_RHipPitch(const float &t_newValue)
void set_LWristYaw(const float &t_newValue)
const float & RShoulderPitch() const
const float & LShoulderPitch() const
void set_RShoulderPitch(const float &t_newValue)
NaoJointListFloat & operator=(const NaoJointListFloat &t_other)
Copy Assignment Operator.
void set_RHand(const float &t_newValue)
NaoJointListFloat(float t_HeadYaw=0.0f, float t_HeadPitch=0.0f, float t_LShoulderPitch=0.0f, float t_LShoulderRoll=0.0f, float t_LElbowYaw=0.0f, float t_LElbowRoll=0.0f, float t_LWristYaw=0.0f, float t_LHand=0.0f, float t_RShoulderPitch=0.0f, float t_RShoulderRoll=0.0f, float t_RElbowYaw=0.0f, float t_RElbowRoll=0.0f, float t_RWristYaw=0.0f, float t_RHand=0.0f, float t_LHipYawPitch=0.0f, float t_LHipRoll=0.0f, float t_LHipPitch=0.0f, float t_LKneePitch=0.0f, float t_LAnklePitch=0.0f, float t_LAnkleRoll=0.0f, float t_RHipRoll=0.0f, float t_RHipPitch=0.0f, float t_RKneePitch=0.0f, float t_RAnklePitch=0.0f, float t_RAnkleRoll=0.0f)
Create a new NaoJointListFloat.
void set_RShoulderRoll(const float &t_newValue)
void set_LElbowYaw(const float &t_newValue)
void set_RAnkleRoll(const float &t_newValue)
void set_RElbowYaw(const float &t_newValue)
/file APM_Interface.h
WHITEBOARD_POSTER_STRING_CONVERSION.
const char * wb_nao_joint_list_float_description(const struct wb_nao_joint_list_float *self, char *descString, size_t bufferSize)
Convert to a description string.
struct wb_nao_joint_list_float * wb_nao_joint_list_float_from_string(struct wb_nao_joint_list_float *self, const char *str)
Convert from a string.
const char * wb_nao_joint_list_float_to_string(const struct wb_nao_joint_list_float *self, char *toString, size_t bufferSize)
Convert to a string.
#define NAO_JOINT_LIST_FLOAT_DESC_BUFFER_SIZE
#define NAO_JOINT_LIST_FLOAT_TO_STRING_BUFFER_SIZE