stereolabs / zed-ros-wrapper

ROS wrapper for the ZED SDK
https://www.stereolabs.com/docs/ros/
MIT License
447 stars 391 forks source link

Problem accessing compressed Images #132

Closed heimsi closed 6 years ago

heimsi commented 7 years ago

Hello,

I am trying to use the compressed image topics ( e.g. /zed/left/image_rect_color/compressed ) because my goal is to use the ZED's output over WLAN.

In my case the _zed_roswrapper runs on a Jetson TX1, with VGA resolution and 15 fps. I can look at the raw image topics and raw depth topics without problems.

But as soon as I try to access the compressed image topics, for example with an image_view node: rosrun image_view image_view image:=/zed/left/image_rect_color _image_transport:=compressed

The zed_ros_wrapper crashes with the following error:

[zed/zed_wrapper_node-4] process has died [pid 3892, exit code -11, cmd /home/ubuntu/catkin_ws/devel/lib/zed_wrapper/zed_wrapper_node __name:=zed_wrapper_node __log:=/home/ubuntu/.ros/log/bc6a3bb0-572f-11e7-824f-705ab6919432/zed-zed_wrapper_node-4.log].

When I launch the zed_wrapper_node in debug mode with launch-prefix="gdb -ex run --args" in zed_camera.launch, debugging shows the following:

[ INFO] [1498125769.037238963]: Advertized on topic rgb/image_rect_color
[ INFO] [1498125769.222155749]: Advertized on topic rgb/image_raw_color
[ INFO] [1498125769.419520434]: Advertized on topic left/image_rect_color
[ INFO] [1498125769.618201623]: Advertized on topic left/image_raw_color
[ INFO] [1498125769.811763413]: Advertized on topic right/image_rect_color
[ INFO] [1498125770.007692116]: Advertized on topic right/image_raw_color
[ INFO] [1498125770.191289743]: Advertized on topic depth/depth_registered
[ INFO] [1498125770.197831581]: Advertized on topic point_cloud/cloud_registered
[ INFO] [1498125770.203473321]: Advertized on topic rgb/camera_info
[ INFO] [1498125770.209933962]: Advertized on topic left/camera_info
[ INFO] [1498125770.215496014]: Advertized on topic right/camera_info
[ INFO] [1498125770.220358487]: Advertized on topic depth/camera_info
[ INFO] [1498125770.226693713]: Advertized on topic odom
[New Thread 0x7f87bac190 (LWP 4167)]
[New Thread 0x7f86fac190 (LWP 4168)]
[New Thread 0x7f873ac190 (LWP 4169)]
[New Thread 0x7f8c486190 (LWP 4170)]

Thread 19 "zed_wrapper_nod" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f87bac190 (LWP 4167)]
strlen () at ../sysdeps/aarch64/strlen.S:92
92  ../sysdeps/aarch64/strlen.S: No such file or directory.

I tested this setup with a different camera (and of course with a different camera node, I used cv_camera ), and it works.

heimsi commented 7 years ago

I have started to do some debugging with outputs. It turns out that the function

CompressedPublisher::publish() ( Link )

of the compressed_image_transport plugin crashes when it tries to encode the image by calling

cv::imencode(".jpg", cv_ptr->image, compressed.data, params) ( here )

I'll try to find out why this is.

heimsi commented 7 years ago

While I didn't get any further finding the problem, I found a work-around: have on the Jetson beside the _zed_ros_wrappernode a republish node, compressing the raw images. But of course it would make the setup simpler to directly be able to use the ZED's compressed image topics.

rbonghi commented 7 years ago

Hi @heimsi,

I have your same problem with a Jetson TX2 and Jetpack 3.0 When I try to open a compressed topic (left, right, rgb, depth) the zed wrapper node go instantaneously in crash:

[zed/zed_wrapper_node-2] process has died [pid 5527, exit code -11, cmd
/home/nvidia/catkin_ws/devel/lib/zed_wrapper/zed_wrapper_node __name:=zed_wrapper_node 
__log:=/home/nvidia/.ros/log/e7dd5634-7155-11e7-b022-00044b80e856/zed-zed_wrapper_node-2.log].
log file: /home/nvidia/.ros/log/e7dd5634-7155-11e7-b022-00044b80e856/zed-zed_wrapper_node-2*.log

My launch file is available on: https://github.com/rbonghi/panther/blob/master/panther_bringup/launch/include/zed_stereo.launch

rbonghi commented 7 years ago

Update With the new zed_wrapper and SDK 2.1 the compressed images are not available.

andre-nguyen commented 6 years ago

Why was compressed image support removed? Recording things raw is extremely impractical.

@nesnes

andre-nguyen commented 6 years ago

@rbonghi @heimsi @nesnes I got it fixed on my end by installing the compressed image transport plugins and adding them as dependencies to the package.

chan-e91 commented 6 years ago

HI Heimsi, "In my case the zed_ros_wrapper runs on a Jetson TX1, with VGA resolution and 15 fps. I can look at the raw image topics and raw depth topics without problems."

How and where we could change the resolution and fps while using ROS wrapper. I am getting low bandwidth errorwhile using ZED with TX1.

ofsource commented 4 years ago

@rbonghi @heimsi @nesnes I got it fixed on my end by installing the compressed image transport plugins and adding them as dependencies to the package.

Hi, andre-nguyen, how did you add dependencies to the package? I met the same problem, and I add_dependencies in both CMakeLists.txt and package.xml, though it still crashed when the compressed image topic was subscribed. Could you give some help?

Myzhar commented 4 years ago

@ofsource $ sudo apt install ros-melodic-image-transport-plugins I will update the package to add the dependency

Myzhar commented 4 years ago

Fixed in https://github.com/stereolabs/zed-ros-wrapper/commit/331e343a2de66f5fbe586a0ffb0be79a59b97299