robotology / yarp-device-realsense2

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

Example application XML not working #47

Open giotherobot opened 1 month ago

giotherobot commented 1 month ago

The example in the README.md seems to not be updated:

yarprobotinterface --config realsense.xml
[ERROR] |yarp.os.Property| cannot read from yarprobotinterface.ini
[DEBUG] Reading file /home/giovannif/yarp-device-realsense2/realsense.xml
[ERROR] DTD V1.x has been deprecated. Please update your configuration files to DTD v3.x
[ERROR] Invalid DTD version, execution stopped.
[FATAL] Config file  /home/giovannif/yarp-device-realsense2/realsense.xml  not parsed correctly.
Trace requested at /home/giovannif/robotology-superbuild/src/YARP/src/yarprobotinterface/Module.cpp:132 by code called from:
/home/giovannif/robotology-superbuild/build/install/bin/../lib/libYARP_os.so.3(_Z16yarp_print_traceP8_IO_FILEPKcj+0x36) [0x71cc23e309b6]
yarprobotinterface(+0x8208) [0x5b97d328e208]
yarprobotinterface(+0x9f12) [0x5b97d328ff12]
/home/giovannif/robotology-superbuild/build/install/bin/../lib/libYARP_os.so.3(_ZN4yarp2os8RFModule9runModuleERNS0_14ResourceFinderE+0xd7) [0x71cc23e88a97]
yarprobotinterface(+0x7a6d) [0x5b97d328da6d]
/lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x71cc23829d90]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x71cc23829e40]
yarprobotinterface(+0x7b40) [0x5b97d328db40]

Yarp version: YARP version 3.9.0+14-20240603.1+git169ae4656 Building from superbuild, librealsense installed via conda.

giotherobot commented 1 month ago

For the DTD version I found this related comment:

https://github.com/robotology-legacy/codyco-modules/issues/276#issuecomment-508027870

Adding <!DOCTYPE robot PUBLIC "-//YARP//DTD yarprobotinterface 3.0//EN" "http://www.yarp.it/DTD/yarprobotinterfaceV3.0.dtd"> allows the parsing to continue but then I get:

yarprobotinterface --config realsense.xml
[ERROR] |yarp.os.Property| cannot read from yarprobotinterface.ini
[DEBUG] Reading file /home/giovannif/yarp-device-realsense2/realsense.xml
[DEBUG] yarprobotinterface: using xml parser for DTD v3.x
[DEBUG] Reading file /home/giovannif/yarp-device-realsense2/realsense.xml
[INFO] Yarprobotinterface was started using the following enable_tags: 
[INFO] Yarprobotinterface was started using the following disable_tags: 
[DEBUG] List of all enable attributes found in the include tags: 
[DEBUG] List of all disable attributes found in the include tags: 
[DEBUG] Preprocessor complete in:  1.43051e-06 s
[ERROR] Syntax error while loading  at line 2 . Root element should be "robot". Found application
[FATAL] Config file  /home/giovannif/yarp-device-realsense2/realsense.xml  not parsed correctly.
Trace requested at /home/giovannif/robotology-superbuild/src/YARP/src/yarprobotinterface/Module.cpp:132 by code called from:
/home/giovannif/robotology-superbuild/build/install/bin/../lib/libYARP_os.so.3(_Z16yarp_print_traceP8_IO_FILEPKcj+0x36) [0x74de84b2c9b6]
yarprobotinterface(+0x8208) [0x6451d3272208]
yarprobotinterface(+0x9f12) [0x6451d3273f12]
/home/giovannif/robotology-superbuild/build/install/bin/../lib/libYARP_os.so.3(_ZN4yarp2os8RFModule9runModuleERNS0_14ResourceFinderE+0xd7) [0x74de84b84a97]
yarprobotinterface(+0x7a6d) [0x6451d3271a6d]
/lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x74de84629d90]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x74de84629e40]
yarprobotinterface(+0x7b40) [0x6451d3271b40]

which I guess is reasonable.

giotherobot commented 1 month ago

Trying to switch from robot to application returns:

