33 public yarp::dev::DeviceDriver,
34 public yarp::dev::IRGBDSensor
37#if YARP_VERSION_COMPARE(>=, 4, 0, 0)
38 constexpr static auto ret_ok = yarp::dev::ReturnValue::return_code::return_value_ok;
39 constexpr static auto ret_not_ok = yarp::dev::ReturnValue::return_code::return_value_error_not_implemented_by_device;
43 bool open(yarp::os::Searchable & config)
override;
44 bool close()
override;
48#if YARP_VERSION_COMPARE(>=, 4, 0, 0)
49 yarp::dev::ReturnValue getRgbSupportedConfigurations(std::vector<yarp::dev::CameraConfig> & configurations)
override {
return ret_not_ok; }
50 yarp::dev::ReturnValue getRgbResolution(
int & width,
int & height)
override {
return ret_not_ok; }
51 yarp::dev::ReturnValue setRgbResolution(
int width,
int height)
override {
return ret_not_ok; }
52 yarp::dev::ReturnValue getRgbFOV(
double & horizontalFov,
double & verticalFov)
override {
return ret_not_ok; }
53 yarp::dev::ReturnValue setRgbFOV(
double horizontalFov,
double verticalFov)
override {
return ret_not_ok; }
54#if YARP_VERSION_COMPARE(>=, 4, 1, 0) || defined(YARP_NEXT)
55 yarp::dev::ReturnValue getRgbIntrinsicParam(yarp::sig::IntrinsicParams & intrinsic)
override {
return ret_not_ok; }
57 yarp::dev::ReturnValue getRgbIntrinsicParam(yarp::os::Property & intrinsic)
override {
return ret_not_ok; }
59 yarp::dev::ReturnValue getRgbMirroring(
bool & mirror)
override {
return ret_not_ok; }
60 yarp::dev::ReturnValue setRgbMirroring(
bool mirror)
override {
return ret_not_ok; }
62 bool getRgbSupportedConfigurations(yarp::sig::VectorOf<yarp::dev::CameraConfig> & configurations)
override {
return false; }
63 bool getRgbResolution(
int & width,
int & height)
override {
return false; }
64 bool setRgbResolution(
int width,
int height)
override {
return false; }
65 bool getRgbFOV(
double & horizontalFov,
double & verticalFov)
override {
return false; }
66 bool setRgbFOV(
double horizontalFov,
double verticalFov)
override {
return false; }
67 bool getRgbIntrinsicParam(yarp::os::Property & intrinsic)
override {
return false; }
68 bool getRgbMirroring(
bool & mirror)
override {
return false; }
69 bool setRgbMirroring(
bool mirror)
override {
return false; }
71 int getRgbHeight()
override {
return 0; };
72 int getRgbWidth()
override {
return 0; };
75#if YARP_VERSION_COMPARE(>=, 4, 0, 0)
76 yarp::dev::ReturnValue getDepthResolution(
int & width,
int & height)
override {
return ret_not_ok; }
77 yarp::dev::ReturnValue setDepthResolution(
int width,
int height)
override {
return ret_not_ok; }
78 yarp::dev::ReturnValue getDepthFOV(
double & horizontalFov,
double & verticalFov)
override {
return ret_not_ok; }
79 yarp::dev::ReturnValue setDepthFOV(
double horizontalFov,
double verticalFov)
override {
return ret_not_ok; }
80 yarp::dev::ReturnValue getDepthAccuracy(
double & accuracy)
override { accuracy = 0.0;
return ret_ok; }
81 yarp::dev::ReturnValue setDepthAccuracy(
double accuracy)
override {
return ret_not_ok; }
82 yarp::dev::ReturnValue getDepthClipPlanes(
double & nearPlane,
double & farPlane)
override {
return ret_not_ok; }
83 yarp::dev::ReturnValue setDepthClipPlanes(
double nearPlane,
double farPlane)
override {
return ret_not_ok; }
84#if YARP_VERSION_COMPARE(>=, 4, 1, 0) || defined(YARP_NEXT)
85 yarp::dev::ReturnValue getDepthIntrinsicParam(yarp::sig::IntrinsicParams & intrinsic)
override {
return ret_not_ok; }
87 yarp::dev::ReturnValue getDepthIntrinsicParam(yarp::os::Property & intrinsic)
override {
return ret_not_ok; }
89 yarp::dev::ReturnValue getDepthMirroring(
bool & mirror)
override {
return ret_not_ok; }
90 yarp::dev::ReturnValue setDepthMirroring(
bool mirror)
override {
return ret_not_ok; }
92 bool setDepthResolution(
int width,
int height)
override {
return false; }
93 bool getDepthFOV(
double & horizontalFov,
double & verticalFov)
override {
return false; }
94 bool setDepthFOV(
double horizontalFov,
double verticalFov)
override {
return false; }
95 double getDepthAccuracy()
override {
return 0.0; }
96 bool setDepthAccuracy(
double accuracy)
override {
return false; }
97 bool getDepthClipPlanes(
double & nearPlane,
double & farPlane)
override {
return false; }
98 bool setDepthClipPlanes(
double nearPlane,
double farPlane)
override {
return false; }
99 bool getDepthIntrinsicParam(yarp::os::Property & intrinsic)
override {
return false; }
100 bool getDepthMirroring(
bool & mirror)
override {
return false; }
101 bool setDepthMirroring(
bool mirror)
override {
return false; }
103 int getDepthHeight()
override {
return depthHeight; };
104 int getDepthWidth()
override {
return depthWidth; };
107#if YARP_VERSION_COMPARE(>=, 4, 0, 0)
108 yarp::dev::ReturnValue getExtrinsicParam(yarp::sig::Matrix & extrinsic)
override {
return ret_not_ok; }
109 yarp::dev::ReturnValue getLastErrorMsg(std::string & message, yarp::os::Stamp * timeStamp =
nullptr)
override { message =
"";
return ret_ok; }
110 yarp::dev::ReturnValue getRgbImage(yarp::sig::FlexImage & rgbImage, yarp::os::Stamp * timeStamp =
nullptr)
override;
111 yarp::dev::ReturnValue getDepthImage(yarp::sig::ImageOf<yarp::sig::PixelFloat> & depthImage, yarp::os::Stamp * timeStamp =
nullptr)
override;
112 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)
override;
113 yarp::dev::ReturnValue getSensorStatus(yarp::dev::IRGBDSensor::RGBDSensor_status & status)
override;
115 bool getExtrinsicParam(yarp::sig::Matrix & extrinsic)
override {
return false; }
116 std::string getLastErrorMsg(yarp::os::Stamp * timeStamp =
nullptr)
override {
return ""; }
117 bool getRgbImage(yarp::sig::FlexImage & rgbImage, yarp::os::Stamp * timeStamp =
nullptr)
override;
118 bool getDepthImage(yarp::sig::ImageOf<yarp::sig::PixelFloat> & depthImage, yarp::os::Stamp * timeStamp =
nullptr)
override;
119 bool getImages(yarp::sig::FlexImage & colorFrame, yarp::sig::ImageOf<yarp::sig::PixelFloat> & depthFrame, yarp::os::Stamp * colorStamp =
nullptr, yarp::os::Stamp * depthStamp =
nullptr)
override;
120 yarp::dev::IRGBDSensor::RGBDSensor_status getSensorStatus()
override;
124 int rgbHeight, rgbWidth, depthHeight, depthWidth;
127 bool rgbReady {
false};
128 bool depthReady {
false};
131 OpenRAVE::SensorBasePtr depthSensorBasePtr;
132 OpenRAVE::SensorBasePtr rgbSensorBasePtr;
134 boost::shared_ptr<OpenRAVE::SensorBase::LaserSensorData> depthSensorDataPtr;
135 boost::shared_ptr<OpenRAVE::SensorBase::CameraSensorData> rgbSensorDataPtr;