robotology / yarp-device-realsense2

realsense2 device for YARP (https://www.yarp.it/)
Other
7 stars 10 forks source link

Depth quantization and fixes to image rotation #30

Closed ste93 closed 2 years ago

ste93 commented 2 years ago

based on #29, this adds the quantization of the realsense in order to save some bandwidth with the compression (as made in gazebo https://github.com/robotology/gazebo-yarp-plugins/pull/608) There is also a bugfix of image rotation introduced in https://github.com/robotology/yarp-device-realsense2/pull/27

ste93 commented 2 years ago

@randaz81 @elandini84 @DatSpace fyi

Nicogene commented 2 years ago

Ah could you please add a line in the changelog? Thanks!

DatSpace commented 2 years ago

The nearplane and farplane dont seem to be used. So the could be removed right ?

ste93 commented 2 years ago

yep they are a leftover, I'll remove them

traversaro commented 2 years ago

Thanks, if no one objects we can merge as soon as the CI is happy.

traversaro commented 2 years ago

Can you check the CI failures?

traversaro commented 2 years ago

The reported error is:

[1/10] Building CXX object src/devices/realsense2/CMakeFiles/yarp_realsense2.dir/realsense2Driver.cpp.o
FAILED: src/devices/realsense2/CMakeFiles/yarp_realsense2.dir/realsense2Driver.cpp.o 
/usr/share/miniconda/envs/test/bin/x86_64-conda-linux-gnu-c++ -Dyarp_realsense2_EXPORTS  -Wall -Wextra -Wsign-compare -Wpointer-arith -Winit-self -Wnon-virtual-dtor -Wcast-align -Wunused -Wunused-but-set-variable -Wvla -Wmissing-include-dirs -Wlogical-op -Wreorder -Wsizeof-pointer-memaccess -Woverloaded-virtual -Wundef -Wredundant-decls -Wunknown-pragmas -Wunused-result -Wc++2a-compat -Wignored-attributes -Wdangling-else -Wmisleading-indentation -Wtautological-compare -Wsuggest-override -Wmaybe-uninitialized  -Wno-unused-parameter  -Wdeprecated-declarations -fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /usr/share/miniconda/envs/test/include  -fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /usr/share/miniconda/envs/test/include -O3 -DNDEBUG -fPIC -MD -MT src/devices/realsense2/CMakeFiles/yarp_realsense2.dir/realsense2Driver.cpp.o -MF src/devices/realsense2/CMakeFiles/yarp_realsense2.dir/realsense2Driver.cpp.o.d -o src/devices/realsense2/CMakeFiles/yarp_realsense2.dir/realsense2Driver.cpp.o -c /home/runner/work/yarp-device-realsense2/yarp-device-realsense2/src/devices/realsense2/realsense2Driver.cpp
/home/runner/work/yarp-device-realsense2/yarp-device-realsense2/src/devices/realsense2/realsense2Driver.cpp: In member function 'bool realsense2Driver::getImage(realsense2Driver::depthImage&, realsense2Driver::Stamp*, const rs2::frameset&)':
/home/runner/work/yarp-device-realsense2/yarp-device-realsense2/src/devices/realsense2/realsense2Driver.cpp:1129:24: error: 'nearPlane' was not declared in this scope
 1129 |     getDepthClipPlanes(nearPlane, farPlane);
      |                        ^~~~~~~~~
/home/runner/work/yarp-device-realsense2/yarp-device-realsense2/src/devices/realsense2/realsense2Driver.cpp:1129:35: error: 'farPlane' was not declared in this scope
 1129 |     getDepthClipPlanes(nearPlane, farPlane);
      |                                   ^~~~~~~~
/home/runner/work/yarp-device-realsense2/yarp-device-realsense2/src/devices/realsense2/realsense2Driver.cpp: In member function 'virtual bool realsense2Driver::getFeature(int, double*)':
/home/runner/work/yarp-device-realsense2/yarp-device-realsense2/src/devices/realsense2/realsense2Driver.cpp:1299:80: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 1299 |             b = optionValue2Perc(RS2_OPTION_EXPOSURE, m_color_sensor, (float&) value, valToGet);
      |                                                                                ^~~~~
/home/runner/work/yarp-device-realsense2/yarp-device-realsense2/src/devices/realsense2/realsense2Driver.cpp:1303:76: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 1303 |             b = optionValue2Perc(RS2_OPTION_GAIN, m_color_sensor, (float&) value, valToGet);
      |                                                                            ^~~~~
/home/runner/work/yarp-device-realsense2/yarp-device-realsense2/src/devices/realsense2/realsense2Driver.cpp:1313:85: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 1313 |             b = optionValue2Perc(RS2_OPTION_WHITE_BALANCE, m_color_sensor, (float&) value, valToGet);
      |                                                                                     ^~~~~
/home/runner/work/yarp-device-realsense2/yarp-device-realsense2/src/devices/realsense2/realsense2Driver.cpp:1317:81: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 1317 |             b = optionValue2Perc(RS2_OPTION_SHARPNESS, m_color_sensor, (float&) value, valToGet);
      |                                                                                 ^~~~~
/home/runner/work/yarp-device-realsense2/yarp-device-realsense2/src/devices/realsense2/realsense2Driver.cpp:1321:75: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 1321 |             b = optionValue2Perc(RS2_OPTION_HUE, m_color_sensor, (float&) value, valToGet);
      |                                                                           ^~~~~
/home/runner/work/yarp-device-realsense2/yarp-device-realsense2/src/devices/realsense2/realsense2Driver.cpp:1325:82: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
 1325 |             b = optionValue2Perc(RS2_OPTION_SATURATION, m_color_sensor, (float&) value, valToGet);
      |                                                                                  ^~~~~
traversaro commented 2 years ago

Thanks!