stereolabs / zed-ros2-wrapper

ROS 2 wrapper for the ZED SDK
https://www.stereolabs.com/docs/ros2/
Apache License 2.0
145 stars 145 forks source link

Image transport compressed format can't be changed #109

Closed xkaraman closed 1 year ago

xkaraman commented 1 year ago

Preliminary Checks

Description

I am using Zed2 on ROS2 using the latest SDK 3.8, CUDA 11.4 on a Jetson NX2.

Launching they zed2.launch.py everything works including the compressed, compressedDepth transport plugins. i can echo both of the topics but now i would like to change the format of the plugin from 'jpegtopng. As this a configurable parameter ofimage_transport` package i should be able to do so.

Unfortunately, i can't because as far as i can see from ros2 run rqt_reconfigure rqt_reconfigure. there is no parameter for the plugin options, only for the original topic ie zed2/zed_node rgb.image_rect_color.format. Even this though is not configurable with a message like this from terminal running zed launch file: zed_node.rgb.image_rect_color.format is not a dynamic parameter

Steps to Reproduce

  1. Launch zed2 launch file
  2. Run rqt_reconfigure node
  3. Try changing image format to png but ends with error
  4. Image format of compressed, compressedDepth and other plugins can't be seen in rqt under zed2 node

Expected Result

I expect i can change the format of the image transport plugin or any other parameter of it

Actual Result

Can't chagne due to zed_node.rgb.image_rect_color.format is not a dynamic parameter error

ZED Camera model

ZED2

Environment

Jetpack LT35.1
ARM
Nvidia Jetson NX2 module
ROS Galactic

Anything else?

No response

Myzhar commented 1 year ago

Hi @xkaraman ROS2 Galactic is not LTS, so it's not officially supported

xkaraman commented 1 year ago

Should i expect any difference in humble? Is there any difference on how you handle image transport plugins and their parameters?

Moreover Jetson's Jetpack 5.0.2 (LT35.1) that is LTS only supports (officially) galactic due to being based on Ubuntu 20.04.

Myzhar commented 1 year ago

The official LTS for Ubuntu 20.04 is Foxy. Galactic is an intermediate release that will reach the EOL in the next month. You can use ROS2 Humble on Jetson in a Docker container.

xkaraman commented 1 year ago

Correct, sorry for being mistaken, foxy is the official LTS on Ubuntu 20.04.

Foxy or Humble though treats differently image transport parameters or they are still not a dynamic parameter?

Can you point me to which version will handle them graciously and allow to change format parameter for the image_transport_plugins like compressed and even the original topic?

Myzhar commented 1 year ago

There is a known problem with image_transport in Foxy: https://github.com/stereolabs/zed-ros2-wrapper#known-issues

It works correctly instead in Humble.

xkaraman commented 1 year ago

Yes i have seen that issue and build the 3.0.0 version from source even though i am on galactic dist. ( Don't know if it helps really, correct me if i am wrong).

The problem is regarding their plugins parameters and dynamic reconfiguration (ie http://wiki.ros.org/image_transport#Parameters). ZED seems to discard any changes to them due to not being a dynamic parameter even though it's a from a separate package with their own parameters.

Just want to make sure that working as intended if i am jumping to humble.

Myzhar commented 1 year ago

Ah OK, you can fix this behavior by upgrading to the latest version of the master branch that we released a few minutes ago.

xkaraman commented 1 year ago

Ok i will check it out and report back if the problem persists!

Thanks for the quick respondence! :)

xkaraman commented 1 year ago

I get this error when trying to built the latest master branch! /home/ssd-nvidia/ros2_workspaces/sensors_ws/src/zed-ros2-wrapper/zed_components/src/zed_camera/src/zed_camera_component.cpp:41:2: error: #error Unsupported ROS2 distro 41 | #error Unsupported ROS2 distro

So, i can't built this at all at ROS2 Galactic?

Myzhar commented 1 year ago

Hi @xkaraman As I told you, we do not officially support Galactic. In the new release, we added CMake commands and C++ macros to avoid the compilation for unsupported distributions. You can remove them manually to force the compilation and then fix the eventual compilation issues.

However, by reading the Galactic and Humble changelogs, I noticed that the fixes that you need have been introduced in Humble and not in Galactic.

xkaraman commented 1 year ago

Yes i have tried to remove the CMake checks and it seems to build alright!

I can now alter the format of the image transport. But a crucial point is that i can only do that for the base image topic (this was the case before too, only that i couldnt alter the parameter). There is no parameters for the compressed topic, compressedDepth or any of the plugins! As you can see there is no zed_node.depth.depth_registered.compressed.format ( To be honest i am coming from ROS1 and i am sure there was a different parameter for base, compressed, compressedDepth, don't know if it stands true for ROS2. Correct me if i am wrong)

image

Myzhar commented 1 year ago

Yes, you are right. I can confirm that they are all available in Humble

xkaraman commented 1 year ago

Ok then, so the best way forward for a Nvidia Xavier NX (latest version is based on 20.04 Ubuntu that humble is not available through official packaging) is through Docker Humble version i guess?