YARP
Yet Another Robot Platform
SensorStreamingData.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 
11 #include <SensorStreamingData.h>
12 
13 // Default constructor
15  WirePortable(),
23  EncoderArrays(),
24  SkinPatches(),
26 {
27 }
28 
29 // Constructor with field values
40  WirePortable(),
51 {
52 }
53 
54 // Read structure on a Wire
56 {
57  if (!read_ThreeAxisGyroscopes(reader)) {
58  return false;
59  }
60  if (!read_ThreeAxisLinearAccelerometers(reader)) {
61  return false;
62  }
63  if (!read_ThreeAxisMagnetometers(reader)) {
64  return false;
65  }
66  if (!read_OrientationSensors(reader)) {
67  return false;
68  }
69  if (!read_TemperatureSensors(reader)) {
70  return false;
71  }
72  if (!read_SixAxisForceTorqueSensors(reader)) {
73  return false;
74  }
75  if (!read_ContactLoadCellArrays(reader)) {
76  return false;
77  }
78  if (!read_EncoderArrays(reader)) {
79  return false;
80  }
81  if (!read_SkinPatches(reader)) {
82  return false;
83  }
84  if (!read_PositionSensors(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(10)) {
95  return false;
96  }
97  return read(reader);
98 }
99 
100 // Write structure on a Wire
102 {
103  if (!write_ThreeAxisGyroscopes(writer)) {
104  return false;
105  }
106  if (!write_ThreeAxisLinearAccelerometers(writer)) {
107  return false;
108  }
109  if (!write_ThreeAxisMagnetometers(writer)) {
110  return false;
111  }
112  if (!write_OrientationSensors(writer)) {
113  return false;
114  }
115  if (!write_TemperatureSensors(writer)) {
116  return false;
117  }
118  if (!write_SixAxisForceTorqueSensors(writer)) {
119  return false;
120  }
121  if (!write_ContactLoadCellArrays(writer)) {
122  return false;
123  }
124  if (!write_EncoderArrays(writer)) {
125  return false;
126  }
127  if (!write_SkinPatches(writer)) {
128  return false;
129  }
130  if (!write_PositionSensors(writer)) {
131  return false;
132  }
133  return !writer.isError();
134 }
135 
136 // Write structure on a Connection
138 {
139  yarp::os::idl::WireWriter writer(connection);
140  if (!writer.writeListHeader(10)) {
141  return false;
142  }
143  return write(writer);
144 }
145 
146 // Convert to a printable string
147 std::string SensorStreamingData::toString() const
148 {
150  b.read(*this);
151  return b.toString();
152 }
153 
154 // Editor: default constructor
156 {
157  group = 0;
158  obj_owned = true;
159  obj = new SensorStreamingData;
160  dirty_flags(false);
161  yarp().setOwner(*this);
162 }
163 
164 // Editor: constructor with base class
166 {
167  group = 0;
168  obj_owned = false;
169  edit(obj, false);
170  yarp().setOwner(*this);
171 }
172 
173 // Editor: destructor
175 {
176  if (obj_owned) {
177  delete obj;
178  }
179 }
180 
181 // Editor: edit
183 {
184  if (obj_owned) {
185  delete this->obj;
186  }
187  this->obj = &obj;
188  obj_owned = false;
189  dirty_flags(dirty);
190  return true;
191 }
192 
193 // Editor: validity check
195 {
196  return obj != nullptr;
197 }
198 
199 // Editor: state
201 {
202  return *obj;
203 }
204 
205 // Editor: grouping begin
207 {
208  group++;
209 }
210 
211 // Editor: grouping end
213 {
214  group--;
215  if (group == 0 && is_dirty) {
216  communicate();
217  }
218 }
219 // Editor: ThreeAxisGyroscopes setter
221 {
222  will_set_ThreeAxisGyroscopes();
223  obj->ThreeAxisGyroscopes = ThreeAxisGyroscopes;
224  mark_dirty_ThreeAxisGyroscopes();
225  communicate();
226  did_set_ThreeAxisGyroscopes();
227 }
228 
229 // Editor: ThreeAxisGyroscopes getter
231 {
232  return obj->ThreeAxisGyroscopes;
233 }
234 
235 // Editor: ThreeAxisGyroscopes will_set
237 {
238  return true;
239 }
240 
241 // Editor: ThreeAxisGyroscopes did_set
243 {
244  return true;
245 }
246 
247 // Editor: ThreeAxisLinearAccelerometers setter
249 {
250  will_set_ThreeAxisLinearAccelerometers();
251  obj->ThreeAxisLinearAccelerometers = ThreeAxisLinearAccelerometers;
252  mark_dirty_ThreeAxisLinearAccelerometers();
253  communicate();
254  did_set_ThreeAxisLinearAccelerometers();
255 }
256 
257 // Editor: ThreeAxisLinearAccelerometers getter
259 {
260  return obj->ThreeAxisLinearAccelerometers;
261 }
262 
263 // Editor: ThreeAxisLinearAccelerometers will_set
265 {
266  return true;
267 }
268 
269 // Editor: ThreeAxisLinearAccelerometers did_set
271 {
272  return true;
273 }
274 
275 // Editor: ThreeAxisMagnetometers setter
277 {
278  will_set_ThreeAxisMagnetometers();
279  obj->ThreeAxisMagnetometers = ThreeAxisMagnetometers;
280  mark_dirty_ThreeAxisMagnetometers();
281  communicate();
282  did_set_ThreeAxisMagnetometers();
283 }
284 
285 // Editor: ThreeAxisMagnetometers getter
287 {
288  return obj->ThreeAxisMagnetometers;
289 }
290 
291 // Editor: ThreeAxisMagnetometers will_set
293 {
294  return true;
295 }
296 
297 // Editor: ThreeAxisMagnetometers did_set
299 {
300  return true;
301 }
302 
303 // Editor: OrientationSensors setter
305 {
306  will_set_OrientationSensors();
307  obj->OrientationSensors = OrientationSensors;
308  mark_dirty_OrientationSensors();
309  communicate();
310  did_set_OrientationSensors();
311 }
312 
313 // Editor: OrientationSensors getter
315 {
316  return obj->OrientationSensors;
317 }
318 
319 // Editor: OrientationSensors will_set
321 {
322  return true;
323 }
324 
325 // Editor: OrientationSensors did_set
327 {
328  return true;
329 }
330 
331 // Editor: TemperatureSensors setter
333 {
334  will_set_TemperatureSensors();
335  obj->TemperatureSensors = TemperatureSensors;
336  mark_dirty_TemperatureSensors();
337  communicate();
338  did_set_TemperatureSensors();
339 }
340 
341 // Editor: TemperatureSensors getter
343 {
344  return obj->TemperatureSensors;
345 }
346 
347 // Editor: TemperatureSensors will_set
349 {
350  return true;
351 }
352 
353 // Editor: TemperatureSensors did_set
355 {
356  return true;
357 }
358 
359 // Editor: SixAxisForceTorqueSensors setter
361 {
362  will_set_SixAxisForceTorqueSensors();
363  obj->SixAxisForceTorqueSensors = SixAxisForceTorqueSensors;
364  mark_dirty_SixAxisForceTorqueSensors();
365  communicate();
366  did_set_SixAxisForceTorqueSensors();
367 }
368 
369 // Editor: SixAxisForceTorqueSensors getter
371 {
372  return obj->SixAxisForceTorqueSensors;
373 }
374 
375 // Editor: SixAxisForceTorqueSensors will_set
377 {
378  return true;
379 }
380 
381 // Editor: SixAxisForceTorqueSensors did_set
383 {
384  return true;
385 }
386 
387 // Editor: ContactLoadCellArrays setter
389 {
390  will_set_ContactLoadCellArrays();
391  obj->ContactLoadCellArrays = ContactLoadCellArrays;
392  mark_dirty_ContactLoadCellArrays();
393  communicate();
394  did_set_ContactLoadCellArrays();
395 }
396 
397 // Editor: ContactLoadCellArrays getter
399 {
400  return obj->ContactLoadCellArrays;
401 }
402 
403 // Editor: ContactLoadCellArrays will_set
405 {
406  return true;
407 }
408 
409 // Editor: ContactLoadCellArrays did_set
411 {
412  return true;
413 }
414 
415 // Editor: EncoderArrays setter
417 {
418  will_set_EncoderArrays();
419  obj->EncoderArrays = EncoderArrays;
420  mark_dirty_EncoderArrays();
421  communicate();
422  did_set_EncoderArrays();
423 }
424 
425 // Editor: EncoderArrays getter
427 {
428  return obj->EncoderArrays;
429 }
430 
431 // Editor: EncoderArrays will_set
433 {
434  return true;
435 }
436 
437 // Editor: EncoderArrays did_set
439 {
440  return true;
441 }
442 
443 // Editor: SkinPatches setter
445 {
446  will_set_SkinPatches();
447  obj->SkinPatches = SkinPatches;
448  mark_dirty_SkinPatches();
449  communicate();
450  did_set_SkinPatches();
451 }
452 
453 // Editor: SkinPatches getter
455 {
456  return obj->SkinPatches;
457 }
458 
459 // Editor: SkinPatches will_set
461 {
462  return true;
463 }
464 
465 // Editor: SkinPatches did_set
467 {
468  return true;
469 }
470 
471 // Editor: PositionSensors setter
473 {
474  will_set_PositionSensors();
475  obj->PositionSensors = PositionSensors;
476  mark_dirty_PositionSensors();
477  communicate();
478  did_set_PositionSensors();
479 }
480 
481 // Editor: PositionSensors getter
483 {
484  return obj->PositionSensors;
485 }
486 
487 // Editor: PositionSensors will_set
489 {
490  return true;
491 }
492 
493 // Editor: PositionSensors did_set
495 {
496  return true;
497 }
498 
499 // Editor: clean
501 {
502  dirty_flags(false);
503 }
504 
505 // Editor: read
507 {
508  if (!isValid()) {
509  return false;
510  }
511  yarp::os::idl::WireReader reader(connection);
512  reader.expectAccept();
513  if (!reader.readListHeader()) {
514  return false;
515  }
516  int len = reader.getLength();
517  if (len == 0) {
518  yarp::os::idl::WireWriter writer(reader);
519  if (writer.isNull()) {
520  return true;
521  }
522  if (!writer.writeListHeader(1)) {
523  return false;
524  }
525  writer.writeString("send: 'help' or 'patch (param1 val1) (param2 val2)'");
526  return true;
527  }
528  std::string tag;
529  if (!reader.readString(tag)) {
530  return false;
531  }
532  if (tag == "help") {
533  yarp::os::idl::WireWriter writer(reader);
534  if (writer.isNull()) {
535  return true;
536  }
537  if (!writer.writeListHeader(2)) {
538  return false;
539  }
540  if (!writer.writeTag("many", 1, 0)) {
541  return false;
542  }
543  if (reader.getLength() > 0) {
544  std::string field;
545  if (!reader.readString(field)) {
546  return false;
547  }
548  if (field == "ThreeAxisGyroscopes") {
549  if (!writer.writeListHeader(1)) {
550  return false;
551  }
552  if (!writer.writeString("SensorMeasurements ThreeAxisGyroscopes")) {
553  return false;
554  }
555  }
556  if (field == "ThreeAxisLinearAccelerometers") {
557  if (!writer.writeListHeader(1)) {
558  return false;
559  }
560  if (!writer.writeString("SensorMeasurements ThreeAxisLinearAccelerometers")) {
561  return false;
562  }
563  }
564  if (field == "ThreeAxisMagnetometers") {
565  if (!writer.writeListHeader(1)) {
566  return false;
567  }
568  if (!writer.writeString("SensorMeasurements ThreeAxisMagnetometers")) {
569  return false;
570  }
571  }
572  if (field == "OrientationSensors") {
573  if (!writer.writeListHeader(1)) {
574  return false;
575  }
576  if (!writer.writeString("SensorMeasurements OrientationSensors")) {
577  return false;
578  }
579  }
580  if (field == "TemperatureSensors") {
581  if (!writer.writeListHeader(1)) {
582  return false;
583  }
584  if (!writer.writeString("SensorMeasurements TemperatureSensors")) {
585  return false;
586  }
587  }
588  if (field == "SixAxisForceTorqueSensors") {
589  if (!writer.writeListHeader(1)) {
590  return false;
591  }
592  if (!writer.writeString("SensorMeasurements SixAxisForceTorqueSensors")) {
593  return false;
594  }
595  }
596  if (field == "ContactLoadCellArrays") {
597  if (!writer.writeListHeader(1)) {
598  return false;
599  }
600  if (!writer.writeString("SensorMeasurements ContactLoadCellArrays")) {
601  return false;
602  }
603  }
604  if (field == "EncoderArrays") {
605  if (!writer.writeListHeader(1)) {
606  return false;
607  }
608  if (!writer.writeString("SensorMeasurements EncoderArrays")) {
609  return false;
610  }
611  }
612  if (field == "SkinPatches") {
613  if (!writer.writeListHeader(1)) {
614  return false;
615  }
616  if (!writer.writeString("SensorMeasurements SkinPatches")) {
617  return false;
618  }
619  }
620  if (field == "PositionSensors") {
621  if (!writer.writeListHeader(1)) {
622  return false;
623  }
624  if (!writer.writeString("SensorMeasurements PositionSensors")) {
625  return false;
626  }
627  }
628  }
629  if (!writer.writeListHeader(11)) {
630  return false;
631  }
632  writer.writeString("*** Available fields:");
633  writer.writeString("ThreeAxisGyroscopes");
634  writer.writeString("ThreeAxisLinearAccelerometers");
635  writer.writeString("ThreeAxisMagnetometers");
636  writer.writeString("OrientationSensors");
637  writer.writeString("TemperatureSensors");
638  writer.writeString("SixAxisForceTorqueSensors");
639  writer.writeString("ContactLoadCellArrays");
640  writer.writeString("EncoderArrays");
641  writer.writeString("SkinPatches");
642  writer.writeString("PositionSensors");
643  return true;
644  }
645  bool nested = true;
646  bool have_act = false;
647  if (tag != "patch") {
648  if (((len - 1) % 2) != 0) {
649  return false;
650  }
651  len = 1 + ((len - 1) / 2);
652  nested = false;
653  have_act = true;
654  }
655  for (int i = 1; i < len; ++i) {
656  if (nested && !reader.readListHeader(3)) {
657  return false;
658  }
659  std::string act;
660  std::string key;
661  if (have_act) {
662  act = tag;
663  } else if (!reader.readString(act)) {
664  return false;
665  }
666  if (!reader.readString(key)) {
667  return false;
668  }
669  if (key == "ThreeAxisGyroscopes") {
670  will_set_ThreeAxisGyroscopes();
671  if (!obj->nested_read_ThreeAxisGyroscopes(reader)) {
672  return false;
673  }
674  did_set_ThreeAxisGyroscopes();
675  } else if (key == "ThreeAxisLinearAccelerometers") {
676  will_set_ThreeAxisLinearAccelerometers();
677  if (!obj->nested_read_ThreeAxisLinearAccelerometers(reader)) {
678  return false;
679  }
680  did_set_ThreeAxisLinearAccelerometers();
681  } else if (key == "ThreeAxisMagnetometers") {
682  will_set_ThreeAxisMagnetometers();
683  if (!obj->nested_read_ThreeAxisMagnetometers(reader)) {
684  return false;
685  }
686  did_set_ThreeAxisMagnetometers();
687  } else if (key == "OrientationSensors") {
688  will_set_OrientationSensors();
689  if (!obj->nested_read_OrientationSensors(reader)) {
690  return false;
691  }
692  did_set_OrientationSensors();
693  } else if (key == "TemperatureSensors") {
694  will_set_TemperatureSensors();
695  if (!obj->nested_read_TemperatureSensors(reader)) {
696  return false;
697  }
698  did_set_TemperatureSensors();
699  } else if (key == "SixAxisForceTorqueSensors") {
700  will_set_SixAxisForceTorqueSensors();
701  if (!obj->nested_read_SixAxisForceTorqueSensors(reader)) {
702  return false;
703  }
704  did_set_SixAxisForceTorqueSensors();
705  } else if (key == "ContactLoadCellArrays") {
706  will_set_ContactLoadCellArrays();
707  if (!obj->nested_read_ContactLoadCellArrays(reader)) {
708  return false;
709  }
710  did_set_ContactLoadCellArrays();
711  } else if (key == "EncoderArrays") {
712  will_set_EncoderArrays();
713  if (!obj->nested_read_EncoderArrays(reader)) {
714  return false;
715  }
716  did_set_EncoderArrays();
717  } else if (key == "SkinPatches") {
718  will_set_SkinPatches();
719  if (!obj->nested_read_SkinPatches(reader)) {
720  return false;
721  }
722  did_set_SkinPatches();
723  } else if (key == "PositionSensors") {
724  will_set_PositionSensors();
725  if (!obj->nested_read_PositionSensors(reader)) {
726  return false;
727  }
728  did_set_PositionSensors();
729  } else {
730  // would be useful to have a fallback here
731  }
732  }
733  reader.accept();
734  yarp::os::idl::WireWriter writer(reader);
735  if (writer.isNull()) {
736  return true;
737  }
738  writer.writeListHeader(1);
739  writer.writeVocab32('o', 'k');
740  return true;
741 }
742 
743 // Editor: write
745 {
746  if (!isValid()) {
747  return false;
748  }
749  yarp::os::idl::WireWriter writer(connection);
750  if (!writer.writeListHeader(dirty_count + 1)) {
751  return false;
752  }
753  if (!writer.writeString("patch")) {
754  return false;
755  }
756  if (is_dirty_ThreeAxisGyroscopes) {
757  if (!writer.writeListHeader(3)) {
758  return false;
759  }
760  if (!writer.writeString("set")) {
761  return false;
762  }
763  if (!writer.writeString("ThreeAxisGyroscopes")) {
764  return false;
765  }
766  if (!obj->nested_write_ThreeAxisGyroscopes(writer)) {
767  return false;
768  }
769  }
770  if (is_dirty_ThreeAxisLinearAccelerometers) {
771  if (!writer.writeListHeader(3)) {
772  return false;
773  }
774  if (!writer.writeString("set")) {
775  return false;
776  }
777  if (!writer.writeString("ThreeAxisLinearAccelerometers")) {
778  return false;
779  }
780  if (!obj->nested_write_ThreeAxisLinearAccelerometers(writer)) {
781  return false;
782  }
783  }
784  if (is_dirty_ThreeAxisMagnetometers) {
785  if (!writer.writeListHeader(3)) {
786  return false;
787  }
788  if (!writer.writeString("set")) {
789  return false;
790  }
791  if (!writer.writeString("ThreeAxisMagnetometers")) {
792  return false;
793  }
794  if (!obj->nested_write_ThreeAxisMagnetometers(writer)) {
795  return false;
796  }
797  }
798  if (is_dirty_OrientationSensors) {
799  if (!writer.writeListHeader(3)) {
800  return false;
801  }
802  if (!writer.writeString("set")) {
803  return false;
804  }
805  if (!writer.writeString("OrientationSensors")) {
806  return false;
807  }
808  if (!obj->nested_write_OrientationSensors(writer)) {
809  return false;
810  }
811  }
812  if (is_dirty_TemperatureSensors) {
813  if (!writer.writeListHeader(3)) {
814  return false;
815  }
816  if (!writer.writeString("set")) {
817  return false;
818  }
819  if (!writer.writeString("TemperatureSensors")) {
820  return false;
821  }
822  if (!obj->nested_write_TemperatureSensors(writer)) {
823  return false;
824  }
825  }
826  if (is_dirty_SixAxisForceTorqueSensors) {
827  if (!writer.writeListHeader(3)) {
828  return false;
829  }
830  if (!writer.writeString("set")) {
831  return false;
832  }
833  if (!writer.writeString("SixAxisForceTorqueSensors")) {
834  return false;
835  }
836  if (!obj->nested_write_SixAxisForceTorqueSensors(writer)) {
837  return false;
838  }
839  }
840  if (is_dirty_ContactLoadCellArrays) {
841  if (!writer.writeListHeader(3)) {
842  return false;
843  }
844  if (!writer.writeString("set")) {
845  return false;
846  }
847  if (!writer.writeString("ContactLoadCellArrays")) {
848  return false;
849  }
850  if (!obj->nested_write_ContactLoadCellArrays(writer)) {
851  return false;
852  }
853  }
854  if (is_dirty_EncoderArrays) {
855  if (!writer.writeListHeader(3)) {
856  return false;
857  }
858  if (!writer.writeString("set")) {
859  return false;
860  }
861  if (!writer.writeString("EncoderArrays")) {
862  return false;
863  }
864  if (!obj->nested_write_EncoderArrays(writer)) {
865  return false;
866  }
867  }
868  if (is_dirty_SkinPatches) {
869  if (!writer.writeListHeader(3)) {
870  return false;
871  }
872  if (!writer.writeString("set")) {
873  return false;
874  }
875  if (!writer.writeString("SkinPatches")) {
876  return false;
877  }
878  if (!obj->nested_write_SkinPatches(writer)) {
879  return false;
880  }
881  }
882  if (is_dirty_PositionSensors) {
883  if (!writer.writeListHeader(3)) {
884  return false;
885  }
886  if (!writer.writeString("set")) {
887  return false;
888  }
889  if (!writer.writeString("PositionSensors")) {
890  return false;
891  }
892  if (!obj->nested_write_PositionSensors(writer)) {
893  return false;
894  }
895  }
896  return !writer.isError();
897 }
898 
899 // Editor: send if possible
900 void SensorStreamingData::Editor::communicate()
901 {
902  if (group != 0) {
903  return;
904  }
905  if (yarp().canWrite()) {
906  yarp().write(*this);
907  clean();
908  }
909 }
910 
911 // Editor: mark dirty overall
912 void SensorStreamingData::Editor::mark_dirty()
913 {
914  is_dirty = true;
915 }
916 
917 // Editor: ThreeAxisGyroscopes mark_dirty
918 void SensorStreamingData::Editor::mark_dirty_ThreeAxisGyroscopes()
919 {
920  if (is_dirty_ThreeAxisGyroscopes) {
921  return;
922  }
923  dirty_count++;
924  is_dirty_ThreeAxisGyroscopes = true;
925  mark_dirty();
926 }
927 
928 // Editor: ThreeAxisLinearAccelerometers mark_dirty
929 void SensorStreamingData::Editor::mark_dirty_ThreeAxisLinearAccelerometers()
930 {
931  if (is_dirty_ThreeAxisLinearAccelerometers) {
932  return;
933  }
934  dirty_count++;
935  is_dirty_ThreeAxisLinearAccelerometers = true;
936  mark_dirty();
937 }
938 
939 // Editor: ThreeAxisMagnetometers mark_dirty
940 void SensorStreamingData::Editor::mark_dirty_ThreeAxisMagnetometers()
941 {
942  if (is_dirty_ThreeAxisMagnetometers) {
943  return;
944  }
945  dirty_count++;
946  is_dirty_ThreeAxisMagnetometers = true;
947  mark_dirty();
948 }
949 
950 // Editor: OrientationSensors mark_dirty
951 void SensorStreamingData::Editor::mark_dirty_OrientationSensors()
952 {
953  if (is_dirty_OrientationSensors) {
954  return;
955  }
956  dirty_count++;
957  is_dirty_OrientationSensors = true;
958  mark_dirty();
959 }
960 
961 // Editor: TemperatureSensors mark_dirty
962 void SensorStreamingData::Editor::mark_dirty_TemperatureSensors()
963 {
964  if (is_dirty_TemperatureSensors) {
965  return;
966  }
967  dirty_count++;
968  is_dirty_TemperatureSensors = true;
969  mark_dirty();
970 }
971 
972 // Editor: SixAxisForceTorqueSensors mark_dirty
973 void SensorStreamingData::Editor::mark_dirty_SixAxisForceTorqueSensors()
974 {
975  if (is_dirty_SixAxisForceTorqueSensors) {
976  return;
977  }
978  dirty_count++;
979  is_dirty_SixAxisForceTorqueSensors = true;
980  mark_dirty();
981 }
982 
983 // Editor: ContactLoadCellArrays mark_dirty
984 void SensorStreamingData::Editor::mark_dirty_ContactLoadCellArrays()
985 {
986  if (is_dirty_ContactLoadCellArrays) {
987  return;
988  }
989  dirty_count++;
990  is_dirty_ContactLoadCellArrays = true;
991  mark_dirty();
992 }
993 
994 // Editor: EncoderArrays mark_dirty
995 void SensorStreamingData::Editor::mark_dirty_EncoderArrays()
996 {
997  if (is_dirty_EncoderArrays) {
998  return;
999  }
1000  dirty_count++;
1001  is_dirty_EncoderArrays = true;
1002  mark_dirty();
1003 }
1004 
1005 // Editor: SkinPatches mark_dirty
1006 void SensorStreamingData::Editor::mark_dirty_SkinPatches()
1007 {
1008  if (is_dirty_SkinPatches) {
1009  return;
1010  }
1011  dirty_count++;
1012  is_dirty_SkinPatches = true;
1013  mark_dirty();
1014 }
1015 
1016 // Editor: PositionSensors mark_dirty
1017 void SensorStreamingData::Editor::mark_dirty_PositionSensors()
1018 {
1019  if (is_dirty_PositionSensors) {
1020  return;
1021  }
1022  dirty_count++;
1023  is_dirty_PositionSensors = true;
1024  mark_dirty();
1025 }
1026 
1027 // Editor: dirty_flags
1028 void SensorStreamingData::Editor::dirty_flags(bool flag)
1029 {
1030  is_dirty = flag;
1031  is_dirty_ThreeAxisGyroscopes = flag;
1032  is_dirty_ThreeAxisLinearAccelerometers = flag;
1033  is_dirty_ThreeAxisMagnetometers = flag;
1034  is_dirty_OrientationSensors = flag;
1035  is_dirty_TemperatureSensors = flag;
1036  is_dirty_SixAxisForceTorqueSensors = flag;
1037  is_dirty_ContactLoadCellArrays = flag;
1038  is_dirty_EncoderArrays = flag;
1039  is_dirty_SkinPatches = flag;
1040  is_dirty_PositionSensors = flag;
1041  dirty_count = flag ? 10 : 0;
1042 }
1043 
1044 // read ThreeAxisGyroscopes field
1045 bool SensorStreamingData::read_ThreeAxisGyroscopes(yarp::os::idl::WireReader& reader)
1046 {
1047  if (!reader.read(ThreeAxisGyroscopes)) {
1048  reader.fail();
1049  return false;
1050  }
1051  return true;
1052 }
1053 
1054 // write ThreeAxisGyroscopes field
1055 bool SensorStreamingData::write_ThreeAxisGyroscopes(const yarp::os::idl::WireWriter& writer) const
1056 {
1057  if (!writer.write(ThreeAxisGyroscopes)) {
1058  return false;
1059  }
1060  return true;
1061 }
1062 
1063 // read (nested) ThreeAxisGyroscopes field
1064 bool SensorStreamingData::nested_read_ThreeAxisGyroscopes(yarp::os::idl::WireReader& reader)
1065 {
1066  if (!reader.readNested(ThreeAxisGyroscopes)) {
1067  reader.fail();
1068  return false;
1069  }
1070  return true;
1071 }
1072 
1073 // write (nested) ThreeAxisGyroscopes field
1074 bool SensorStreamingData::nested_write_ThreeAxisGyroscopes(const yarp::os::idl::WireWriter& writer) const
1075 {
1076  if (!writer.writeNested(ThreeAxisGyroscopes)) {
1077  return false;
1078  }
1079  return true;
1080 }
1081 
1082 // read ThreeAxisLinearAccelerometers field
1083 bool SensorStreamingData::read_ThreeAxisLinearAccelerometers(yarp::os::idl::WireReader& reader)
1084 {
1085  if (!reader.read(ThreeAxisLinearAccelerometers)) {
1086  reader.fail();
1087  return false;
1088  }
1089  return true;
1090 }
1091 
1092 // write ThreeAxisLinearAccelerometers field
1093 bool SensorStreamingData::write_ThreeAxisLinearAccelerometers(const yarp::os::idl::WireWriter& writer) const
1094 {
1095  if (!writer.write(ThreeAxisLinearAccelerometers)) {
1096  return false;
1097  }
1098  return true;
1099 }
1100 
1101 // read (nested) ThreeAxisLinearAccelerometers field
1102 bool SensorStreamingData::nested_read_ThreeAxisLinearAccelerometers(yarp::os::idl::WireReader& reader)
1103 {
1105  reader.fail();
1106  return false;
1107  }
1108  return true;
1109 }
1110 
1111 // write (nested) ThreeAxisLinearAccelerometers field
1112 bool SensorStreamingData::nested_write_ThreeAxisLinearAccelerometers(const yarp::os::idl::WireWriter& writer) const
1113 {
1115  return false;
1116  }
1117  return true;
1118 }
1119 
1120 // read ThreeAxisMagnetometers field
1121 bool SensorStreamingData::read_ThreeAxisMagnetometers(yarp::os::idl::WireReader& reader)
1122 {
1123  if (!reader.read(ThreeAxisMagnetometers)) {
1124  reader.fail();
1125  return false;
1126  }
1127  return true;
1128 }
1129 
1130 // write ThreeAxisMagnetometers field
1131 bool SensorStreamingData::write_ThreeAxisMagnetometers(const yarp::os::idl::WireWriter& writer) const
1132 {
1133  if (!writer.write(ThreeAxisMagnetometers)) {
1134  return false;
1135  }
1136  return true;
1137 }
1138 
1139 // read (nested) ThreeAxisMagnetometers field
1140 bool SensorStreamingData::nested_read_ThreeAxisMagnetometers(yarp::os::idl::WireReader& reader)
1141 {
1142  if (!reader.readNested(ThreeAxisMagnetometers)) {
1143  reader.fail();
1144  return false;
1145  }
1146  return true;
1147 }
1148 
1149 // write (nested) ThreeAxisMagnetometers field
1150 bool SensorStreamingData::nested_write_ThreeAxisMagnetometers(const yarp::os::idl::WireWriter& writer) const
1151 {
1152  if (!writer.writeNested(ThreeAxisMagnetometers)) {
1153  return false;
1154  }
1155  return true;
1156 }
1157 
1158 // read OrientationSensors field
1159 bool SensorStreamingData::read_OrientationSensors(yarp::os::idl::WireReader& reader)
1160 {
1161  if (!reader.read(OrientationSensors)) {
1162  reader.fail();
1163  return false;
1164  }
1165  return true;
1166 }
1167 
1168 // write OrientationSensors field
1169 bool SensorStreamingData::write_OrientationSensors(const yarp::os::idl::WireWriter& writer) const
1170 {
1171  if (!writer.write(OrientationSensors)) {
1172  return false;
1173  }
1174  return true;
1175 }
1176 
1177 // read (nested) OrientationSensors field
1178 bool SensorStreamingData::nested_read_OrientationSensors(yarp::os::idl::WireReader& reader)
1179 {
1180  if (!reader.readNested(OrientationSensors)) {
1181  reader.fail();
1182  return false;
1183  }
1184  return true;
1185 }
1186 
1187 // write (nested) OrientationSensors field
1188 bool SensorStreamingData::nested_write_OrientationSensors(const yarp::os::idl::WireWriter& writer) const
1189 {
1190  if (!writer.writeNested(OrientationSensors)) {
1191  return false;
1192  }
1193  return true;
1194 }
1195 
1196 // read TemperatureSensors field
1197 bool SensorStreamingData::read_TemperatureSensors(yarp::os::idl::WireReader& reader)
1198 {
1199  if (!reader.read(TemperatureSensors)) {
1200  reader.fail();
1201  return false;
1202  }
1203  return true;
1204 }
1205 
1206 // write TemperatureSensors field
1207 bool SensorStreamingData::write_TemperatureSensors(const yarp::os::idl::WireWriter& writer) const
1208 {
1209  if (!writer.write(TemperatureSensors)) {
1210  return false;
1211  }
1212  return true;
1213 }
1214 
1215 // read (nested) TemperatureSensors field
1216 bool SensorStreamingData::nested_read_TemperatureSensors(yarp::os::idl::WireReader& reader)
1217 {
1218  if (!reader.readNested(TemperatureSensors)) {
1219  reader.fail();
1220  return false;
1221  }
1222  return true;
1223 }
1224 
1225 // write (nested) TemperatureSensors field
1226 bool SensorStreamingData::nested_write_TemperatureSensors(const yarp::os::idl::WireWriter& writer) const
1227 {
1228  if (!writer.writeNested(TemperatureSensors)) {
1229  return false;
1230  }
1231  return true;
1232 }
1233 
1234 // read SixAxisForceTorqueSensors field
1235 bool SensorStreamingData::read_SixAxisForceTorqueSensors(yarp::os::idl::WireReader& reader)
1236 {
1237  if (!reader.read(SixAxisForceTorqueSensors)) {
1238  reader.fail();
1239  return false;
1240  }
1241  return true;
1242 }
1243 
1244 // write SixAxisForceTorqueSensors field
1245 bool SensorStreamingData::write_SixAxisForceTorqueSensors(const yarp::os::idl::WireWriter& writer) const
1246 {
1247  if (!writer.write(SixAxisForceTorqueSensors)) {
1248  return false;
1249  }
1250  return true;
1251 }
1252 
1253 // read (nested) SixAxisForceTorqueSensors field
1254 bool SensorStreamingData::nested_read_SixAxisForceTorqueSensors(yarp::os::idl::WireReader& reader)
1255 {
1256  if (!reader.readNested(SixAxisForceTorqueSensors)) {
1257  reader.fail();
1258  return false;
1259  }
1260  return true;
1261 }
1262 
1263 // write (nested) SixAxisForceTorqueSensors field
1264 bool SensorStreamingData::nested_write_SixAxisForceTorqueSensors(const yarp::os::idl::WireWriter& writer) const
1265 {
1266  if (!writer.writeNested(SixAxisForceTorqueSensors)) {
1267  return false;
1268  }
1269  return true;
1270 }
1271 
1272 // read ContactLoadCellArrays field
1273 bool SensorStreamingData::read_ContactLoadCellArrays(yarp::os::idl::WireReader& reader)
1274 {
1275  if (!reader.read(ContactLoadCellArrays)) {
1276  reader.fail();
1277  return false;
1278  }
1279  return true;
1280 }
1281 
1282 // write ContactLoadCellArrays field
1283 bool SensorStreamingData::write_ContactLoadCellArrays(const yarp::os::idl::WireWriter& writer) const
1284 {
1285  if (!writer.write(ContactLoadCellArrays)) {
1286  return false;
1287  }
1288  return true;
1289 }
1290 
1291 // read (nested) ContactLoadCellArrays field
1292 bool SensorStreamingData::nested_read_ContactLoadCellArrays(yarp::os::idl::WireReader& reader)
1293 {
1294  if (!reader.readNested(ContactLoadCellArrays)) {
1295  reader.fail();
1296  return false;
1297  }
1298  return true;
1299 }
1300 
1301 // write (nested) ContactLoadCellArrays field
1302 bool SensorStreamingData::nested_write_ContactLoadCellArrays(const yarp::os::idl::WireWriter& writer) const
1303 {
1304  if (!writer.writeNested(ContactLoadCellArrays)) {
1305  return false;
1306  }
1307  return true;
1308 }
1309 
1310 // read EncoderArrays field
1311 bool SensorStreamingData::read_EncoderArrays(yarp::os::idl::WireReader& reader)
1312 {
1313  if (!reader.read(EncoderArrays)) {
1314  reader.fail();
1315  return false;
1316  }
1317  return true;
1318 }
1319 
1320 // write EncoderArrays field
1321 bool SensorStreamingData::write_EncoderArrays(const yarp::os::idl::WireWriter& writer) const
1322 {
1323  if (!writer.write(EncoderArrays)) {
1324  return false;
1325  }
1326  return true;
1327 }
1328 
1329 // read (nested) EncoderArrays field
1330 bool SensorStreamingData::nested_read_EncoderArrays(yarp::os::idl::WireReader& reader)
1331 {
1332  if (!reader.readNested(EncoderArrays)) {
1333  reader.fail();
1334  return false;
1335  }
1336  return true;
1337 }
1338 
1339 // write (nested) EncoderArrays field
1340 bool SensorStreamingData::nested_write_EncoderArrays(const yarp::os::idl::WireWriter& writer) const
1341 {
1342  if (!writer.writeNested(EncoderArrays)) {
1343  return false;
1344  }
1345  return true;
1346 }
1347 
1348 // read SkinPatches field
1349 bool SensorStreamingData::read_SkinPatches(yarp::os::idl::WireReader& reader)
1350 {
1351  if (!reader.read(SkinPatches)) {
1352  reader.fail();
1353  return false;
1354  }
1355  return true;
1356 }
1357 
1358 // write SkinPatches field
1359 bool SensorStreamingData::write_SkinPatches(const yarp::os::idl::WireWriter& writer) const
1360 {
1361  if (!writer.write(SkinPatches)) {
1362  return false;
1363  }
1364  return true;
1365 }
1366 
1367 // read (nested) SkinPatches field
1368 bool SensorStreamingData::nested_read_SkinPatches(yarp::os::idl::WireReader& reader)
1369 {
1370  if (!reader.readNested(SkinPatches)) {
1371  reader.fail();
1372  return false;
1373  }
1374  return true;
1375 }
1376 
1377 // write (nested) SkinPatches field
1378 bool SensorStreamingData::nested_write_SkinPatches(const yarp::os::idl::WireWriter& writer) const
1379 {
1380  if (!writer.writeNested(SkinPatches)) {
1381  return false;
1382  }
1383  return true;
1384 }
1385 
1386 // read PositionSensors field
1387 bool SensorStreamingData::read_PositionSensors(yarp::os::idl::WireReader& reader)
1388 {
1389  if (!reader.read(PositionSensors)) {
1390  reader.fail();
1391  return false;
1392  }
1393  return true;
1394 }
1395 
1396 // write PositionSensors field
1397 bool SensorStreamingData::write_PositionSensors(const yarp::os::idl::WireWriter& writer) const
1398 {
1399  if (!writer.write(PositionSensors)) {
1400  return false;
1401  }
1402  return true;
1403 }
1404 
1405 // read (nested) PositionSensors field
1406 bool SensorStreamingData::nested_read_PositionSensors(yarp::os::idl::WireReader& reader)
1407 {
1408  if (!reader.readNested(PositionSensors)) {
1409  reader.fail();
1410  return false;
1411  }
1412  return true;
1413 }
1414 
1415 // write (nested) PositionSensors field
1416 bool SensorStreamingData::nested_write_PositionSensors(const yarp::os::idl::WireWriter& writer) const
1417 {
1418  if (!writer.writeNested(PositionSensors)) {
1419  return false;
1420  }
1421  return true;
1422 }
@ ThreeAxisLinearAccelerometers
void set_SkinPatches(const SensorMeasurements &SkinPatches)
void set_PositionSensors(const SensorMeasurements &PositionSensors)
const SensorMeasurements & get_SixAxisForceTorqueSensors() const
bool edit(SensorStreamingData &obj, bool dirty=true)
void set_EncoderArrays(const SensorMeasurements &EncoderArrays)
void set_ThreeAxisLinearAccelerometers(const SensorMeasurements &ThreeAxisLinearAccelerometers)
const SensorMeasurements & get_OrientationSensors() const
void set_SixAxisForceTorqueSensors(const SensorMeasurements &SixAxisForceTorqueSensors)
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
const SensorMeasurements & get_ThreeAxisMagnetometers() const
const SensorMeasurements & get_TemperatureSensors() const
const SensorMeasurements & get_PositionSensors() const
const SensorMeasurements & get_ContactLoadCellArrays() const
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
const SensorMeasurements & get_EncoderArrays() const
virtual bool will_set_ThreeAxisMagnetometers()
virtual bool will_set_SixAxisForceTorqueSensors()
void set_ThreeAxisMagnetometers(const SensorMeasurements &ThreeAxisMagnetometers)
virtual bool did_set_SixAxisForceTorqueSensors()
virtual bool will_set_ThreeAxisLinearAccelerometers()
SensorStreamingData & state()
void set_TemperatureSensors(const SensorMeasurements &TemperatureSensors)
void set_OrientationSensors(const SensorMeasurements &OrientationSensors)
const SensorMeasurements & get_ThreeAxisLinearAccelerometers() const
void set_ThreeAxisGyroscopes(const SensorMeasurements &ThreeAxisGyroscopes)
const SensorMeasurements & get_SkinPatches() const
virtual bool did_set_ThreeAxisLinearAccelerometers()
const SensorMeasurements & get_ThreeAxisGyroscopes() const
void set_ContactLoadCellArrays(const SensorMeasurements &ContactLoadCellArrays)
std::string toString() const
SensorMeasurements EncoderArrays
SensorMeasurements ThreeAxisLinearAccelerometers
SensorMeasurements PositionSensors
SensorMeasurements OrientationSensors
bool write(const yarp::os::idl::WireWriter &writer) const override
SensorMeasurements ThreeAxisMagnetometers
SensorMeasurements ThreeAxisGyroscopes
SensorMeasurements SixAxisForceTorqueSensors
SensorMeasurements SkinPatches
bool read(yarp::os::idl::WireReader &reader) override
SensorMeasurements ContactLoadCellArrays
SensorMeasurements TemperatureSensors
A simple collection of objects that can be described and transmitted in a portable way.
Definition: Bottle.h:74
bool read(ConnectionReader &reader) override
Set the bottle's value based on input from a network connection.
Definition: Bottle.cpp:240
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.
yarp::os::WireLink & yarp()
Get YARP state associated with this object.
Definition: Wire.h:29
IDL-friendly connection reader.
Definition: WireReader.h:30
bool readNested(WirePortable &obj)
Definition: WireReader.cpp:88
bool readString(std::string &str, bool *is_vocab=nullptr)
Definition: WireReader.cpp:382
bool read(WirePortable &obj)
Definition: WireReader.cpp:78
IDL-friendly connection writer.
Definition: WireWriter.h:30
bool writeVocab32(yarp::conf::vocab32_t x) const
Definition: WireWriter.cpp:141
bool write(const WirePortable &obj) const
Definition: WireWriter.cpp:52
bool writeListHeader(int len) const
Definition: WireWriter.cpp:206
bool writeTag(const char *tag, int split, int len) const
Definition: WireWriter.cpp:164
bool writeString(const std::string &tag) const
Definition: WireWriter.cpp:189
bool writeNested(const WirePortable &obj) const
Definition: WireWriter.cpp:62
bool isValid()
Check if time is valid (non-zero).
Definition: Time.cpp:314
The main, catch-all namespace for YARP.
Definition: dirs.h:16