YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
RGBDSensorMsgsImpl.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2023-2023 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
7
9#include <yarp/os/LogStream.h>
10#include <yarp/os/Os.h>
11
12namespace {
13YARP_LOG_COMPONENT(ICHATBOTMSGSIMPL, "yarp.devices.chatBot_nws_yarp.ChatBotRPC_CallbackHelper")
14}
15
16using namespace yarp::dev;
17
19{
20 m_irgbd = _irgbd;
21 m_ictrls = _ictrls;
22}
23
25{
26 std::lock_guard <std::mutex> lg(m_mutex);
28
29 // interface check
30 if (!m_irgbd)
31 {
32 response.ret = ReturnValue::return_code::return_value_error_not_ready;
33 return response;
34 }
35
36 int w = m_irgbd->getRgbWidth();
37 if(w <= 0)
38 {
39 yCError(ICHATBOTMSGSIMPL) << "Could not perform getRgbWidth()";
40 response.ret = ReturnValue::return_code::return_value_error_generic;
41 return response;
42 }
43
44 response.ret = ReturnValue_ok;
45 response.width = w;
46
47 return response;
48}
49
51{
52 std::lock_guard<std::mutex> lg(m_mutex);
54
55 // interface check
56 if (!m_irgbd) {
57 response.ret = ReturnValue::return_code::return_value_error_not_ready;
58 return response;
59 }
60
61 int h = m_irgbd->getRgbHeight();
62 if (h <= 0) {
63 yCError(ICHATBOTMSGSIMPL) << "Could not perform getRgbHeight()";
64 response.ret = ReturnValue::return_code::return_value_error_generic;
65 return response;
66 }
67
68 response.ret = ReturnValue_ok;
69 response.height = h;
70
71 return response;
72}
73
75{
76 std::lock_guard<std::mutex> lg(m_mutex);
78
79 // interface check
80 if (!m_irgbd) {
81 response.ret = ReturnValue::return_code::return_value_error_not_ready;
82 return response;
83 }
84
85 std::vector<CameraConfig> cfgs;
86 auto ret = m_irgbd->getRgbSupportedConfigurations(cfgs);
87
88 if (ret)
89 {
90 response.ret = ret;
91 response.configuration = cfgs;
92 return response;
93 }
94
95 response.ret = ret;
96 return response;
97}
98
100{
101 std::lock_guard<std::mutex> lg(m_mutex);
103
104 // interface check
105 if (!m_irgbd) {
106 response.ret = ReturnValue::return_code::return_value_error_not_ready;
107 return response;
108 }
109
110 int w = 0;
111 int h = 0;
112 auto ret = m_irgbd->getRgbResolution(w, h);
113
114 if (ret) {
115 response.ret = ret;
116 response.width = w;
117 response.height = h;
118 return response;
119 }
120
121 response.ret = ret;
122 return response;
123}
124
125ReturnValue RGBDSensorMsgsImpl::setRgbResolutionRPC(const std::int32_t width, const std::int32_t height)
126{
127 std::lock_guard<std::mutex> lg(m_mutex);
128
129 // interface check
130 if (!m_irgbd) {
131 return ReturnValue::return_code::return_value_error_not_ready;
132 }
133
134 auto ret = m_irgbd->setRgbResolution(width, height);
135 if (!ret) {
136 yCError(ICHATBOTMSGSIMPL) << "Could not do setRgbResolutionRPC()";
137 return ret;
138 }
139
140 return ReturnValue_ok;
141}
142
144{
145 std::lock_guard<std::mutex> lg(m_mutex);
147
148 // interface check
149 if (!m_irgbd) {
150 response.ret = ReturnValue::return_code::return_value_error_not_ready;
151 return response;
152 }
153
154 double hfov = 0;
155 double vfov = 0;
156 auto ret = m_irgbd->getRgbFOV(hfov, vfov);
157
158 if (ret) {
159 response.ret = ret;
160 response.horizontalFov = hfov;
161 response.verticalFOV = vfov;
162 return response;
163 }
164
165 response.ret = ret;
166 return response;
167}
168
169yarp::dev::ReturnValue RGBDSensorMsgsImpl::setRgbFOVRPC(const double horizontalFov, const double verticalFov)
170{
171 std::lock_guard<std::mutex> lg(m_mutex);
172
173 // interface check
174 if (!m_irgbd) {
175 return ReturnValue::return_code::return_value_error_not_ready;
176 }
177
178 auto ret = m_irgbd->setRgbFOV(horizontalFov, verticalFov);
179 if (!ret) {
180 yCError(ICHATBOTMSGSIMPL) << "Could not do setRgbFOVRPC()";
181 return ret;
182 }
183
184 return ReturnValue_ok;
185}
186
188{
189 std::lock_guard<std::mutex> lg(m_mutex);
191
192 // interface check
193 if (!m_irgbd) {
194 response.ret = ReturnValue::return_code::return_value_error_not_ready;
195 return response;
196 }
197
198 yarp::os::Property intrinsic;
199 auto ret = m_irgbd->getRgbIntrinsicParam(intrinsic);
200
201 if (ret) {
202 response.ret = ret;
203 response.params = intrinsic;
204 return response;
205 }
206
207 response.ret = ret;
208 return response;
209}
210
212{
213 std::lock_guard<std::mutex> lg(m_mutex);
215
216 // interface check
217 if (!m_irgbd) {
218 response.ret = ReturnValue::return_code::return_value_error_not_ready;
219 return response;
220 }
221
222 bool mir=false;
223 auto ret = m_irgbd->getRgbMirroring(mir);
224
225 if (ret) {
226 response.ret = ret;
227 response.mirror = mir;
228 return response;
229 }
230
231 response.ret = ret;
232 return response;
233}
234
236{
237 std::lock_guard<std::mutex> lg(m_mutex);
238
239 // interface check
240 if (!m_irgbd) {
241 return ReturnValue::return_code::return_value_error_not_ready;
242 }
243
244 auto ret = m_irgbd->setRgbMirroring(mirror);
245 if (!ret) {
246 yCError(ICHATBOTMSGSIMPL) << "Could not do setRgbMirroringRPC()";
247 return ret;
248 }
249
250 return ReturnValue_ok;
251}
252
254{
255 std::lock_guard<std::mutex> lg(m_mutex);
257
258 // interface check
259 if (!m_ictrls) {
260 response.ret = ReturnValue::return_code::return_value_error_not_ready;
261 return response;
262 }
263
265 auto ret = m_ictrls->getCameraDescription(cam);
266
267 if (ret) {
268 response.ret = ret;
269 response.camera.busType = cam.busType;
271 return response;
272 }
273
274 response.ret = ret;
275 return response;
276}
277
279{
280 std::lock_guard<std::mutex> lg(m_mutex);
282
283 // interface check
284 if (!m_ictrls) {
285 response.ret = ReturnValue::return_code::return_value_error_not_ready;
286 return response;
287 }
288
289 bool hasfeat = false;
290 auto ret = m_ictrls->hasFeature((cameraFeature_id_t)feature, hasfeat);
291
292 if (ret) {
293 response.ret = ret;
294 response.hasFeature = hasfeat;
295 return response;
296 }
297
298 response.ret = ret;
299 return response;
300}
301
303{
304 std::lock_guard<std::mutex> lg(m_mutex);
305
306 // interface check
307 if (!m_ictrls) {
308 return ReturnValue::return_code::return_value_error_not_ready;
309 }
310
311 auto ret = m_ictrls->setFeature((cameraFeature_id_t)feature, value);
312 if (!ret) {
313 yCError(ICHATBOTMSGSIMPL) << "Could not do setFeature1RPC()";
314 return ret;
315 }
316
317 return ReturnValue_ok;
318}
319
321{
322 std::lock_guard<std::mutex> lg(m_mutex);
324
325 // interface check
326 if (!m_ictrls) {
327 response.ret = ReturnValue::return_code::return_value_error_not_ready;
328 return response;
329 }
330
331 double value = 0;
332 auto ret = m_ictrls->getFeature((cameraFeature_id_t)feature, value);
333
334 if (ret) {
335 response.ret = ret;
336 response.value = value;
337 return response;
338 }
339
340 response.ret = ret;
341 return response;
342}
343
344yarp::dev::ReturnValue RGBDSensorMsgsImpl::setFeature2RPC(const std::int32_t feature, const double value1, const double value2)
345{
346 std::lock_guard<std::mutex> lg(m_mutex);
347
348 // interface check
349 if (!m_ictrls) {
350 return ReturnValue::return_code::return_value_error_not_ready;
351 }
352
353 auto ret = m_ictrls->setFeature((cameraFeature_id_t)feature, value1, value2);
354 if (!ret) {
355 yCError(ICHATBOTMSGSIMPL) << "Could not do setFeature2RPC()";
356 return ret;
357 }
358
359 return ReturnValue_ok;
360}
361
363{
364 std::lock_guard<std::mutex> lg(m_mutex);
366
367 // interface check
368 if (!m_ictrls) {
369 response.ret = ReturnValue::return_code::return_value_error_not_ready;
370 return response;
371 }
372
373 double value1 = 0;
374 double value2 = 0;
375 auto ret = m_ictrls->getFeature((cameraFeature_id_t)feature, value1, value2);
376
377 if (ret) {
378 response.ret = ret;
379 response.value1 = value1;
380 response.value2 = value2;
381 return response;
382 }
383
384 response.ret = ret;
385 return response;
386}
387
389{
390 std::lock_guard<std::mutex> lg(m_mutex);
392
393 //interface check
394 if (!m_ictrls) {
395 response.ret = ReturnValue::return_code::return_value_error_not_ready;
396 return response;
397 }
398
399 bool hasonoff = false;
400 auto ret = m_ictrls->hasOnOff((cameraFeature_id_t)feature, hasonoff);
401
402 if (ret) {
403 response.ret = ret;
404 response.HasOnOff = hasonoff;
405 return response;
406 }
407
408 response.ret = ret;
409 return response;
410}
411
413{
414 std::lock_guard<std::mutex> lg(m_mutex);
415
416 // interface check
417 if (!m_ictrls) {
418 return ReturnValue::return_code::return_value_error_not_ready;
419 }
420
421 auto ret = m_ictrls->setActive((cameraFeature_id_t)feature, onoff);
422 if (!ret) {
423 yCError(ICHATBOTMSGSIMPL) << "Could not do setActiveRPC()";
424 return ret;
425 }
426
427 return ReturnValue_ok;
428}
429
431{
432 std::lock_guard<std::mutex> lg(m_mutex);
434
435 if (!m_ictrls) {
436 response.ret = ReturnValue::return_code::return_value_error_not_ready;
437 return response;
438 }
439
440 bool isActive = false;
441 auto ret = m_ictrls->getActive((cameraFeature_id_t)feature, isActive);
442
443 if (ret) {
444 response.ret = ret;
445 response.isActive = isActive;
446 return response;
447 }
448
449 response.ret = ret;
450 return response;
451}
452
454{
455 std::lock_guard<std::mutex> lg(m_mutex);
457
458 if (!m_ictrls) {
459 response.ret = ReturnValue::return_code::return_value_error_not_ready;
460 return response;
461 }
462
463 bool hasauto = false;
464 auto ret = m_ictrls->hasAuto((cameraFeature_id_t)feature, hasauto);
465
466 if (ret) {
467 response.ret = ret;
468 response.hasAuto = hasauto;
469 return response;
470 }
471
472 response.ret = ret;
473 return response;
474}
475
477{
478 std::lock_guard<std::mutex> lg(m_mutex);
480
481 // interface check
482 if (!m_ictrls) {
483 response.ret = ReturnValue::return_code::return_value_error_not_ready;
484 return response;
485 }
486
487 bool hasManual = false;
489
490 if (ret) {
491 response.ret = ret;
492 response.hasManual = hasManual;
493 return response;
494 }
495
496 response.ret = ret;
497 return response;
498}
499
501{
502 std::lock_guard<std::mutex> lg(m_mutex);
504
505 // interface check
506 if (!m_ictrls) {
507 response.ret = ReturnValue::return_code::return_value_error_not_ready;
508 return response;
509 }
510
511 bool hasOnePush = false;
513
514 if (ret) {
515 response.ret = ret;
516 response.hasOnePush = hasOnePush;
517 return response;
518 }
519
520 response.ret = ret;
521 return response;
522}
523
525{
526 std::lock_guard<std::mutex> lg(m_mutex);
527
528 // interface check
529 if (!m_ictrls) {
530 return ReturnValue::return_code::return_value_error_not_ready;
531 }
532
533 auto ret = m_ictrls->setMode((cameraFeature_id_t)feature, mode);
534 if (!ret) {
535 yCError(ICHATBOTMSGSIMPL) << "Could not do setModeRPC()";
536 return ret;
537 }
538
539 return ReturnValue_ok;
540}
541
543{
544 std::lock_guard<std::mutex> lg(m_mutex);
546
547 // interface check
548 if (!m_ictrls) {
549 response.ret = ReturnValue::return_code::return_value_error_not_ready;
550 return response;
551 }
552
554 auto ret = m_ictrls->getMode((cameraFeature_id_t)feature, mode);
555
556 if (ret) {
557 response.ret = ret;
558 response.mode = mode;
559 return response;
560 }
561
562 response.ret = ret;
563 return response;
564}
565
567{
568 std::lock_guard<std::mutex> lg(m_mutex);
569
570 // interface check
571 if (!m_ictrls) {
572 return ReturnValue::return_code::return_value_error_not_ready;
573 }
574
575 auto ret = m_ictrls->setOnePush((cameraFeature_id_t)feature);
576 if (!ret) {
577 yCError(ICHATBOTMSGSIMPL) << "Could not do setOnePushRPC()";
578 return ret;
579 }
580
581 return ReturnValue_ok;
582}
583
584
585
587{
588 std::lock_guard<std::mutex> lg(m_mutex);
590
591 // interface check
592 if (!m_irgbd) {
593 response.ret = ReturnValue::return_code::return_value_error_not_ready;
594 return response;
595 }
596
597 int w = m_irgbd->getDepthWidth();
598
599 if (w<= 0) {
600 response.ret = ReturnValue::return_code::return_value_error_method_failed;
601 response.width = 0;
602 return response;
603 }
604
605 response.width = w;
606 response.ret = ReturnValue_ok;
607 return response;
608}
609
611{
612 std::lock_guard<std::mutex> lg(m_mutex);
614
615 // interface check
616 if (!m_irgbd) {
617 response.ret = ReturnValue::return_code::return_value_error_not_ready;
618 return response;
619 }
620
621 int h = m_irgbd->getDepthWidth();
622
623 if (h <= 0) {
624 response.ret = ReturnValue::return_code::return_value_error_method_failed;
625 response.height = 0;
626 return response;
627 }
628
629 response.height = h;
630 response.ret = ReturnValue_ok;
631 return response;
632}
633
635{
636 std::lock_guard<std::mutex> lg(m_mutex);
638
639 // interface check
640 if (!m_irgbd) {
641 response.ret = ReturnValue::return_code::return_value_error_not_ready;
642 return response;
643 }
644
645 int w = 0;
646 int h = 0;
647 auto ret = m_irgbd->getDepthResolution(w,h);
648
649 if (ret) {
650 response.ret = ret;
651 response.width = w;
652 response.height = h;
653 return response;
654 }
655
656 response.width = 0;
657 response.height = 0;
658 response.ret = ret;
659 return response;
660}
661
662yarp::dev::ReturnValue RGBDSensorMsgsImpl::setDepthResolutionRPC(const std::int32_t width, const std::int32_t height)
663{
664 std::lock_guard<std::mutex> lg(m_mutex);
665
666 // interface check
667 if (!m_irgbd) {
668 return ReturnValue::return_code::return_value_error_not_ready;
669 }
670
671 auto ret = m_irgbd->setDepthResolution(width, height);
672 if (!ret) {
673 yCError(ICHATBOTMSGSIMPL) << "Could not do setDepthResolutionRPC()";
674 return ret;
675 }
676
677 return ReturnValue_ok;
678}
679
681{
682 std::lock_guard<std::mutex> lg(m_mutex);
684
685 // interface check
686 if (!m_irgbd) {
687 response.ret = ReturnValue::return_code::return_value_error_not_ready;
688 return response;
689 }
690
691 double hfov = 0;
692 double vfov = 0;
693 auto ret = m_irgbd->getDepthFOV(hfov,vfov);
694
695 if (ret) {
696 response.ret = ret;
697 response.horizontalFov = hfov;
698 response.verticalFOV = vfov;
699 return response;
700 }
701
702 response.ret = ret;
703 return response;
704}
705
706yarp::dev::ReturnValue RGBDSensorMsgsImpl::setDepthFOVRPC(const double horizontalFov, const double verticalFov)
707{
708 std::lock_guard<std::mutex> lg(m_mutex);
709
710 // interface check
711 if (!m_irgbd) {
712 return ReturnValue::return_code::return_value_error_not_ready;
713 }
714
715 auto ret = m_irgbd->setDepthFOV(horizontalFov, verticalFov);
716 if (!ret) {
717 yCError(ICHATBOTMSGSIMPL) << "Could not do setDepthFOVRPC()";
718 return ret;
719 }
720
721 return ReturnValue_ok;
722}
723
725{
726 std::lock_guard<std::mutex> lg(m_mutex);
728
729 // interface check
730 if (!m_irgbd) {
731 response.ret = ReturnValue::return_code::return_value_error_not_ready;
732 return response;
733 }
734
735 double accuracy = 0;
736 auto ret = m_irgbd->getDepthAccuracy(accuracy);
737
738 if (ret) {
739 response.ret = ret;
740 response.accuracy = accuracy;
741 return response;
742 }
743
744 response.ret = ret;
745 return response;
746}
747
749{
750 std::lock_guard<std::mutex> lg(m_mutex);
751
752 // interface check
753 if (!m_irgbd) {
754 return ReturnValue::return_code::return_value_error_not_ready;
755 }
756
757 auto ret = m_irgbd->setDepthAccuracy(accuracy);
758 if (!ret) {
759 yCError(ICHATBOTMSGSIMPL) << "Could not do setDepthAccuracyRPC()";
760 return ret;
761 }
762
763 return ReturnValue_ok;
764}
765
767{
768 std::lock_guard<std::mutex> lg(m_mutex);
770
771 // interface check
772 if (!m_irgbd) {
773 response.ret = ReturnValue::return_code::return_value_error_not_ready;
774 return response;
775 }
776
777 double n = 0;
778 double f = 0;
779 auto ret = m_irgbd->getDepthClipPlanes(n,f);
780
781 if (ret) {
782 response.ret = ret;
783 response.nearPlane = n;
784 response.farPlane = f;
785 return response;
786 }
787
788 response.ret = ret;
789 return response;
790}
791
792yarp::dev::ReturnValue RGBDSensorMsgsImpl::setDepthClipPlanesRPC(const double nearPlane, const double farPlane)
793{
794 std::lock_guard<std::mutex> lg(m_mutex);
795
796 // interface check
797 if (!m_irgbd) {
798 return ReturnValue::return_code::return_value_error_not_ready;
799 }
800
801 auto ret = m_irgbd->setDepthClipPlanes(nearPlane,farPlane);
802 if (!ret) {
803 yCError(ICHATBOTMSGSIMPL) << "Could not do setDepthClipPlanesRPC()";
804 return ret;
805 }
806
807 return ReturnValue_ok;
808}
809
811{
812 std::lock_guard<std::mutex> lg(m_mutex);
814
815 // interface check
816 if (!m_irgbd) {
817 response.ret = ReturnValue::return_code::return_value_error_not_ready;
818 return response;
819 }
820
821 bool mirror = false;
822 auto ret = m_irgbd->getDepthMirroring(mirror);
823
824 if (ret) {
825 response.ret = ret;
826 response.mirror = mirror;
827 return response;
828 }
829
830 response.ret = ret;
831 return response;
832}
833
835{
836 std::lock_guard<std::mutex> lg(m_mutex);
837
838 // interface check
839 if (!m_irgbd) {
840 return ReturnValue::return_code::return_value_error_not_ready;
841 }
842
843 auto ret = m_irgbd->setDepthMirroring(mirror);
844 if (!ret) {
845 yCError(ICHATBOTMSGSIMPL) << "Could not do setDepthMirroringRPC()";
846 return ret;
847 }
848
849 return ReturnValue_ok;
850}
851
853{
854 std::lock_guard<std::mutex> lg(m_mutex);
856
857 // interface check
858 if (!m_irgbd) {
859 response.ret = ReturnValue::return_code::return_value_error_not_ready;
860 return response;
861 }
862
863 yarp::os::Property intrinsic;
864 auto ret = m_irgbd->getDepthIntrinsicParam(intrinsic);
865
866 if (ret) {
867 response.ret = ret;
868 response.params = intrinsic;
869 return response;
870 }
871
872 response.ret = ret;
873 return response;
874}
875
877{
878 std::lock_guard<std::mutex> lg(m_mutex);
880
881 // interface check
882 if (!m_irgbd) {
883 response.ret = ReturnValue::return_code::return_value_error_not_ready;
884 return response;
885 }
886
888 auto ret = m_irgbd->getExtrinsicParam(data);
889
890 if (ret) {
891 response.ret = ret;
892 response.matrix = data;
893 return response;
894 }
895
896 response.ret = ret;
897 return response;
898}
899
901{
902 std::lock_guard<std::mutex> lg(m_mutex);
904
905 // interface check
906 if (!m_irgbd) {
907 response.ret = ReturnValue::return_code::return_value_error_not_ready;
908 return response;
909 }
910
911 std::string msg;
912 yarp::os::Stamp stmp;
913 auto ret = m_irgbd->getLastErrorMsg(msg, &stmp);
914
915 if (ret) {
916 response.ret = ret;
917 response.errorMsg = msg;
918 response.stamp = stmp;
919 return response;
920 }
921
922 response.ret = ret;
923 return response;
924}
925
927{
928 std::lock_guard<std::mutex> lg(m_mutex);
930
931 // interface check
932 if (!m_irgbd) {
933 response.ret = ReturnValue::return_code::return_value_error_not_ready;
934 return response;
935 }
936
938 yarp::os::Stamp stmp;
939 auto ret = m_irgbd->getRgbImage(img, &stmp);
940
941 if (ret) {
942 response.ret = ret;
943 response.img = img;
944 response.stamp = stmp;
945 return response;
946 }
947
948 response.ret = ret;
949 return response;
950}
951
953{
954 std::lock_guard<std::mutex> lg(m_mutex);
956
957 // interface check
958 if (!m_irgbd) {
959 response.ret = ReturnValue::return_code::return_value_error_not_ready;
960 return response;
961 }
962
964 yarp::os::Stamp stmp;
965 auto ret = m_irgbd->getDepthImage(img, &stmp);
966
967 if (ret) {
968 response.ret = ret;
969 response.img = img;
970 response.stamp = stmp;
971 return response;
972 }
973
974 response.ret = ret;
975 return response;
976}
977
979{
980 std::lock_guard<std::mutex> lg(m_mutex);
982
983 // interface check
984 if (!m_irgbd) {
985 response.ret = ReturnValue::return_code::return_value_error_not_ready;
986 return response;
987 }
988
991 yarp::os::Stamp stmp;
992 auto ret = m_irgbd->getImages(rgbimg, depthimg, &stmp);
993
994 if (ret) {
995 response.ret = ret;
996 response.depthimg = depthimg;
997 response.depthstamp = stmp;
998 response.rgbimg = rgbimg;
999 response.rgbstamp = stmp;
1000 return response;
1001 }
1002
1003 response.ret = ret;
1004 return response;
1005}
1006
1008{
1009 std::lock_guard<std::mutex> lg(m_mutex);
1011
1012 // interface check
1013 if (!m_irgbd) {
1014 response.ret = ReturnValue::return_code::return_value_error_not_ready;
1015 return response;
1016 }
1017
1019 auto ret = m_irgbd->getSensorStatus(status);
1020
1021 if (ret) {
1022 response.ret = ret;
1023 response.status = status;
1024 return response;
1025 }
1026
1027 response.ret = ret;
1028 return response;
1029}
FeatureMode mode
bool ret
#define ReturnValue_ok
Definition ReturnValue.h:80
yarp::sig::ImageOf< yarp::sig::PixelFloat > img
yarp::sig::ImageOf< yarp::sig::PixelFloat > depthimg
yarp::dev::IRGBDSensor::RGBDSensor_status status
virtual IFrameGrabberControlMsgs_return_hasOnePush hasOnePushRPC(const std::int32_t feature) override
virtual yarp::dev::ReturnValue setRgbResolutionRPC(const std::int32_t width, const std::int32_t height) override
virtual IDepthVisualParamsMsgs_return_getDepthResolution getDepthResolutionRPC() override
RGBDSensorMsgsImpl(yarp::dev::IRGBDSensor *_irgbd, yarp::dev::IFrameGrabberControls *_ictrls)
virtual IDepthVisualParamsMsgs_return_getDepthFOV getDepthFOVRPC() override
virtual IRGBDMsgs_return_getDepthImage getDepthImageRPC() override
virtual IRGBVisualParamsMsgs_return_getRgbIntrinsicParam getRgbIntrinsicParamRPC() override
virtual IDepthVisualParamsMsgs_return_getDepthMirroring getDepthMirroringRPC() override
virtual IFrameGrabberControlMsgs_return_getFeature1 getFeature1RPC(const std::int32_t feature) override
virtual yarp::dev::ReturnValue setDepthFOVRPC(const double horizontalFov, const double verticalFov) override
virtual yarp::dev::ReturnValue setFeature1RPC(const std::int32_t feature, const double value) override
virtual yarp::dev::ReturnValue setDepthAccuracyRPC(const double accuracy) override
virtual yarp::dev::ReturnValue setOnePushRPC(const std::int32_t feature) override
virtual IFrameGrabberControlMsgs_return_hasManual hasManualRPC(const std::int32_t feature) override
virtual IDepthVisualParamsMsgs_return_getDepthHeight getDepthHeightRPC() override
virtual IDepthVisualParamsMsgs_return_getDepthWidth getDepthWidthRPC() override
virtual yarp::dev::ReturnValue setDepthResolutionRPC(const std::int32_t width, const std::int32_t height) override
virtual IRGBDMsgs_return_getRgbImage getRgbImageRPC() override
virtual IRGBVisualParamsMsgs_return_getRgbFOV getRgbFOVRPC() override
virtual IDepthVisualParamsMsgs_return_getDepthAccuracy getDepthAccuracyRPC() override
virtual IDepthVisualParamsMsgs_return_getDepthClipPlanes getDepthClipPlanesRPC() override
virtual IFrameGrabberControlMsgs_return_getMode getModeRPC(const std::int32_t feature) override
virtual IRGBDMsgs_return_getExtrinsic getExtrinsicParamRPC() override
virtual IRGBVisualParamsMsgs_return_getRgbSupportedCfg getRgbSupportedConfigurationsRPC() override
virtual IFrameGrabberControlMsgs_return_getFeature2 getFeature2RPC(const std::int32_t feature) override
virtual IRGBVisualParamsMsgs_return_getRgbHeight getRgbHeightRPC() override
virtual yarp::dev::ReturnValue setFeature2RPC(const std::int32_t feature, const double value1, const double value2) override
virtual IDepthVisualParamsMsgs_return_getDepthIntrinsicParam getDepthIntrinsicParamRPC() override
virtual yarp::dev::ReturnValue setModeRPC(const std::int32_t feature, const yarp::dev::FeatureMode mode) override
virtual IFrameGrabberControlMsgs_return_getActive getActiveRPC(const std::int32_t feature) override
virtual IRGBVisualParamsMsgs_return_getRgbResolution getRgbResolutionRPC() override
virtual IFrameGrabberControlMsgs_return_getCameraDescription getCameraDescriptionRPC() override
virtual IRGBDMsgs_return_getImages getImagesRPC() override
virtual IRGBDMsgs_return_getLastErrorMsg getLastErrorMsgRPC() override
virtual IFrameGrabberControlMsgs_return_hasAuto hasAutoRPC(const std::int32_t feature) override
virtual yarp::dev::ReturnValue setRgbFOVRPC(const double horizontalFov, const double verticalFov) override
virtual IFrameGrabberControlMsgs_return_hasOnOff hasOnOffRPC(const std::int32_t feature) override
virtual yarp::dev::ReturnValue setDepthMirroringRPC(const bool mirror) override
virtual yarp::dev::ReturnValue setRgbMirroringRPC(const bool mirror) override
virtual yarp::dev::ReturnValue setDepthClipPlanesRPC(const double nearPlane, const double farPlane) override
virtual IRGBVisualParamsMsgs_return_getRgbMirroring getRgbMirroringRPC() override
virtual IFrameGrabberControlMsgs_return_hasFeature hasFeatureRPC(const std::int32_t feature) override
virtual IRGBDMsgs_return_getSensorStatus getSensorStatusRPC() override
virtual yarp::dev::ReturnValue setActiveRPC(const std::int32_t feature, const bool onoff) override
virtual IRGBVisualParamsMsgs_return_getRgbWidth getRgbWidthRPC() override
yarp::dev::BusType busType
std::string deviceDescription
virtual yarp::dev::ReturnValue setDepthResolution(int width, int height)=0
Set the resolution of the depth image from the camera.
virtual yarp::dev::ReturnValue setDepthClipPlanes(double nearPlane, double farPlane)=0
Set the clipping planes of the sensor.
virtual int getDepthWidth()=0
Return the height of each frame.
virtual yarp::dev::ReturnValue setDepthMirroring(bool mirror)=0
Set the mirroring setting of the sensor.
virtual yarp::dev::ReturnValue getDepthIntrinsicParam(yarp::os::Property &intrinsic)=0
Get the intrinsic parameters of the depth camera.
virtual yarp::dev::ReturnValue getDepthMirroring(bool &mirror)=0
Get the mirroring setting of the sensor.
virtual yarp::dev::ReturnValue setDepthAccuracy(double accuracy)=0
Set the minimum detectable variation in distance [meter] when possible.
virtual yarp::dev::ReturnValue getDepthFOV(double &horizontalFov, double &verticalFov)=0
Get the field of view (FOV) of the depth camera.
virtual yarp::dev::ReturnValue getDepthClipPlanes(double &nearPlane, double &farPlane)=0
Get the clipping planes of the sensor.
virtual yarp::dev::ReturnValue getDepthAccuracy(double &accuracy)=0
Get the minimum detectable variation in distance [meter].
virtual yarp::dev::ReturnValue setDepthFOV(double horizontalFov, double verticalFov)=0
Set the field of view (FOV) of the depth camera.
virtual yarp::dev::ReturnValue getDepthResolution(int &width, int &height)=0
Get the resolution of the depth image from the camera.
Control interface for frame grabber devices.
virtual yarp::dev::ReturnValue setFeature(cameraFeature_id_t feature, double value)=0
Set the requested feature to a value (saturation, brightness ... )
virtual yarp::dev::ReturnValue hasOnOff(cameraFeature_id_t feature, bool &HasOnOff)=0
Check if the camera has the ability to turn on/off the requested feature.
virtual yarp::dev::ReturnValue getMode(cameraFeature_id_t feature, FeatureMode &mode)=0
Get the current mode for the feature.
virtual yarp::dev::ReturnValue hasManual(cameraFeature_id_t feature, bool &hasManual)=0
Check if the requested feature has the 'manual' mode.
virtual yarp::dev::ReturnValue setOnePush(cameraFeature_id_t feature)=0
Set the requested feature to a value (saturation, brightness ... )
virtual yarp::dev::ReturnValue getCameraDescription(CameraDescriptor &camera)=0
Get a basic description of the camera hw.
virtual yarp::dev::ReturnValue hasOnePush(cameraFeature_id_t feature, bool &hasOnePush)=0
Check if the requested feature has the 'onePush' mode.
virtual yarp::dev::ReturnValue getActive(cameraFeature_id_t feature, bool &isActive)=0
Get the current status of the feature, on or off.
virtual yarp::dev::ReturnValue hasAuto(cameraFeature_id_t feature, bool &hasAuto)=0
Check if the requested feature has the 'auto' mode.
virtual yarp::dev::ReturnValue setActive(cameraFeature_id_t feature, bool onoff)=0
Set the requested feature on or off.
virtual yarp::dev::ReturnValue setMode(cameraFeature_id_t feature, FeatureMode mode)=0
Set the requested mode for the feature.
virtual yarp::dev::ReturnValue hasFeature(cameraFeature_id_t, bool &hasFeature)=0
Check if camera has the requested feature (saturation, brightness ... )
virtual yarp::dev::ReturnValue getFeature(cameraFeature_id_t feature, double &value)=0
Get the current value for the requested feature.
A generic interface for cameras that have both color camera as well as depth camera sensor,...
Definition IRGBDSensor.h:39
virtual yarp::dev::ReturnValue getImages(yarp::sig::FlexImage &colorFrame, yarp::sig::ImageOf< yarp::sig::PixelFloat > &depthFrame, yarp::os::Stamp *colorStamp=nullptr, yarp::os::Stamp *depthStamp=nullptr)=0
Get the both the color and depth frame in a single call.
virtual yarp::dev::ReturnValue getLastErrorMsg(std::string &message, yarp::os::Stamp *timeStamp=nullptr)=0
Return an error message in case of error.
virtual yarp::dev::ReturnValue getRgbImage(yarp::sig::FlexImage &rgbImage, yarp::os::Stamp *timeStamp=nullptr)=0
Get the rgb frame from the device.
virtual yarp::dev::ReturnValue getDepthImage(yarp::sig::ImageOf< yarp::sig::PixelFloat > &depthImage, yarp::os::Stamp *timeStamp=nullptr)=0
Get the depth frame from the device.
virtual yarp::dev::ReturnValue getSensorStatus(RGBDSensor_status &status)=0
Get the current status of the sensor, using enum type.
virtual yarp::dev::ReturnValue getExtrinsicParam(yarp::sig::Matrix &extrinsic)=0
Get the extrinsic parameters from the device.
virtual yarp::dev::ReturnValue setRgbFOV(double horizontalFov, double verticalFov)=0
Set the field of view (FOV) of the rgb camera.
virtual yarp::dev::ReturnValue setRgbMirroring(bool mirror)=0
Set the mirroring setting of the sensor.
virtual yarp::dev::ReturnValue getRgbIntrinsicParam(yarp::os::Property &intrinsic)=0
Get the intrinsic parameters of the rgb camera.
virtual yarp::dev::ReturnValue getRgbFOV(double &horizontalFov, double &verticalFov)=0
Get the field of view (FOV) of the rgb camera.
virtual yarp::dev::ReturnValue getRgbSupportedConfigurations(std::vector< yarp::dev::CameraConfig > &configurations)=0
Get the possible configurations of the camera.
virtual int getRgbHeight()=0
Return the height of each frame.
virtual yarp::dev::ReturnValue getRgbMirroring(bool &mirror)=0
Get the mirroring setting of the sensor.
virtual yarp::dev::ReturnValue setRgbResolution(int width, int height)=0
Set the resolution of the rgb image from the camera.
virtual yarp::dev::ReturnValue getRgbResolution(int &width, int &height)=0
Get the resolution of the rgb image from the camera.
virtual int getRgbWidth()=0
Return the width of each frame.
A class for storing options and configuration information.
Definition Property.h:33
An abstraction for a time stamp and/or sequence number.
Definition Stamp.h:21
Image class with user control of representation details.
Definition Image.h:361
Typed image class.
Definition Image.h:603
A class for a Matrix.
Definition Matrix.h:39
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)
For streams capable of holding different kinds of content, check what they actually have.
constexpr char accuracy[]