yarprobotinterface --config realsense.xml
[ERROR] |yarp.os.Property| cannot read from yarprobotinterface.ini
[DEBUG] Reading file /home/giovannif/yarp-device-realsense2/realsense.xml
[WARNING] Invalid syntax while loading /home/giovannif/yarp-device-realsense2/realsense.xml at line 1 . Unknown document type. Supported document types are: "robot", "devices", "params"
[WARNING] Invalid syntax while loading /home/giovannif/yarp-device-realsense2/realsense.xml at line 1 . No DTD found. Assuming version yarprobotinterfaceV3.0
[ERROR] DTD V1.x has been deprecated. Please update your configuration files to DTD v3.x
[ERROR] Invalid DTD version, execution stopped.
[FATAL] Config file  /home/giovannif/yarp-device-realsense2/realsense.xml  not parsed correctly.
Trace requested at /home/giovannif/robotology-superbuild/src/YARP/src/yarprobotinterface/Module.cpp:132 by code called from:
/home/giovannif/robotology-superbuild/build/install/bin/../lib/libYARP_os.so.3(_Z16yarp_print_traceP8_IO_FILEPKcj+0x36) [0x7dcb681ac9b6]
yarprobotinterface(+0x8208) [0x641021174208]
yarprobotinterface(+0x9f12) [0x641021175f12]
/home/giovannif/robotology-superbuild/build/install/bin/../lib/libYARP_os.so.3(_ZN4yarp2os8RFModule9runModuleERNS0_14ResourceFinderE+0xd7) [0x7dcb68204a97]
yarprobotinterface(+0x7a6d) [0x641021173a6d]
/lib/x86_64-linux-gnu/libc.so.6(+0x29d90) [0x7dcb67c29d90]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80) [0x7dcb67c29e40]
yarprobotinterface(+0x7b40) [0x641021173b40]
giotherobot commented 1 month ago

I was confused between a yarpmanager configuration file and a yarprobotinterface one.

Opening the file from the yarpmanager works, but then the command yarpdev --from RealSense_conf.ini does not work.

Testing the same command on the command line shows:

yarpdev --from RealSense_conf.ini 
[ERROR] |yarp.os.YarpPluginSettings| Cannot find "RGBDSensorWrapper" plugin (not built in, and no .ini file found for it)Check that YARP_DATA_DIRS leads to at least one directory with plugins/RGBDSensorWrapper.ini or share/yarp/plugins/RGBDSensorWrapper.ini in it
[ERROR] |yarp.dev.PolyDriver|RGBDSensorWrapper| Could not find device <RGBDSensorWrapper>
[DEBUG] |yarp.dev.Drivers|RGBDSensorWrapper| ===============================================================
[DEBUG] |yarp.dev.Drivers|RGBDSensorWrapper| == Options checked by device:
[DEBUG] |yarp.dev.Drivers|RGBDSensorWrapper| ==
[DEBUG] |yarp.dev.Drivers|RGBDSensorWrapper| device=RGBDSensorWrapper
[DEBUG] |yarp.dev.Drivers|RGBDSensorWrapper| id [RGBDSensorWrapper]
[DEBUG] |yarp.dev.Drivers|RGBDSensorWrapper|     Id assigned to this device
[DEBUG] |yarp.dev.Drivers|RGBDSensorWrapper| ==
[DEBUG] |yarp.dev.Drivers|RGBDSensorWrapper| ===============================================================
[ERROR] |yarp.dev.Drivers|RGBDSensorWrapper| yarpdev: ***ERROR*** device not available.
[INFO] |yarp.dev.Drivers|RGBDSensorWrapper| Suggestions:
[INFO] |yarp.dev.Drivers|RGBDSensorWrapper| + Do "yarpdev --list" to see list of supported devices.

Checking some working configuration files from the robots with @traversaro we found out that the RGBDSensorWrapper was renamed to rgbdSensor_nws_yarp at some point. So with thhis file:

device       rgbdSensor_nws_yarp
subdevice    realsense2
name         /depthCamera

[SETTINGS]
depthResolution (480 270)    #Other possible values (424 240) or (640 480)
rgbResolution   (424 240)    #Other possible values (424 240) or (640 480)
framerate       30
enableEmitter   true
needAlignment   true
alignmentFrame  RGB

[HW_DESCRIPTION]
clipPlanes (0.2 10.0)

the command yarpdev --from RealSense_conf.ini starts.

I am still unable to see the images in the yarpview though.

giotherobot commented 1 month ago

In the end I had to install some packages on apt, following:

https://github.com/IntelRealSense/librealsense/blob/development/doc/distribution_linux.md#installing-the-packages

installing only the dkms and utils pacakges.