YARP
Yet Another Robot Platform
OdometryData.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 // Autogenerated by Thrift Compiler (0.12.0-yarped)
10 //
11 // This is an automatically generated file.
12 // It could get re-generated if the ALLOW_IDL_GENERATION flag is on.
13 
14 #include <yarp/dev/OdometryData.h>
15 
16 namespace yarp {
17 namespace dev {
18 
19 // Default constructor
21  WirePortable(),
22  odom_x(0),
23  odom_y(0),
24  odom_theta(0),
25  base_vel_x(0),
26  base_vel_y(0),
27  base_vel_theta(0),
28  odom_vel_x(0),
29  odom_vel_y(0),
30  odom_vel_theta(0)
31 {
32 }
33 
34 // Constructor with field values
35 OdometryData::OdometryData(const double odom_x,
36  const double odom_y,
37  const double odom_theta,
38  const double base_vel_x,
39  const double base_vel_y,
40  const double base_vel_theta,
41  const double odom_vel_x,
42  const double odom_vel_y,
43  const double odom_vel_theta) :
44  WirePortable(),
45  odom_x(odom_x),
46  odom_y(odom_y),
47  odom_theta(odom_theta),
48  base_vel_x(base_vel_x),
49  base_vel_y(base_vel_y),
50  base_vel_theta(base_vel_theta),
51  odom_vel_x(odom_vel_x),
52  odom_vel_y(odom_vel_y),
53  odom_vel_theta(odom_vel_theta)
54 {
55 }
56 
57 // Read structure on a Wire
59 {
60  if (!read_odom_x(reader)) {
61  return false;
62  }
63  if (!read_odom_y(reader)) {
64  return false;
65  }
66  if (!read_odom_theta(reader)) {
67  return false;
68  }
69  if (!read_base_vel_x(reader)) {
70  return false;
71  }
72  if (!read_base_vel_y(reader)) {
73  return false;
74  }
75  if (!read_base_vel_theta(reader)) {
76  return false;
77  }
78  if (!read_odom_vel_x(reader)) {
79  return false;
80  }
81  if (!read_odom_vel_y(reader)) {
82  return false;
83  }
84  if (!read_odom_vel_theta(reader)) {
85  return false;
86  }
87  return !reader.isError();
88 }
89 
90 // Read structure on a Connection
92 {
93  yarp::os::idl::WireReader reader(connection);
94  if (!reader.readListHeader(9)) {
95  return false;
96  }
97  return read(reader);
98 }
99 
100 // Write structure on a Wire
102 {
103  if (!write_odom_x(writer)) {
104  return false;
105  }
106  if (!write_odom_y(writer)) {
107  return false;
108  }
109  if (!write_odom_theta(writer)) {
110  return false;
111  }
112  if (!write_base_vel_x(writer)) {
113  return false;
114  }
115  if (!write_base_vel_y(writer)) {
116  return false;
117  }
118  if (!write_base_vel_theta(writer)) {
119  return false;
120  }
121  if (!write_odom_vel_x(writer)) {
122  return false;
123  }
124  if (!write_odom_vel_y(writer)) {
125  return false;
126  }
127  if (!write_odom_vel_theta(writer)) {
128  return false;
129  }
130  return !writer.isError();
131 }
132 
133 // Write structure on a Connection
135 {
136  yarp::os::idl::WireWriter writer(connection);
137  if (!writer.writeListHeader(9)) {
138  return false;
139  }
140  return write(writer);
141 }
142 
143 // Convert to a printable string
144 std::string OdometryData::toString() const
145 {
147  b.read(*this);
148  return b.toString();
149 }
150 
151 // Editor: default constructor
153 {
154  group = 0;
155  obj_owned = true;
156  obj = new OdometryData;
157  dirty_flags(false);
158  yarp().setOwner(*this);
159 }
160 
161 // Editor: constructor with base class
163 {
164  group = 0;
165  obj_owned = false;
166  edit(obj, false);
167  yarp().setOwner(*this);
168 }
169 
170 // Editor: destructor
172 {
173  if (obj_owned) {
174  delete obj;
175  }
176 }
177 
178 // Editor: edit
180 {
181  if (obj_owned) {
182  delete this->obj;
183  }
184  this->obj = &obj;
185  obj_owned = false;
186  dirty_flags(dirty);
187  return true;
188 }
189 
190 // Editor: validity check
192 {
193  return obj != nullptr;
194 }
195 
196 // Editor: state
198 {
199  return *obj;
200 }
201 
202 // Editor: grouping begin
204 {
205  group++;
206 }
207 
208 // Editor: grouping end
210 {
211  group--;
212  if (group == 0 && is_dirty) {
213  communicate();
214  }
215 }
216 // Editor: odom_x setter
218 {
219  will_set_odom_x();
220  obj->odom_x = odom_x;
221  mark_dirty_odom_x();
222  communicate();
223  did_set_odom_x();
224 }
225 
226 // Editor: odom_x getter
228 {
229  return obj->odom_x;
230 }
231 
232 // Editor: odom_x will_set
234 {
235  return true;
236 }
237 
238 // Editor: odom_x did_set
240 {
241  return true;
242 }
243 
244 // Editor: odom_y setter
246 {
247  will_set_odom_y();
248  obj->odom_y = odom_y;
249  mark_dirty_odom_y();
250  communicate();
251  did_set_odom_y();
252 }
253 
254 // Editor: odom_y getter
256 {
257  return obj->odom_y;
258 }
259 
260 // Editor: odom_y will_set
262 {
263  return true;
264 }
265 
266 // Editor: odom_y did_set
268 {
269  return true;
270 }
271 
272 // Editor: odom_theta setter
274 {
275  will_set_odom_theta();
276  obj->odom_theta = odom_theta;
277  mark_dirty_odom_theta();
278  communicate();
279  did_set_odom_theta();
280 }
281 
282 // Editor: odom_theta getter
284 {
285  return obj->odom_theta;
286 }
287 
288 // Editor: odom_theta will_set
290 {
291  return true;
292 }
293 
294 // Editor: odom_theta did_set
296 {
297  return true;
298 }
299 
300 // Editor: base_vel_x setter
302 {
303  will_set_base_vel_x();
304  obj->base_vel_x = base_vel_x;
305  mark_dirty_base_vel_x();
306  communicate();
307  did_set_base_vel_x();
308 }
309 
310 // Editor: base_vel_x getter
312 {
313  return obj->base_vel_x;
314 }
315 
316 // Editor: base_vel_x will_set
318 {
319  return true;
320 }
321 
322 // Editor: base_vel_x did_set
324 {
325  return true;
326 }
327 
328 // Editor: base_vel_y setter
330 {
331  will_set_base_vel_y();
332  obj->base_vel_y = base_vel_y;
333  mark_dirty_base_vel_y();
334  communicate();
335  did_set_base_vel_y();
336 }
337 
338 // Editor: base_vel_y getter
340 {
341  return obj->base_vel_y;
342 }
343 
344 // Editor: base_vel_y will_set
346 {
347  return true;
348 }
349 
350 // Editor: base_vel_y did_set
352 {
353  return true;
354 }
355 
356 // Editor: base_vel_theta setter
358 {
359  will_set_base_vel_theta();
360  obj->base_vel_theta = base_vel_theta;
361  mark_dirty_base_vel_theta();
362  communicate();
363  did_set_base_vel_theta();
364 }
365 
366 // Editor: base_vel_theta getter
368 {
369  return obj->base_vel_theta;
370 }
371 
372 // Editor: base_vel_theta will_set
374 {
375  return true;
376 }
377 
378 // Editor: base_vel_theta did_set
380 {
381  return true;
382 }
383 
384 // Editor: odom_vel_x setter
386 {
387  will_set_odom_vel_x();
388  obj->odom_vel_x = odom_vel_x;
389  mark_dirty_odom_vel_x();
390  communicate();
391  did_set_odom_vel_x();
392 }
393 
394 // Editor: odom_vel_x getter
396 {
397  return obj->odom_vel_x;
398 }
399 
400 // Editor: odom_vel_x will_set
402 {
403  return true;
404 }
405 
406 // Editor: odom_vel_x did_set
408 {
409  return true;
410 }
411 
412 // Editor: odom_vel_y setter
414 {
415  will_set_odom_vel_y();
416  obj->odom_vel_y = odom_vel_y;
417  mark_dirty_odom_vel_y();
418  communicate();
419  did_set_odom_vel_y();
420 }
421 
422 // Editor: odom_vel_y getter
424 {
425  return obj->odom_vel_y;
426 }
427 
428 // Editor: odom_vel_y will_set
430 {
431  return true;
432 }
433 
434 // Editor: odom_vel_y did_set
436 {
437  return true;
438 }
439 
440 // Editor: odom_vel_theta setter
442 {
443  will_set_odom_vel_theta();
444  obj->odom_vel_theta = odom_vel_theta;
445  mark_dirty_odom_vel_theta();
446  communicate();
447  did_set_odom_vel_theta();
448 }
449 
450 // Editor: odom_vel_theta getter
452 {
453  return obj->odom_vel_theta;
454 }
455 
456 // Editor: odom_vel_theta will_set
458 {
459  return true;
460 }
461 
462 // Editor: odom_vel_theta did_set
464 {
465  return true;
466 }
467 
468 // Editor: clean
470 {
471  dirty_flags(false);
472 }
473 
474 // Editor: read
476 {
477  if (!isValid()) {
478  return false;
479  }
480  yarp::os::idl::WireReader reader(connection);
481  reader.expectAccept();
482  if (!reader.readListHeader()) {
483  return false;
484  }
485  int len = reader.getLength();
486  if (len == 0) {
487  yarp::os::idl::WireWriter writer(reader);
488  if (writer.isNull()) {
489  return true;
490  }
491  if (!writer.writeListHeader(1)) {
492  return false;
493  }
494  writer.writeString("send: 'help' or 'patch (param1 val1) (param2 val2)'");
495  return true;
496  }
497  std::string tag;
498  if (!reader.readString(tag)) {
499  return false;
500  }
501  if (tag == "help") {
502  yarp::os::idl::WireWriter writer(reader);
503  if (writer.isNull()) {
504  return true;
505  }
506  if (!writer.writeListHeader(2)) {
507  return false;
508  }
509  if (!writer.writeTag("many", 1, 0)) {
510  return false;
511  }
512  if (reader.getLength() > 0) {
513  std::string field;
514  if (!reader.readString(field)) {
515  return false;
516  }
517  if (field == "odom_x") {
518  if (!writer.writeListHeader(2)) {
519  return false;
520  }
521  if (!writer.writeString("double odom_x")) {
522  return false;
523  }
524  if (!writer.writeString("position of the robot [m], expressed in the world reference frame")) {
525  return false;
526  }
527  }
528  if (field == "odom_y") {
529  if (!writer.writeListHeader(2)) {
530  return false;
531  }
532  if (!writer.writeString("double odom_y")) {
533  return false;
534  }
535  if (!writer.writeString("position of the robot [m], expressed in the world reference frame")) {
536  return false;
537  }
538  }
539  if (field == "odom_theta") {
540  if (!writer.writeListHeader(2)) {
541  return false;
542  }
543  if (!writer.writeString("double odom_theta")) {
544  return false;
545  }
546  if (!writer.writeString("orientation the robot [deg], expressed in the world reference frame")) {
547  return false;
548  }
549  }
550  if (field == "base_vel_x") {
551  if (!writer.writeListHeader(2)) {
552  return false;
553  }
554  if (!writer.writeString("double base_vel_x")) {
555  return false;
556  }
557  if (!writer.writeString("velocity of the robot [m/s] expressed in the robot reference frame")) {
558  return false;
559  }
560  }
561  if (field == "base_vel_y") {
562  if (!writer.writeListHeader(2)) {
563  return false;
564  }
565  if (!writer.writeString("double base_vel_y")) {
566  return false;
567  }
568  if (!writer.writeString("velocity of the robot [m/s] expressed in the robot reference frame")) {
569  return false;
570  }
571  }
572  if (field == "base_vel_theta") {
573  if (!writer.writeListHeader(2)) {
574  return false;
575  }
576  if (!writer.writeString("double base_vel_theta")) {
577  return false;
578  }
579  if (!writer.writeString("angular velocity of the robot [deg/s] expressed in the robot reference frame")) {
580  return false;
581  }
582  }
583  if (field == "odom_vel_x") {
584  if (!writer.writeListHeader(2)) {
585  return false;
586  }
587  if (!writer.writeString("double odom_vel_x")) {
588  return false;
589  }
590  if (!writer.writeString("velocity of the robot [m/s] expressed in the world reference frame")) {
591  return false;
592  }
593  }
594  if (field == "odom_vel_y") {
595  if (!writer.writeListHeader(2)) {
596  return false;
597  }
598  if (!writer.writeString("double odom_vel_y")) {
599  return false;
600  }
601  if (!writer.writeString("velocity of the robot [m/s] expressed in the world reference frame")) {
602  return false;
603  }
604  }
605  if (field == "odom_vel_theta") {
606  if (!writer.writeListHeader(2)) {
607  return false;
608  }
609  if (!writer.writeString("double odom_vel_theta")) {
610  return false;
611  }
612  if (!writer.writeString("angular velocity of the robot [deg/s] expressed in the world reference frame")) {
613  return false;
614  }
615  }
616  }
617  if (!writer.writeListHeader(10)) {
618  return false;
619  }
620  writer.writeString("*** Available fields:");
621  writer.writeString("odom_x");
622  writer.writeString("odom_y");
623  writer.writeString("odom_theta");
624  writer.writeString("base_vel_x");
625  writer.writeString("base_vel_y");
626  writer.writeString("base_vel_theta");
627  writer.writeString("odom_vel_x");
628  writer.writeString("odom_vel_y");
629  writer.writeString("odom_vel_theta");
630  return true;
631  }
632  bool nested = true;
633  bool have_act = false;
634  if (tag != "patch") {
635  if (((len - 1) % 2) != 0) {
636  return false;
637  }
638  len = 1 + ((len - 1) / 2);
639  nested = false;
640  have_act = true;
641  }
642  for (int i = 1; i < len; ++i) {
643  if (nested && !reader.readListHeader(3)) {
644  return false;
645  }
646  std::string act;
647  std::string key;
648  if (have_act) {
649  act = tag;
650  } else if (!reader.readString(act)) {
651  return false;
652  }
653  if (!reader.readString(key)) {
654  return false;
655  }
656  if (key == "odom_x") {
657  will_set_odom_x();
658  if (!obj->nested_read_odom_x(reader)) {
659  return false;
660  }
661  did_set_odom_x();
662  } else if (key == "odom_y") {
663  will_set_odom_y();
664  if (!obj->nested_read_odom_y(reader)) {
665  return false;
666  }
667  did_set_odom_y();
668  } else if (key == "odom_theta") {
669  will_set_odom_theta();
670  if (!obj->nested_read_odom_theta(reader)) {
671  return false;
672  }
673  did_set_odom_theta();
674  } else if (key == "base_vel_x") {
675  will_set_base_vel_x();
676  if (!obj->nested_read_base_vel_x(reader)) {
677  return false;
678  }
679  did_set_base_vel_x();
680  } else if (key == "base_vel_y") {
681  will_set_base_vel_y();
682  if (!obj->nested_read_base_vel_y(reader)) {
683  return false;
684  }
685  did_set_base_vel_y();
686  } else if (key == "base_vel_theta") {
687  will_set_base_vel_theta();
688  if (!obj->nested_read_base_vel_theta(reader)) {
689  return false;
690  }
691  did_set_base_vel_theta();
692  } else if (key == "odom_vel_x") {
693  will_set_odom_vel_x();
694  if (!obj->nested_read_odom_vel_x(reader)) {
695  return false;
696  }
697  did_set_odom_vel_x();
698  } else if (key == "odom_vel_y") {
699  will_set_odom_vel_y();
700  if (!obj->nested_read_odom_vel_y(reader)) {
701  return false;
702  }
703  did_set_odom_vel_y();
704  } else if (key == "odom_vel_theta") {
705  will_set_odom_vel_theta();
706  if (!obj->nested_read_odom_vel_theta(reader)) {
707  return false;
708  }
709  did_set_odom_vel_theta();
710  } else {
711  // would be useful to have a fallback here
712  }
713  }
714  reader.accept();
715  yarp::os::idl::WireWriter writer(reader);
716  if (writer.isNull()) {
717  return true;
718  }
719  writer.writeListHeader(1);
720  writer.writeVocab(yarp::os::createVocab('o', 'k'));
721  return true;
722 }
723 
724 // Editor: write
726 {
727  if (!isValid()) {
728  return false;
729  }
730  yarp::os::idl::WireWriter writer(connection);
731  if (!writer.writeListHeader(dirty_count + 1)) {
732  return false;
733  }
734  if (!writer.writeString("patch")) {
735  return false;
736  }
737  if (is_dirty_odom_x) {
738  if (!writer.writeListHeader(3)) {
739  return false;
740  }
741  if (!writer.writeString("set")) {
742  return false;
743  }
744  if (!writer.writeString("odom_x")) {
745  return false;
746  }
747  if (!obj->nested_write_odom_x(writer)) {
748  return false;
749  }
750  }
751  if (is_dirty_odom_y) {
752  if (!writer.writeListHeader(3)) {
753  return false;
754  }
755  if (!writer.writeString("set")) {
756  return false;
757  }
758  if (!writer.writeString("odom_y")) {
759  return false;
760  }
761  if (!obj->nested_write_odom_y(writer)) {
762  return false;
763  }
764  }
765  if (is_dirty_odom_theta) {
766  if (!writer.writeListHeader(3)) {
767  return false;
768  }
769  if (!writer.writeString("set")) {
770  return false;
771  }
772  if (!writer.writeString("odom_theta")) {
773  return false;
774  }
775  if (!obj->nested_write_odom_theta(writer)) {
776  return false;
777  }
778  }
779  if (is_dirty_base_vel_x) {
780  if (!writer.writeListHeader(3)) {
781  return false;
782  }
783  if (!writer.writeString("set")) {
784  return false;
785  }
786  if (!writer.writeString("base_vel_x")) {
787  return false;
788  }
789  if (!obj->nested_write_base_vel_x(writer)) {
790  return false;
791  }
792  }
793  if (is_dirty_base_vel_y) {
794  if (!writer.writeListHeader(3)) {
795  return false;
796  }
797  if (!writer.writeString("set")) {
798  return false;
799  }
800  if (!writer.writeString("base_vel_y")) {
801  return false;
802  }
803  if (!obj->nested_write_base_vel_y(writer)) {
804  return false;
805  }
806  }
807  if (is_dirty_base_vel_theta) {
808  if (!writer.writeListHeader(3)) {
809  return false;
810  }
811  if (!writer.writeString("set")) {
812  return false;
813  }
814  if (!writer.writeString("base_vel_theta")) {
815  return false;
816  }
817  if (!obj->nested_write_base_vel_theta(writer)) {
818  return false;
819  }
820  }
821  if (is_dirty_odom_vel_x) {
822  if (!writer.writeListHeader(3)) {
823  return false;
824  }
825  if (!writer.writeString("set")) {
826  return false;
827  }
828  if (!writer.writeString("odom_vel_x")) {
829  return false;
830  }
831  if (!obj->nested_write_odom_vel_x(writer)) {
832  return false;
833  }
834  }
835  if (is_dirty_odom_vel_y) {
836  if (!writer.writeListHeader(3)) {
837  return false;
838  }
839  if (!writer.writeString("set")) {
840  return false;
841  }
842  if (!writer.writeString("odom_vel_y")) {
843  return false;
844  }
845  if (!obj->nested_write_odom_vel_y(writer)) {
846  return false;
847  }
848  }
849  if (is_dirty_odom_vel_theta) {
850  if (!writer.writeListHeader(3)) {
851  return false;
852  }
853  if (!writer.writeString("set")) {
854  return false;
855  }
856  if (!writer.writeString("odom_vel_theta")) {
857  return false;
858  }
859  if (!obj->nested_write_odom_vel_theta(writer)) {
860  return false;
861  }
862  }
863  return !writer.isError();
864 }
865 
866 // Editor: send if possible
867 void OdometryData::Editor::communicate()
868 {
869  if (group != 0) {
870  return;
871  }
872  if (yarp().canWrite()) {
873  yarp().write(*this);
874  clean();
875  }
876 }
877 
878 // Editor: mark dirty overall
879 void OdometryData::Editor::mark_dirty()
880 {
881  is_dirty = true;
882 }
883 
884 // Editor: odom_x mark_dirty
885 void OdometryData::Editor::mark_dirty_odom_x()
886 {
887  if (is_dirty_odom_x) {
888  return;
889  }
890  dirty_count++;
891  is_dirty_odom_x = true;
892  mark_dirty();
893 }
894 
895 // Editor: odom_y mark_dirty
896 void OdometryData::Editor::mark_dirty_odom_y()
897 {
898  if (is_dirty_odom_y) {
899  return;
900  }
901  dirty_count++;
902  is_dirty_odom_y = true;
903  mark_dirty();
904 }
905 
906 // Editor: odom_theta mark_dirty
907 void OdometryData::Editor::mark_dirty_odom_theta()
908 {
909  if (is_dirty_odom_theta) {
910  return;
911  }
912  dirty_count++;
913  is_dirty_odom_theta = true;
914  mark_dirty();
915 }
916 
917 // Editor: base_vel_x mark_dirty
918 void OdometryData::Editor::mark_dirty_base_vel_x()
919 {
920  if (is_dirty_base_vel_x) {
921  return;
922  }
923  dirty_count++;
924  is_dirty_base_vel_x = true;
925  mark_dirty();
926 }
927 
928 // Editor: base_vel_y mark_dirty
929 void OdometryData::Editor::mark_dirty_base_vel_y()
930 {
931  if (is_dirty_base_vel_y) {
932  return;
933  }
934  dirty_count++;
935  is_dirty_base_vel_y = true;
936  mark_dirty();
937 }
938 
939 // Editor: base_vel_theta mark_dirty
940 void OdometryData::Editor::mark_dirty_base_vel_theta()
941 {
942  if (is_dirty_base_vel_theta) {
943  return;
944  }
945  dirty_count++;
946  is_dirty_base_vel_theta = true;
947  mark_dirty();
948 }
949 
950 // Editor: odom_vel_x mark_dirty
951 void OdometryData::Editor::mark_dirty_odom_vel_x()
952 {
953  if (is_dirty_odom_vel_x) {
954  return;
955  }
956  dirty_count++;
957  is_dirty_odom_vel_x = true;
958  mark_dirty();
959 }
960 
961 // Editor: odom_vel_y mark_dirty
962 void OdometryData::Editor::mark_dirty_odom_vel_y()
963 {
964  if (is_dirty_odom_vel_y) {
965  return;
966  }
967  dirty_count++;
968  is_dirty_odom_vel_y = true;
969  mark_dirty();
970 }
971 
972 // Editor: odom_vel_theta mark_dirty
973 void OdometryData::Editor::mark_dirty_odom_vel_theta()
974 {
975  if (is_dirty_odom_vel_theta) {
976  return;
977  }
978  dirty_count++;
979  is_dirty_odom_vel_theta = true;
980  mark_dirty();
981 }
982 
983 // Editor: dirty_flags
984 void OdometryData::Editor::dirty_flags(bool flag)
985 {
986  is_dirty = flag;
987  is_dirty_odom_x = flag;
988  is_dirty_odom_y = flag;
989  is_dirty_odom_theta = flag;
990  is_dirty_base_vel_x = flag;
991  is_dirty_base_vel_y = flag;
992  is_dirty_base_vel_theta = flag;
993  is_dirty_odom_vel_x = flag;
994  is_dirty_odom_vel_y = flag;
995  is_dirty_odom_vel_theta = flag;
996  dirty_count = flag ? 9 : 0;
997 }
998 
999 // read odom_x field
1000 bool OdometryData::read_odom_x(yarp::os::idl::WireReader& reader)
1001 {
1002  if (!reader.readFloat64(odom_x)) {
1003  reader.fail();
1004  return false;
1005  }
1006  return true;
1007 }
1008 
1009 // write odom_x field
1010 bool OdometryData::write_odom_x(const yarp::os::idl::WireWriter& writer) const
1011 {
1012  if (!writer.writeFloat64(odom_x)) {
1013  return false;
1014  }
1015  return true;
1016 }
1017 
1018 // read (nested) odom_x field
1019 bool OdometryData::nested_read_odom_x(yarp::os::idl::WireReader& reader)
1020 {
1021  if (!reader.readFloat64(odom_x)) {
1022  reader.fail();
1023  return false;
1024  }
1025  return true;
1026 }
1027 
1028 // write (nested) odom_x field
1029 bool OdometryData::nested_write_odom_x(const yarp::os::idl::WireWriter& writer) const
1030 {
1031  if (!writer.writeFloat64(odom_x)) {
1032  return false;
1033  }
1034  return true;
1035 }
1036 
1037 // read odom_y field
1038 bool OdometryData::read_odom_y(yarp::os::idl::WireReader& reader)
1039 {
1040  if (!reader.readFloat64(odom_y)) {
1041  reader.fail();
1042  return false;
1043  }
1044  return true;
1045 }
1046 
1047 // write odom_y field
1048 bool OdometryData::write_odom_y(const yarp::os::idl::WireWriter& writer) const
1049 {
1050  if (!writer.writeFloat64(odom_y)) {
1051  return false;
1052  }
1053  return true;
1054 }
1055 
1056 // read (nested) odom_y field
1057 bool OdometryData::nested_read_odom_y(yarp::os::idl::WireReader& reader)
1058 {
1059  if (!reader.readFloat64(odom_y)) {
1060  reader.fail();
1061  return false;
1062  }
1063  return true;
1064 }
1065 
1066 // write (nested) odom_y field
1067 bool OdometryData::nested_write_odom_y(const yarp::os::idl::WireWriter& writer) const
1068 {
1069  if (!writer.writeFloat64(odom_y)) {
1070  return false;
1071  }
1072  return true;
1073 }
1074 
1075 // read odom_theta field
1076 bool OdometryData::read_odom_theta(yarp::os::idl::WireReader& reader)
1077 {
1078  if (!reader.readFloat64(odom_theta)) {
1079  reader.fail();
1080  return false;
1081  }
1082  return true;
1083 }
1084 
1085 // write odom_theta field
1086 bool OdometryData::write_odom_theta(const yarp::os::idl::WireWriter& writer) const
1087 {
1088  if (!writer.writeFloat64(odom_theta)) {
1089  return false;
1090  }
1091  return true;
1092 }
1093 
1094 // read (nested) odom_theta field
1095 bool OdometryData::nested_read_odom_theta(yarp::os::idl::WireReader& reader)
1096 {
1097  if (!reader.readFloat64(odom_theta)) {
1098  reader.fail();
1099  return false;
1100  }
1101  return true;
1102 }
1103 
1104 // write (nested) odom_theta field
1105 bool OdometryData::nested_write_odom_theta(const yarp::os::idl::WireWriter& writer) const
1106 {
1107  if (!writer.writeFloat64(odom_theta)) {
1108  return false;
1109  }
1110  return true;
1111 }
1112 
1113 // read base_vel_x field
1114 bool OdometryData::read_base_vel_x(yarp::os::idl::WireReader& reader)
1115 {
1116  if (!reader.readFloat64(base_vel_x)) {
1117  reader.fail();
1118  return false;
1119  }
1120  return true;
1121 }
1122 
1123 // write base_vel_x field
1124 bool OdometryData::write_base_vel_x(const yarp::os::idl::WireWriter& writer) const
1125 {
1126  if (!writer.writeFloat64(base_vel_x)) {
1127  return false;
1128  }
1129  return true;
1130 }
1131 
1132 // read (nested) base_vel_x field
1133 bool OdometryData::nested_read_base_vel_x(yarp::os::idl::WireReader& reader)
1134 {
1135  if (!reader.readFloat64(base_vel_x)) {
1136  reader.fail();
1137  return false;
1138  }
1139  return true;
1140 }
1141 
1142 // write (nested) base_vel_x field
1143 bool OdometryData::nested_write_base_vel_x(const yarp::os::idl::WireWriter& writer) const
1144 {
1145  if (!writer.writeFloat64(base_vel_x)) {
1146  return false;
1147  }
1148  return true;
1149 }
1150 
1151 // read base_vel_y field
1152 bool OdometryData::read_base_vel_y(yarp::os::idl::WireReader& reader)
1153 {
1154  if (!reader.readFloat64(base_vel_y)) {
1155  reader.fail();
1156  return false;
1157  }
1158  return true;
1159 }
1160 
1161 // write base_vel_y field
1162 bool OdometryData::write_base_vel_y(const yarp::os::idl::WireWriter& writer) const
1163 {
1164  if (!writer.writeFloat64(base_vel_y)) {
1165  return false;
1166  }
1167  return true;
1168 }
1169 
1170 // read (nested) base_vel_y field
1171 bool OdometryData::nested_read_base_vel_y(yarp::os::idl::WireReader& reader)
1172 {
1173  if (!reader.readFloat64(base_vel_y)) {
1174  reader.fail();
1175  return false;
1176  }
1177  return true;
1178 }
1179 
1180 // write (nested) base_vel_y field
1181 bool OdometryData::nested_write_base_vel_y(const yarp::os::idl::WireWriter& writer) const
1182 {
1183  if (!writer.writeFloat64(base_vel_y)) {
1184  return false;
1185  }
1186  return true;
1187 }
1188 
1189 // read base_vel_theta field
1190 bool OdometryData::read_base_vel_theta(yarp::os::idl::WireReader& reader)
1191 {
1192  if (!reader.readFloat64(base_vel_theta)) {
1193  reader.fail();
1194  return false;
1195  }
1196  return true;
1197 }
1198 
1199 // write base_vel_theta field
1200 bool OdometryData::write_base_vel_theta(const yarp::os::idl::WireWriter& writer) const
1201 {
1202  if (!writer.writeFloat64(base_vel_theta)) {
1203  return false;
1204  }
1205  return true;
1206 }
1207 
1208 // read (nested) base_vel_theta field
1209 bool OdometryData::nested_read_base_vel_theta(yarp::os::idl::WireReader& reader)
1210 {
1211  if (!reader.readFloat64(base_vel_theta)) {
1212  reader.fail();
1213  return false;
1214  }
1215  return true;
1216 }
1217 
1218 // write (nested) base_vel_theta field
1219 bool OdometryData::nested_write_base_vel_theta(const yarp::os::idl::WireWriter& writer) const
1220 {
1221  if (!writer.writeFloat64(base_vel_theta)) {
1222  return false;
1223  }
1224  return true;
1225 }
1226 
1227 // read odom_vel_x field
1228 bool OdometryData::read_odom_vel_x(yarp::os::idl::WireReader& reader)
1229 {
1230  if (!reader.readFloat64(odom_vel_x)) {
1231  reader.fail();
1232  return false;
1233  }
1234  return true;
1235 }
1236 
1237 // write odom_vel_x field
1238 bool OdometryData::write_odom_vel_x(const yarp::os::idl::WireWriter& writer) const
1239 {
1240  if (!writer.writeFloat64(odom_vel_x)) {
1241  return false;
1242  }
1243  return true;
1244 }
1245 
1246 // read (nested) odom_vel_x field
1247 bool OdometryData::nested_read_odom_vel_x(yarp::os::idl::WireReader& reader)
1248 {
1249  if (!reader.readFloat64(odom_vel_x)) {
1250  reader.fail();
1251  return false;
1252  }
1253  return true;
1254 }
1255 
1256 // write (nested) odom_vel_x field
1257 bool OdometryData::nested_write_odom_vel_x(const yarp::os::idl::WireWriter& writer) const
1258 {
1259  if (!writer.writeFloat64(odom_vel_x)) {
1260  return false;
1261  }
1262  return true;
1263 }
1264 
1265 // read odom_vel_y field
1266 bool OdometryData::read_odom_vel_y(yarp::os::idl::WireReader& reader)
1267 {
1268  if (!reader.readFloat64(odom_vel_y)) {
1269  reader.fail();
1270  return false;
1271  }
1272  return true;
1273 }
1274 
1275 // write odom_vel_y field
1276 bool OdometryData::write_odom_vel_y(const yarp::os::idl::WireWriter& writer) const
1277 {
1278  if (!writer.writeFloat64(odom_vel_y)) {
1279  return false;
1280  }
1281  return true;
1282 }
1283 
1284 // read (nested) odom_vel_y field
1285 bool OdometryData::nested_read_odom_vel_y(yarp::os::idl::WireReader& reader)
1286 {
1287  if (!reader.readFloat64(odom_vel_y)) {
1288  reader.fail();
1289  return false;
1290  }
1291  return true;
1292 }
1293 
1294 // write (nested) odom_vel_y field
1295 bool OdometryData::nested_write_odom_vel_y(const yarp::os::idl::WireWriter& writer) const
1296 {
1297  if (!writer.writeFloat64(odom_vel_y)) {
1298  return false;
1299  }
1300  return true;
1301 }
1302 
1303 // read odom_vel_theta field
1304 bool OdometryData::read_odom_vel_theta(yarp::os::idl::WireReader& reader)
1305 {
1306  if (!reader.readFloat64(odom_vel_theta)) {
1307  reader.fail();
1308  return false;
1309  }
1310  return true;
1311 }
1312 
1313 // write odom_vel_theta field
1314 bool OdometryData::write_odom_vel_theta(const yarp::os::idl::WireWriter& writer) const
1315 {
1316  if (!writer.writeFloat64(odom_vel_theta)) {
1317  return false;
1318  }
1319  return true;
1320 }
1321 
1322 // read (nested) odom_vel_theta field
1323 bool OdometryData::nested_read_odom_vel_theta(yarp::os::idl::WireReader& reader)
1324 {
1325  if (!reader.readFloat64(odom_vel_theta)) {
1326  reader.fail();
1327  return false;
1328  }
1329  return true;
1330 }
1331 
1332 // write (nested) odom_vel_theta field
1333 bool OdometryData::nested_write_odom_vel_theta(const yarp::os::idl::WireWriter& writer) const
1334 {
1335  if (!writer.writeFloat64(odom_vel_theta)) {
1336  return false;
1337  }
1338  return true;
1339 }
1340 
1341 } // namespace yarp
1342 } // namespace dev
yarp::dev::OdometryData::Editor::write
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: OdometryData.cpp:725
yarp::dev::OdometryData::Editor::set_base_vel_x
void set_base_vel_x(const double base_vel_x)
Definition: OdometryData.cpp:301
yarp::os::Bottle
A simple collection of objects that can be described and transmitted in a portable way.
Definition: Bottle.h:73
yarp::dev::OdometryData::odom_vel_x
double odom_vel_x
velocity of the robot [m/s] expressed in the world reference frame
Definition: OdometryData.h:57
yarp::os::Bottle::toString
std::string toString() const override
Gives a human-readable textual representation of the bottle.
Definition: Bottle.cpp:214
yarp::dev::OdometryData::Editor::stop_editing
void stop_editing()
Definition: OdometryData.cpp:209
yarp::os::idl::WireReader::readString
bool readString(std::string &str, bool *is_vocab=nullptr)
Definition: WireReader.cpp:339
yarp::os::createVocab
constexpr yarp::conf::vocab32_t createVocab(char a, char b=0, char c=0, char d=0)
Definition: Vocab.h:22
yarp::dev::OdometryData::odom_vel_theta
double odom_vel_theta
angular velocity of the robot [deg/s] expressed in the world reference frame
Definition: OdometryData.h:65
yarp::dev::OdometryData::read
bool read(yarp::os::idl::WireReader &reader) override
Definition: OdometryData.cpp:58
yarp::dev::OdometryData::Editor::edit
bool edit(OdometryData &obj, bool dirty=true)
Definition: OdometryData.cpp:179
yarp::dev::OdometryData::base_vel_theta
double base_vel_theta
angular velocity of the robot [deg/s] expressed in the robot reference frame
Definition: OdometryData.h:53
yarp::dev::OdometryData::Editor::get_odom_vel_y
double get_odom_vel_y() const
Definition: OdometryData.cpp:423
yarp::dev::OdometryData::Editor::will_set_odom_theta
virtual bool will_set_odom_theta()
Definition: OdometryData.cpp:289
yarp::os::idl::WireWriter::writeFloat64
bool writeFloat64(yarp::conf::float64_t x) const
Definition: WireWriter.cpp:117
yarp::dev::OdometryData::odom_vel_y
double odom_vel_y
velocity of the robot [m/s] expressed in the world reference frame
Definition: OdometryData.h:61
yarp::os::Time::isValid
bool isValid()
Check if time is valid (non-zero).
Definition: Time.cpp:317
yarp::dev::OdometryData::base_vel_y
double base_vel_y
velocity of the robot [m/s] expressed in the robot reference frame
Definition: OdometryData.h:49
yarp::dev::OdometryData::Editor::set_odom_y
void set_odom_y(const double odom_y)
Definition: OdometryData.cpp:245
yarp::dev::OdometryData::Editor::did_set_odom_vel_x
virtual bool did_set_odom_vel_x()
Definition: OdometryData.cpp:407
yarp::dev::OdometryData::Editor::start_editing
void start_editing()
Definition: OdometryData.cpp:203
yarp::os::idl::WireWriter::writeString
bool writeString(const std::string &tag) const
Definition: WireWriter.cpp:166
yarp::dev::OdometryData::toString
std::string toString() const
Definition: OdometryData.cpp:144
yarp::dev::OdometryData::Editor::did_set_base_vel_theta
virtual bool did_set_base_vel_theta()
Definition: OdometryData.cpp:379
yarp::os::idl::WireWriter::isNull
bool isNull() const
Definition: WireWriter.cpp:50
yarp::dev::OdometryData::Editor::set_base_vel_theta
void set_base_vel_theta(const double base_vel_theta)
Definition: OdometryData.cpp:357
yarp::dev::OdometryData::Editor::will_set_odom_y
virtual bool will_set_odom_y()
Definition: OdometryData.cpp:261
yarp::dev::OdometryData::Editor::get_odom_vel_x
double get_odom_vel_x() const
Definition: OdometryData.cpp:395
yarp::os::idl::WireWriter::isError
bool isError() const
Definition: WireWriter.cpp:136
yarp::dev::OdometryData::Editor::did_set_odom_vel_theta
virtual bool did_set_odom_vel_theta()
Definition: OdometryData.cpp:463
yarp::dev::OdometryData::Editor::get_odom_x
double get_odom_x() const
Definition: OdometryData.cpp:227
yarp::os::idl::WireWriter::writeListHeader
bool writeListHeader(int len) const
Definition: WireWriter.cpp:183
yarp::dev::OdometryData
Definition: OdometryData.h:27
yarp::dev::OdometryData::base_vel_x
double base_vel_x
velocity of the robot [m/s] expressed in the robot reference frame
Definition: OdometryData.h:45
yarp::os::idl::WireWriter
IDL-friendly connection writer.
Definition: WireWriter.h:33
yarp::dev::OdometryData::Editor::did_set_odom_y
virtual bool did_set_odom_y()
Definition: OdometryData.cpp:267
yarp::dev::OdometryData::Editor::get_base_vel_y
double get_base_vel_y() const
Definition: OdometryData.cpp:339
yarp::dev::OdometryData::Editor::get_odom_y
double get_odom_y() const
Definition: OdometryData.cpp:255
yarp::dev::OdometryData::Editor::will_set_odom_vel_x
virtual bool will_set_odom_vel_x()
Definition: OdometryData.cpp:401
yarp::dev::OdometryData::Editor::get_odom_vel_theta
double get_odom_vel_theta() const
Definition: OdometryData.cpp:451
yarp::dev::OdometryData::Editor::will_set_base_vel_x
virtual bool will_set_base_vel_x()
Definition: OdometryData.cpp:317
yarp::os::ConnectionWriter
An interface for writing to a network connection.
Definition: ConnectionWriter.h:40
yarp::os::idl::WireReader::expectAccept
void expectAccept()
Definition: WireReader.cpp:43
yarp::dev::OdometryData::Editor::set_base_vel_y
void set_base_vel_y(const double base_vel_y)
Definition: OdometryData.cpp:329
yarp::dev::OdometryData::odom_theta
double odom_theta
orientation the robot [deg], expressed in the world reference frame
Definition: OdometryData.h:41
yarp::dev::OdometryData::write
bool write(const yarp::os::idl::WireWriter &writer) const override
Definition: OdometryData.cpp:101
yarp::dev::OdometryData::Editor::get_odom_theta
double get_odom_theta() const
Definition: OdometryData.cpp:283
yarp::dev::OdometryData::Editor::Editor
Editor()
Definition: OdometryData.cpp:152
yarp::dev::OdometryData::Editor::will_set_odom_vel_theta
virtual bool will_set_odom_vel_theta()
Definition: OdometryData.cpp:457
yarp::dev::OdometryData::Editor::did_set_odom_theta
virtual bool did_set_odom_theta()
Definition: OdometryData.cpp:295
yarp::dev::OdometryData::Editor::will_set_odom_x
virtual bool will_set_odom_x()
Definition: OdometryData.cpp:233
yarp::dev::OdometryData::Editor::did_set_odom_vel_y
virtual bool did_set_odom_vel_y()
Definition: OdometryData.cpp:435
yarp::dev::OdometryData::Editor::set_odom_vel_y
void set_odom_vel_y(const double odom_vel_y)
Definition: OdometryData.cpp:413
yarp::dev::OdometryData::Editor::did_set_base_vel_x
virtual bool did_set_base_vel_x()
Definition: OdometryData.cpp:323
yarp::dev::OdometryData::Editor::did_set_base_vel_y
virtual bool did_set_base_vel_y()
Definition: OdometryData.cpp:351
yarp::dev::OdometryData::Editor::~Editor
~Editor() override
Definition: OdometryData.cpp:171
yarp::os::idl::WireWriter::writeTag
bool writeTag(const char *tag, int split, int len) const
Definition: WireWriter.cpp:141
yarp::dev::OdometryData::Editor::did_set_odom_x
virtual bool did_set_odom_x()
Definition: OdometryData.cpp:239
yarp::os::idl::WireReader
IDL-friendly connection reader.
Definition: WireReader.h:33
yarp::os::ConnectionReader
An interface for reading from a network connection.
Definition: ConnectionReader.h:40
yarp::os::idl::WireReader::fail
void fail()
Definition: WireReader.cpp:74
yarp::dev::OdometryData::Editor::set_odom_x
void set_odom_x(const double odom_x)
Definition: OdometryData.cpp:217
yarp::os::Wire::yarp
yarp::os::WireLink & yarp()
Get YARP state associated with this object.
Definition: Wire.h:34
yarp::dev::OdometryData::Editor::isValid
bool isValid() const
Definition: OdometryData.cpp:191
yarp::os::idl::WireWriter::writeVocab
bool writeVocab(std::int32_t x) const
Definition: WireWriter.cpp:124
yarp::os::idl::WireReader::accept
void accept()
Definition: WireReader.cpp:49
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::dev::OdometryData::Editor::clean
void clean()
Definition: OdometryData.cpp:469
yarp::dev::OdometryData::Editor::set_odom_vel_x
void set_odom_vel_x(const double odom_vel_x)
Definition: OdometryData.cpp:385
yarp::dev::OdometryData::Editor::will_set_base_vel_y
virtual bool will_set_base_vel_y()
Definition: OdometryData.cpp:345
yarp::dev::OdometryData::odom_y
double odom_y
position of the robot [m], expressed in the world reference frame
Definition: OdometryData.h:37
yarp::dev::OdometryData::Editor::get_base_vel_theta
double get_base_vel_theta() const
Definition: OdometryData.cpp:367
yarp::dev::OdometryData::Editor::will_set_odom_vel_y
virtual bool will_set_odom_vel_y()
Definition: OdometryData.cpp:429
yarp::os::Bottle::read
bool read(ConnectionReader &reader) override
Set the bottle's value based on input from a network connection.
Definition: Bottle.cpp:243
yarp::dev::OdometryData::odom_x
double odom_x
position of the robot [m], expressed in the world reference frame
Definition: OdometryData.h:33
yarp::dev::OdometryData::Editor::read
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: OdometryData.cpp:475
yarp::os::idl::WireReader::getLength
int getLength() const
Definition: WireReader.h:153
yarp::dev::OdometryData::Editor::will_set_base_vel_theta
virtual bool will_set_base_vel_theta()
Definition: OdometryData.cpp:373
yarp::os::idl::WireReader::readFloat64
bool readFloat64(yarp::conf::float64_t &x)
Definition: WireReader.cpp:279
yarp::dev::OdometryData::Editor::set_odom_vel_theta
void set_odom_vel_theta(const double odom_vel_theta)
Definition: OdometryData.cpp:441
yarp::dev::OdometryData::Editor::set_odom_theta
void set_odom_theta(const double odom_theta)
Definition: OdometryData.cpp:273
yarp::dev::OdometryData::Editor::get_base_vel_x
double get_base_vel_x() const
Definition: OdometryData.cpp:311
yarp::dev::OdometryData::Editor::state
OdometryData & state()
Definition: OdometryData.cpp:197
OdometryData.h
yarp::os::idl::WireReader::readListHeader
bool readListHeader()
Definition: WireReader.cpp:470
yarp::dev::OdometryData::OdometryData
OdometryData()
Definition: OdometryData.cpp:20
yarp::os::idl::WireReader::isError
bool isError()
Definition: WireReader.cpp:547