ROS2 Zed Point Cloud Issue

Hi,

I’m currently porting a zed-based application from ROS1 (melodic) to ROS2 (eloquent) on a Jetson TX2. Using the Zed ROS2 wrapper (eloquent branch due to Jetpack constraints) I can’t seem to get point clouds to appear in rviz2. Images are normal and pointclouds are being published, but based on ros2 echo output they appear to be very sparse with no actual points:

$ ros2 topic hz /zed2/zed_node/point_cloud/cloud_registered
average rate: 4.655
min: 0.063s max: 0.592s std dev: 0.16702s window: 8
average rate: 4.241
min: 0.059s max: 0.663s std dev: 0.18728s window: 14

$ ros2 topic echo /zed2/zed_node/point_cloud/cloud_registered
header:
stamp:
sec: 1517158190
nanosec: 691496302
frame_id: zed2_left_camera_frame
height: 360
width: 640
fields:

  • name: x
    offset: 0
    datatype: 7
    count: 1
  • name: y
    offset: 4
    datatype: 7
    count: 1
  • name: z
    offset: 8
    datatype: 7
    count: 1
  • name: rgb
    offset: 12
    datatype: 7
    count: 1
    is_bigendian: false
    point_step: 16
    row_step: 10240
    data: [255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127, 255, 255, 255, 127, ‘…’]
    is_dense: false

Strangely ros2 topic bw indicates that these pointclouds are much larger than what I’m seeing from ros2 topic echo:

$ ros2 topic bw /zed2/zed_node/point_cloud/cloud_registered
Subscribed to [/zed2/zed_node/point_cloud/cloud_registered]
average: 17.46MB/s
mean: 3.69MB/s min: 3.69MB/s max: 3.69MB/s window: 2
average: 15.57MB/s
mean: 3.69MB/s min: 3.69MB/s max: 3.69MB/s window: 6

This same setup produces good point clouds via the ROS1 Zed wrapper.

I notice the following error messages as the zed_wrapper node starts up:

[zed_wrapper-2] 1517158874.194680857 [zed2.zed_node] [INFO] ***** STARTING CAMERA *****
[zed_wrapper-2] 1517158874.194723780 [zed2.zed_node] [INFO] SDK Version: 3.5.5 - Build 30279_a338b675
[zed_wrapper-2] 1517158874.217770189 [zed2.zed_node] [INFO] *** CAMERA OPENING ***
[zed_wrapper-2] [ZED][Init] Depth mode: PERFORMANCE
[zed_wrapper-2] [ZED][Init] [ERROR] Unable to capture images. Consider trying a lower resolution and/or FPS
[zed_wrapper-2] ** Opening Camera. Attempt 0 …
[zed_wrapper-2] [ZED][Init] [ERROR] Unable to capture images. Consider trying a lower resolution and/or FPS
[zed_wrapper-2] ** Opening Camera. Attempt 1 …
[zed_wrapper-2] [ZED][Init] Video mode: HD720@30
[zed_wrapper-2] 1517158878.891216582 [zed2.zed_node] [INFO] ZED SDK running on GPU #0

which goes away if I reduce depth.point_cloud_freq from default 10.0 to 5.0, but that doesn’t fix the point cloud issue.

Any idea what the problem could be?

Thanks,
Josh

ah, well one mystery is solved: ros2 topic echo is smarter than the old rostopic echo in that it doesn’t try to print the entire huge data set. I missed the ‘…’ in the data field on original look.

That doesn’t affect my original issue, though. Point clouds still are not appearing in rviz2. I am almost sure that I did see good point clouds in rviz2 during an early test, but can’t seem to recreate it.

Hi @jmaximoff
please verify that the QoS parameters in Rviz are compatible with the QoS parameter of the topic that you are subscribing to:
https://www.stereolabs.com/docs/ros2/zed-node/#qos-profiles

Hi Walter,

Yes, the problem was rviz2 QoS settings… still wrapping my head around QoS in DDS/ROS2, and thought I had them right, but apparently not. I was able to customize starting from the config files provided in the zed_display_rviz2 package and now everything is working.

Thanks for your help!

-Josh

1 Like