YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
jointData.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6// Autogenerated by Thrift Compiler (0.14.1-yarped)
7//
8// This is an automatically generated file.
9// It could get re-generated if the ALLOW_IDL_GENERATION flag is on.
10
12
13namespace yarp::dev::impl {
14
15// Constructor with field values
17 const bool jointPosition_isValid,
18 const yarp::sig::VectorOf<double>& jointVelocity,
19 const bool jointVelocity_isValid,
20 const yarp::sig::VectorOf<double>& jointAcceleration,
21 const bool jointAcceleration_isValid,
22 const yarp::sig::VectorOf<double>& motorPosition,
23 const bool motorPosition_isValid,
24 const yarp::sig::VectorOf<double>& motorVelocity,
25 const bool motorVelocity_isValid,
26 const yarp::sig::VectorOf<double>& motorAcceleration,
27 const bool motorAcceleration_isValid,
28 const yarp::sig::VectorOf<double>& torque,
29 const bool torque_isValid,
30 const yarp::sig::VectorOf<double>& pwmDutycycle,
31 const bool pwmDutycycle_isValid,
32 const yarp::sig::VectorOf<double>& current,
33 const bool current_isValid,
34 const yarp::sig::VectorOf<int>& controlMode,
35 const bool controlMode_isValid,
36 const yarp::sig::VectorOf<int>& interactionMode,
37 const bool interactionMode_isValid) :
38 WirePortable(),
39 jointPosition(jointPosition),
40 jointPosition_isValid(jointPosition_isValid),
41 jointVelocity(jointVelocity),
42 jointVelocity_isValid(jointVelocity_isValid),
43 jointAcceleration(jointAcceleration),
44 jointAcceleration_isValid(jointAcceleration_isValid),
45 motorPosition(motorPosition),
46 motorPosition_isValid(motorPosition_isValid),
47 motorVelocity(motorVelocity),
48 motorVelocity_isValid(motorVelocity_isValid),
49 motorAcceleration(motorAcceleration),
50 motorAcceleration_isValid(motorAcceleration_isValid),
51 torque(torque),
52 torque_isValid(torque_isValid),
53 pwmDutycycle(pwmDutycycle),
54 pwmDutycycle_isValid(pwmDutycycle_isValid),
55 current(current),
56 current_isValid(current_isValid),
57 controlMode(controlMode),
58 controlMode_isValid(controlMode_isValid),
59 interactionMode(interactionMode),
60 interactionMode_isValid(interactionMode_isValid)
61{
62}
63
64// Read structure on a Wire
66{
67 if (!nested_read_jointPosition(reader)) {
68 return false;
69 }
70 if (!read_jointPosition_isValid(reader)) {
71 return false;
72 }
73 if (!nested_read_jointVelocity(reader)) {
74 return false;
75 }
76 if (!read_jointVelocity_isValid(reader)) {
77 return false;
78 }
79 if (!nested_read_jointAcceleration(reader)) {
80 return false;
81 }
82 if (!read_jointAcceleration_isValid(reader)) {
83 return false;
84 }
85 if (!nested_read_motorPosition(reader)) {
86 return false;
87 }
88 if (!read_motorPosition_isValid(reader)) {
89 return false;
90 }
91 if (!nested_read_motorVelocity(reader)) {
92 return false;
93 }
94 if (!read_motorVelocity_isValid(reader)) {
95 return false;
96 }
97 if (!nested_read_motorAcceleration(reader)) {
98 return false;
99 }
100 if (!read_motorAcceleration_isValid(reader)) {
101 return false;
102 }
103 if (!nested_read_torque(reader)) {
104 return false;
105 }
106 if (!read_torque_isValid(reader)) {
107 return false;
108 }
109 if (!nested_read_pwmDutycycle(reader)) {
110 return false;
111 }
112 if (!read_pwmDutycycle_isValid(reader)) {
113 return false;
114 }
115 if (!nested_read_current(reader)) {
116 return false;
117 }
118 if (!read_current_isValid(reader)) {
119 return false;
120 }
121 if (!nested_read_controlMode(reader)) {
122 return false;
123 }
124 if (!read_controlMode_isValid(reader)) {
125 return false;
126 }
127 if (!nested_read_interactionMode(reader)) {
128 return false;
129 }
130 if (!read_interactionMode_isValid(reader)) {
131 return false;
132 }
133 if (reader.isError()) {
134 return false;
135 }
136 return true;
137}
138
139// Read structure on a Connection
141{
142 yarp::os::idl::WireReader reader(connection);
143 if (!reader.readListHeader(22)) {
144 return false;
145 }
146 if (!read(reader)) {
147 return false;
148 }
149 return true;
150}
151
152// Write structure on a Wire
154{
155 if (!nested_write_jointPosition(writer)) {
156 return false;
157 }
158 if (!write_jointPosition_isValid(writer)) {
159 return false;
160 }
161 if (!nested_write_jointVelocity(writer)) {
162 return false;
163 }
164 if (!write_jointVelocity_isValid(writer)) {
165 return false;
166 }
167 if (!nested_write_jointAcceleration(writer)) {
168 return false;
169 }
170 if (!write_jointAcceleration_isValid(writer)) {
171 return false;
172 }
173 if (!nested_write_motorPosition(writer)) {
174 return false;
175 }
176 if (!write_motorPosition_isValid(writer)) {
177 return false;
178 }
179 if (!nested_write_motorVelocity(writer)) {
180 return false;
181 }
182 if (!write_motorVelocity_isValid(writer)) {
183 return false;
184 }
185 if (!nested_write_motorAcceleration(writer)) {
186 return false;
187 }
188 if (!write_motorAcceleration_isValid(writer)) {
189 return false;
190 }
191 if (!nested_write_torque(writer)) {
192 return false;
193 }
194 if (!write_torque_isValid(writer)) {
195 return false;
196 }
197 if (!nested_write_pwmDutycycle(writer)) {
198 return false;
199 }
200 if (!write_pwmDutycycle_isValid(writer)) {
201 return false;
202 }
203 if (!nested_write_current(writer)) {
204 return false;
205 }
206 if (!write_current_isValid(writer)) {
207 return false;
208 }
209 if (!nested_write_controlMode(writer)) {
210 return false;
211 }
212 if (!write_controlMode_isValid(writer)) {
213 return false;
214 }
215 if (!nested_write_interactionMode(writer)) {
216 return false;
217 }
218 if (!write_interactionMode_isValid(writer)) {
219 return false;
220 }
221 if (writer.isError()) {
222 return false;
223 }
224 return true;
225}
226
227// Write structure on a Connection
229{
230 yarp::os::idl::WireWriter writer(connection);
231 if (!writer.writeListHeader(22)) {
232 return false;
233 }
234 if (!write(writer)) {
235 return false;
236 }
237 return true;
238}
239
240// Convert to a printable string
241std::string jointData::toString() const
242{
244 if (!yarp::os::Portable::copyPortable(*this, b)) {
245 return {};
246 }
247 return b.toString();
248}
249
250// read jointPosition field
251bool jointData::read_jointPosition(yarp::os::idl::WireReader& reader)
252{
253 if (reader.noMore()) {
254 reader.fail();
255 return false;
256 }
257 if (!reader.read(jointPosition)) {
258 reader.fail();
259 return false;
260 }
261 return true;
262}
263
264// write jointPosition field
265bool jointData::write_jointPosition(const yarp::os::idl::WireWriter& writer) const
266{
267 if (!writer.write(jointPosition)) {
268 return false;
269 }
270 return true;
271}
272
273// read (nested) jointPosition field
274bool jointData::nested_read_jointPosition(yarp::os::idl::WireReader& reader)
275{
276 if (reader.noMore()) {
277 reader.fail();
278 return false;
279 }
280 if (!reader.readNested(jointPosition)) {
281 reader.fail();
282 return false;
283 }
284 return true;
285}
286
287// write (nested) jointPosition field
288bool jointData::nested_write_jointPosition(const yarp::os::idl::WireWriter& writer) const
289{
290 if (!writer.writeNested(jointPosition)) {
291 return false;
292 }
293 return true;
294}
295
296// read jointPosition_isValid field
297bool jointData::read_jointPosition_isValid(yarp::os::idl::WireReader& reader)
298{
299 if (reader.noMore()) {
300 reader.fail();
301 return false;
302 }
303 if (!reader.readBool(jointPosition_isValid)) {
304 reader.fail();
305 return false;
306 }
307 return true;
308}
309
310// write jointPosition_isValid field
311bool jointData::write_jointPosition_isValid(const yarp::os::idl::WireWriter& writer) const
312{
313 if (!writer.writeBool(jointPosition_isValid)) {
314 return false;
315 }
316 return true;
317}
318
319// read (nested) jointPosition_isValid field
320bool jointData::nested_read_jointPosition_isValid(yarp::os::idl::WireReader& reader)
321{
322 if (reader.noMore()) {
323 reader.fail();
324 return false;
325 }
326 if (!reader.readBool(jointPosition_isValid)) {
327 reader.fail();
328 return false;
329 }
330 return true;
331}
332
333// write (nested) jointPosition_isValid field
334bool jointData::nested_write_jointPosition_isValid(const yarp::os::idl::WireWriter& writer) const
335{
336 if (!writer.writeBool(jointPosition_isValid)) {
337 return false;
338 }
339 return true;
340}
341
342// read jointVelocity field
343bool jointData::read_jointVelocity(yarp::os::idl::WireReader& reader)
344{
345 if (reader.noMore()) {
346 reader.fail();
347 return false;
348 }
349 if (!reader.read(jointVelocity)) {
350 reader.fail();
351 return false;
352 }
353 return true;
354}
355
356// write jointVelocity field
357bool jointData::write_jointVelocity(const yarp::os::idl::WireWriter& writer) const
358{
359 if (!writer.write(jointVelocity)) {
360 return false;
361 }
362 return true;
363}
364
365// read (nested) jointVelocity field
366bool jointData::nested_read_jointVelocity(yarp::os::idl::WireReader& reader)
367{
368 if (reader.noMore()) {
369 reader.fail();
370 return false;
371 }
372 if (!reader.readNested(jointVelocity)) {
373 reader.fail();
374 return false;
375 }
376 return true;
377}
378
379// write (nested) jointVelocity field
380bool jointData::nested_write_jointVelocity(const yarp::os::idl::WireWriter& writer) const
381{
382 if (!writer.writeNested(jointVelocity)) {
383 return false;
384 }
385 return true;
386}
387
388// read jointVelocity_isValid field
389bool jointData::read_jointVelocity_isValid(yarp::os::idl::WireReader& reader)
390{
391 if (reader.noMore()) {
392 reader.fail();
393 return false;
394 }
395 if (!reader.readBool(jointVelocity_isValid)) {
396 reader.fail();
397 return false;
398 }
399 return true;
400}
401
402// write jointVelocity_isValid field
403bool jointData::write_jointVelocity_isValid(const yarp::os::idl::WireWriter& writer) const
404{
405 if (!writer.writeBool(jointVelocity_isValid)) {
406 return false;
407 }
408 return true;
409}
410
411// read (nested) jointVelocity_isValid field
412bool jointData::nested_read_jointVelocity_isValid(yarp::os::idl::WireReader& reader)
413{
414 if (reader.noMore()) {
415 reader.fail();
416 return false;
417 }
418 if (!reader.readBool(jointVelocity_isValid)) {
419 reader.fail();
420 return false;
421 }
422 return true;
423}
424
425// write (nested) jointVelocity_isValid field
426bool jointData::nested_write_jointVelocity_isValid(const yarp::os::idl::WireWriter& writer) const
427{
428 if (!writer.writeBool(jointVelocity_isValid)) {
429 return false;
430 }
431 return true;
432}
433
434// read jointAcceleration field
435bool jointData::read_jointAcceleration(yarp::os::idl::WireReader& reader)
436{
437 if (reader.noMore()) {
438 reader.fail();
439 return false;
440 }
441 if (!reader.read(jointAcceleration)) {
442 reader.fail();
443 return false;
444 }
445 return true;
446}
447
448// write jointAcceleration field
449bool jointData::write_jointAcceleration(const yarp::os::idl::WireWriter& writer) const
450{
451 if (!writer.write(jointAcceleration)) {
452 return false;
453 }
454 return true;
455}
456
457// read (nested) jointAcceleration field
458bool jointData::nested_read_jointAcceleration(yarp::os::idl::WireReader& reader)
459{
460 if (reader.noMore()) {
461 reader.fail();
462 return false;
463 }
464 if (!reader.readNested(jointAcceleration)) {
465 reader.fail();
466 return false;
467 }
468 return true;
469}
470
471// write (nested) jointAcceleration field
472bool jointData::nested_write_jointAcceleration(const yarp::os::idl::WireWriter& writer) const
473{
474 if (!writer.writeNested(jointAcceleration)) {
475 return false;
476 }
477 return true;
478}
479
480// read jointAcceleration_isValid field
481bool jointData::read_jointAcceleration_isValid(yarp::os::idl::WireReader& reader)
482{
483 if (reader.noMore()) {
484 reader.fail();
485 return false;
486 }
487 if (!reader.readBool(jointAcceleration_isValid)) {
488 reader.fail();
489 return false;
490 }
491 return true;
492}
493
494// write jointAcceleration_isValid field
495bool jointData::write_jointAcceleration_isValid(const yarp::os::idl::WireWriter& writer) const
496{
498 return false;
499 }
500 return true;
501}
502
503// read (nested) jointAcceleration_isValid field
504bool jointData::nested_read_jointAcceleration_isValid(yarp::os::idl::WireReader& reader)
505{
506 if (reader.noMore()) {
507 reader.fail();
508 return false;
509 }
510 if (!reader.readBool(jointAcceleration_isValid)) {
511 reader.fail();
512 return false;
513 }
514 return true;
515}
516
517// write (nested) jointAcceleration_isValid field
518bool jointData::nested_write_jointAcceleration_isValid(const yarp::os::idl::WireWriter& writer) const
519{
521 return false;
522 }
523 return true;
524}
525
526// read motorPosition field
527bool jointData::read_motorPosition(yarp::os::idl::WireReader& reader)
528{
529 if (reader.noMore()) {
530 reader.fail();
531 return false;
532 }
533 if (!reader.read(motorPosition)) {
534 reader.fail();
535 return false;
536 }
537 return true;
538}
539
540// write motorPosition field
541bool jointData::write_motorPosition(const yarp::os::idl::WireWriter& writer) const
542{
543 if (!writer.write(motorPosition)) {
544 return false;
545 }
546 return true;
547}
548
549// read (nested) motorPosition field
550bool jointData::nested_read_motorPosition(yarp::os::idl::WireReader& reader)
551{
552 if (reader.noMore()) {
553 reader.fail();
554 return false;
555 }
556 if (!reader.readNested(motorPosition)) {
557 reader.fail();
558 return false;
559 }
560 return true;
561}
562
563// write (nested) motorPosition field
564bool jointData::nested_write_motorPosition(const yarp::os::idl::WireWriter& writer) const
565{
566 if (!writer.writeNested(motorPosition)) {
567 return false;
568 }
569 return true;
570}
571
572// read motorPosition_isValid field
573bool jointData::read_motorPosition_isValid(yarp::os::idl::WireReader& reader)
574{
575 if (reader.noMore()) {
576 reader.fail();
577 return false;
578 }
579 if (!reader.readBool(motorPosition_isValid)) {
580 reader.fail();
581 return false;
582 }
583 return true;
584}
585
586// write motorPosition_isValid field
587bool jointData::write_motorPosition_isValid(const yarp::os::idl::WireWriter& writer) const
588{
589 if (!writer.writeBool(motorPosition_isValid)) {
590 return false;
591 }
592 return true;
593}
594
595// read (nested) motorPosition_isValid field
596bool jointData::nested_read_motorPosition_isValid(yarp::os::idl::WireReader& reader)
597{
598 if (reader.noMore()) {
599 reader.fail();
600 return false;
601 }
602 if (!reader.readBool(motorPosition_isValid)) {
603 reader.fail();
604 return false;
605 }
606 return true;
607}
608
609// write (nested) motorPosition_isValid field
610bool jointData::nested_write_motorPosition_isValid(const yarp::os::idl::WireWriter& writer) const
611{
612 if (!writer.writeBool(motorPosition_isValid)) {
613 return false;
614 }
615 return true;
616}
617
618// read motorVelocity field
619bool jointData::read_motorVelocity(yarp::os::idl::WireReader& reader)
620{
621 if (reader.noMore()) {
622 reader.fail();
623 return false;
624 }
625 if (!reader.read(motorVelocity)) {
626 reader.fail();
627 return false;
628 }
629 return true;
630}
631
632// write motorVelocity field
633bool jointData::write_motorVelocity(const yarp::os::idl::WireWriter& writer) const
634{
635 if (!writer.write(motorVelocity)) {
636 return false;
637 }
638 return true;
639}
640
641// read (nested) motorVelocity field
642bool jointData::nested_read_motorVelocity(yarp::os::idl::WireReader& reader)
643{
644 if (reader.noMore()) {
645 reader.fail();
646 return false;
647 }
648 if (!reader.readNested(motorVelocity)) {
649 reader.fail();
650 return false;
651 }
652 return true;
653}
654
655// write (nested) motorVelocity field
656bool jointData::nested_write_motorVelocity(const yarp::os::idl::WireWriter& writer) const
657{
658 if (!writer.writeNested(motorVelocity)) {
659 return false;
660 }
661 return true;
662}
663
664// read motorVelocity_isValid field
665bool jointData::read_motorVelocity_isValid(yarp::os::idl::WireReader& reader)
666{
667 if (reader.noMore()) {
668 reader.fail();
669 return false;
670 }
671 if (!reader.readBool(motorVelocity_isValid)) {
672 reader.fail();
673 return false;
674 }
675 return true;
676}
677
678// write motorVelocity_isValid field
679bool jointData::write_motorVelocity_isValid(const yarp::os::idl::WireWriter& writer) const
680{
681 if (!writer.writeBool(motorVelocity_isValid)) {
682 return false;
683 }
684 return true;
685}
686
687// read (nested) motorVelocity_isValid field
688bool jointData::nested_read_motorVelocity_isValid(yarp::os::idl::WireReader& reader)
689{
690 if (reader.noMore()) {
691 reader.fail();
692 return false;
693 }
694 if (!reader.readBool(motorVelocity_isValid)) {
695 reader.fail();
696 return false;
697 }
698 return true;
699}
700
701// write (nested) motorVelocity_isValid field
702bool jointData::nested_write_motorVelocity_isValid(const yarp::os::idl::WireWriter& writer) const
703{
704 if (!writer.writeBool(motorVelocity_isValid)) {
705 return false;
706 }
707 return true;
708}
709
710// read motorAcceleration field
711bool jointData::read_motorAcceleration(yarp::os::idl::WireReader& reader)
712{
713 if (reader.noMore()) {
714 reader.fail();
715 return false;
716 }
717 if (!reader.read(motorAcceleration)) {
718 reader.fail();
719 return false;
720 }
721 return true;
722}
723
724// write motorAcceleration field
725bool jointData::write_motorAcceleration(const yarp::os::idl::WireWriter& writer) const
726{
727 if (!writer.write(motorAcceleration)) {
728 return false;
729 }
730 return true;
731}
732
733// read (nested) motorAcceleration field
734bool jointData::nested_read_motorAcceleration(yarp::os::idl::WireReader& reader)
735{
736 if (reader.noMore()) {
737 reader.fail();
738 return false;
739 }
740 if (!reader.readNested(motorAcceleration)) {
741 reader.fail();
742 return false;
743 }
744 return true;
745}
746
747// write (nested) motorAcceleration field
748bool jointData::nested_write_motorAcceleration(const yarp::os::idl::WireWriter& writer) const
749{
750 if (!writer.writeNested(motorAcceleration)) {
751 return false;
752 }
753 return true;
754}
755
756// read motorAcceleration_isValid field
757bool jointData::read_motorAcceleration_isValid(yarp::os::idl::WireReader& reader)
758{
759 if (reader.noMore()) {
760 reader.fail();
761 return false;
762 }
763 if (!reader.readBool(motorAcceleration_isValid)) {
764 reader.fail();
765 return false;
766 }
767 return true;
768}
769
770// write motorAcceleration_isValid field
771bool jointData::write_motorAcceleration_isValid(const yarp::os::idl::WireWriter& writer) const
772{
774 return false;
775 }
776 return true;
777}
778
779// read (nested) motorAcceleration_isValid field
780bool jointData::nested_read_motorAcceleration_isValid(yarp::os::idl::WireReader& reader)
781{
782 if (reader.noMore()) {
783 reader.fail();
784 return false;
785 }
786 if (!reader.readBool(motorAcceleration_isValid)) {
787 reader.fail();
788 return false;
789 }
790 return true;
791}
792
793// write (nested) motorAcceleration_isValid field
794bool jointData::nested_write_motorAcceleration_isValid(const yarp::os::idl::WireWriter& writer) const
795{
797 return false;
798 }
799 return true;
800}
801
802// read torque field
803bool jointData::read_torque(yarp::os::idl::WireReader& reader)
804{
805 if (reader.noMore()) {
806 reader.fail();
807 return false;
808 }
809 if (!reader.read(torque)) {
810 reader.fail();
811 return false;
812 }
813 return true;
814}
815
816// write torque field
817bool jointData::write_torque(const yarp::os::idl::WireWriter& writer) const
818{
819 if (!writer.write(torque)) {
820 return false;
821 }
822 return true;
823}
824
825// read (nested) torque field
826bool jointData::nested_read_torque(yarp::os::idl::WireReader& reader)
827{
828 if (reader.noMore()) {
829 reader.fail();
830 return false;
831 }
832 if (!reader.readNested(torque)) {
833 reader.fail();
834 return false;
835 }
836 return true;
837}
838
839// write (nested) torque field
840bool jointData::nested_write_torque(const yarp::os::idl::WireWriter& writer) const
841{
842 if (!writer.writeNested(torque)) {
843 return false;
844 }
845 return true;
846}
847
848// read torque_isValid field
849bool jointData::read_torque_isValid(yarp::os::idl::WireReader& reader)
850{
851 if (reader.noMore()) {
852 reader.fail();
853 return false;
854 }
855 if (!reader.readBool(torque_isValid)) {
856 reader.fail();
857 return false;
858 }
859 return true;
860}
861
862// write torque_isValid field
863bool jointData::write_torque_isValid(const yarp::os::idl::WireWriter& writer) const
864{
865 if (!writer.writeBool(torque_isValid)) {
866 return false;
867 }
868 return true;
869}
870
871// read (nested) torque_isValid field
872bool jointData::nested_read_torque_isValid(yarp::os::idl::WireReader& reader)
873{
874 if (reader.noMore()) {
875 reader.fail();
876 return false;
877 }
878 if (!reader.readBool(torque_isValid)) {
879 reader.fail();
880 return false;
881 }
882 return true;
883}
884
885// write (nested) torque_isValid field
886bool jointData::nested_write_torque_isValid(const yarp::os::idl::WireWriter& writer) const
887{
888 if (!writer.writeBool(torque_isValid)) {
889 return false;
890 }
891 return true;
892}
893
894// read pwmDutycycle field
895bool jointData::read_pwmDutycycle(yarp::os::idl::WireReader& reader)
896{
897 if (reader.noMore()) {
898 reader.fail();
899 return false;
900 }
901 if (!reader.read(pwmDutycycle)) {
902 reader.fail();
903 return false;
904 }
905 return true;
906}
907
908// write pwmDutycycle field
909bool jointData::write_pwmDutycycle(const yarp::os::idl::WireWriter& writer) const
910{
911 if (!writer.write(pwmDutycycle)) {
912 return false;
913 }
914 return true;
915}
916
917// read (nested) pwmDutycycle field
918bool jointData::nested_read_pwmDutycycle(yarp::os::idl::WireReader& reader)
919{
920 if (reader.noMore()) {
921 reader.fail();
922 return false;
923 }
924 if (!reader.readNested(pwmDutycycle)) {
925 reader.fail();
926 return false;
927 }
928 return true;
929}
930
931// write (nested) pwmDutycycle field
932bool jointData::nested_write_pwmDutycycle(const yarp::os::idl::WireWriter& writer) const
933{
934 if (!writer.writeNested(pwmDutycycle)) {
935 return false;
936 }
937 return true;
938}
939
940// read pwmDutycycle_isValid field
941bool jointData::read_pwmDutycycle_isValid(yarp::os::idl::WireReader& reader)
942{
943 if (reader.noMore()) {
944 reader.fail();
945 return false;
946 }
947 if (!reader.readBool(pwmDutycycle_isValid)) {
948 reader.fail();
949 return false;
950 }
951 return true;
952}
953
954// write pwmDutycycle_isValid field
955bool jointData::write_pwmDutycycle_isValid(const yarp::os::idl::WireWriter& writer) const
956{
957 if (!writer.writeBool(pwmDutycycle_isValid)) {
958 return false;
959 }
960 return true;
961}
962
963// read (nested) pwmDutycycle_isValid field
964bool jointData::nested_read_pwmDutycycle_isValid(yarp::os::idl::WireReader& reader)
965{
966 if (reader.noMore()) {
967 reader.fail();
968 return false;
969 }
970 if (!reader.readBool(pwmDutycycle_isValid)) {
971 reader.fail();
972 return false;
973 }
974 return true;
975}
976
977// write (nested) pwmDutycycle_isValid field
978bool jointData::nested_write_pwmDutycycle_isValid(const yarp::os::idl::WireWriter& writer) const
979{
980 if (!writer.writeBool(pwmDutycycle_isValid)) {
981 return false;
982 }
983 return true;
984}
985
986// read current field
987bool jointData::read_current(yarp::os::idl::WireReader& reader)
988{
989 if (reader.noMore()) {
990 reader.fail();
991 return false;
992 }
993 if (!reader.read(current)) {
994 reader.fail();
995 return false;
996 }
997 return true;
998}
999
1000// write current field
1001bool jointData::write_current(const yarp::os::idl::WireWriter& writer) const
1002{
1003 if (!writer.write(current)) {
1004 return false;
1005 }
1006 return true;
1007}
1008
1009// read (nested) current field
1010bool jointData::nested_read_current(yarp::os::idl::WireReader& reader)
1011{
1012 if (reader.noMore()) {
1013 reader.fail();
1014 return false;
1015 }
1016 if (!reader.readNested(current)) {
1017 reader.fail();
1018 return false;
1019 }
1020 return true;
1021}
1022
1023// write (nested) current field
1024bool jointData::nested_write_current(const yarp::os::idl::WireWriter& writer) const
1025{
1026 if (!writer.writeNested(current)) {
1027 return false;
1028 }
1029 return true;
1030}
1031
1032// read current_isValid field
1033bool jointData::read_current_isValid(yarp::os::idl::WireReader& reader)
1034{
1035 if (reader.noMore()) {
1036 reader.fail();
1037 return false;
1038 }
1039 if (!reader.readBool(current_isValid)) {
1040 reader.fail();
1041 return false;
1042 }
1043 return true;
1044}
1045
1046// write current_isValid field
1047bool jointData::write_current_isValid(const yarp::os::idl::WireWriter& writer) const
1048{
1049 if (!writer.writeBool(current_isValid)) {
1050 return false;
1051 }
1052 return true;
1053}
1054
1055// read (nested) current_isValid field
1056bool jointData::nested_read_current_isValid(yarp::os::idl::WireReader& reader)
1057{
1058 if (reader.noMore()) {
1059 reader.fail();
1060 return false;
1061 }
1062 if (!reader.readBool(current_isValid)) {
1063 reader.fail();
1064 return false;
1065 }
1066 return true;
1067}
1068
1069// write (nested) current_isValid field
1070bool jointData::nested_write_current_isValid(const yarp::os::idl::WireWriter& writer) const
1071{
1072 if (!writer.writeBool(current_isValid)) {
1073 return false;
1074 }
1075 return true;
1076}
1077
1078// read controlMode field
1079bool jointData::read_controlMode(yarp::os::idl::WireReader& reader)
1080{
1081 if (reader.noMore()) {
1082 reader.fail();
1083 return false;
1084 }
1085 if (!reader.read(controlMode)) {
1086 reader.fail();
1087 return false;
1088 }
1089 return true;
1090}
1091
1092// write controlMode field
1093bool jointData::write_controlMode(const yarp::os::idl::WireWriter& writer) const
1094{
1095 if (!writer.write(controlMode)) {
1096 return false;
1097 }
1098 return true;
1099}
1100
1101// read (nested) controlMode field
1102bool jointData::nested_read_controlMode(yarp::os::idl::WireReader& reader)
1103{
1104 if (reader.noMore()) {
1105 reader.fail();
1106 return false;
1107 }
1108 if (!reader.readNested(controlMode)) {
1109 reader.fail();
1110 return false;
1111 }
1112 return true;
1113}
1114
1115// write (nested) controlMode field
1116bool jointData::nested_write_controlMode(const yarp::os::idl::WireWriter& writer) const
1117{
1118 if (!writer.writeNested(controlMode)) {
1119 return false;
1120 }
1121 return true;
1122}
1123
1124// read controlMode_isValid field
1125bool jointData::read_controlMode_isValid(yarp::os::idl::WireReader& reader)
1126{
1127 if (reader.noMore()) {
1128 reader.fail();
1129 return false;
1130 }
1131 if (!reader.readBool(controlMode_isValid)) {
1132 reader.fail();
1133 return false;
1134 }
1135 return true;
1136}
1137
1138// write controlMode_isValid field
1139bool jointData::write_controlMode_isValid(const yarp::os::idl::WireWriter& writer) const
1140{
1141 if (!writer.writeBool(controlMode_isValid)) {
1142 return false;
1143 }
1144 return true;
1145}
1146
1147// read (nested) controlMode_isValid field
1148bool jointData::nested_read_controlMode_isValid(yarp::os::idl::WireReader& reader)
1149{
1150 if (reader.noMore()) {
1151 reader.fail();
1152 return false;
1153 }
1154 if (!reader.readBool(controlMode_isValid)) {
1155 reader.fail();
1156 return false;
1157 }
1158 return true;
1159}
1160
1161// write (nested) controlMode_isValid field
1162bool jointData::nested_write_controlMode_isValid(const yarp::os::idl::WireWriter& writer) const
1163{
1164 if (!writer.writeBool(controlMode_isValid)) {
1165 return false;
1166 }
1167 return true;
1168}
1169
1170// read interactionMode field
1171bool jointData::read_interactionMode(yarp::os::idl::WireReader& reader)
1172{
1173 if (reader.noMore()) {
1174 reader.fail();
1175 return false;
1176 }
1177 if (!reader.read(interactionMode)) {
1178 reader.fail();
1179 return false;
1180 }
1181 return true;
1182}
1183
1184// write interactionMode field
1185bool jointData::write_interactionMode(const yarp::os::idl::WireWriter& writer) const
1186{
1187 if (!writer.write(interactionMode)) {
1188 return false;
1189 }
1190 return true;
1191}
1192
1193// read (nested) interactionMode field
1194bool jointData::nested_read_interactionMode(yarp::os::idl::WireReader& reader)
1195{
1196 if (reader.noMore()) {
1197 reader.fail();
1198 return false;
1199 }
1200 if (!reader.readNested(interactionMode)) {
1201 reader.fail();
1202 return false;
1203 }
1204 return true;
1205}
1206
1207// write (nested) interactionMode field
1208bool jointData::nested_write_interactionMode(const yarp::os::idl::WireWriter& writer) const
1209{
1210 if (!writer.writeNested(interactionMode)) {
1211 return false;
1212 }
1213 return true;
1214}
1215
1216// read interactionMode_isValid field
1217bool jointData::read_interactionMode_isValid(yarp::os::idl::WireReader& reader)
1218{
1219 if (reader.noMore()) {
1220 reader.fail();
1221 return false;
1222 }
1223 if (!reader.readBool(interactionMode_isValid)) {
1224 reader.fail();
1225 return false;
1226 }
1227 return true;
1228}
1229
1230// write interactionMode_isValid field
1231bool jointData::write_interactionMode_isValid(const yarp::os::idl::WireWriter& writer) const
1232{
1233 if (!writer.writeBool(interactionMode_isValid)) {
1234 return false;
1235 }
1236 return true;
1237}
1238
1239// read (nested) interactionMode_isValid field
1240bool jointData::nested_read_interactionMode_isValid(yarp::os::idl::WireReader& reader)
1241{
1242 if (reader.noMore()) {
1243 reader.fail();
1244 return false;
1245 }
1246 if (!reader.readBool(interactionMode_isValid)) {
1247 reader.fail();
1248 return false;
1249 }
1250 return true;
1251}
1252
1253// write (nested) interactionMode_isValid field
1254bool jointData::nested_write_interactionMode_isValid(const yarp::os::idl::WireWriter& writer) const
1255{
1256 if (!writer.writeBool(interactionMode_isValid)) {
1257 return false;
1258 }
1259 return true;
1260}
1261
1262} // namespace yarp::dev::impl
yarp::sig::VectorOf< double > motorVelocity
Definition jointData.h:35
bool read(yarp::os::idl::WireReader &reader) override
Definition jointData.cpp:65
yarp::sig::VectorOf< double > jointAcceleration
Definition jointData.h:31
yarp::sig::VectorOf< int > controlMode
Definition jointData.h:45
yarp::sig::VectorOf< int > interactionMode
Definition jointData.h:47
yarp::sig::VectorOf< double > current
Definition jointData.h:43
bool write(const yarp::os::idl::WireWriter &writer) const override
yarp::sig::VectorOf< double > motorAcceleration
Definition jointData.h:37
yarp::sig::VectorOf< double > motorPosition
Definition jointData.h:33
yarp::sig::VectorOf< double > pwmDutycycle
Definition jointData.h:41
yarp::sig::VectorOf< double > torque
Definition jointData.h:39
std::string toString() const
yarp::sig::VectorOf< double > jointPosition
Definition jointData.h:27
yarp::sig::VectorOf< double > jointVelocity
Definition jointData.h:29
A simple collection of objects that can be described and transmitted in a portable way.
Definition Bottle.h:64
std::string toString() const override
Gives a human-readable textual representation of the bottle.
Definition Bottle.cpp:211
An interface for reading from a network connection.
An interface for writing to a network connection.
static bool copyPortable(const PortWriter &writer, PortReader &reader)
Copy one portable to another, via writing and reading.
Definition Portable.cpp:16
IDL-friendly connection reader.
Definition WireReader.h:27
bool readNested(WirePortable &obj)
bool read(WirePortable &obj)
IDL-friendly connection writer.
Definition WireWriter.h:28
bool writeBool(bool x, bool skip_tag=false) const
bool write(const WirePortable &obj) const
bool writeListHeader(int len) const
bool writeNested(const WirePortable &obj) const