Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Depth image not changing #85

Closed
2 tasks done
Void12987 opened this issue Mar 18, 2022 · 10 comments
Closed
2 tasks done

Depth image not changing #85

Void12987 opened this issue Mar 18, 2022 · 10 comments
Labels
bug Something isn't working

Comments

@Void12987
Copy link

Preliminary Checks

  • This issue is not a duplicate. Before opening a new issue, please search existing issues.
  • This issue is not a question, feature request, or anything other than a bug report directly related to this project.

Description

Installing Zed on Foxy works for every topic except depth data and point cloud data. This might be a duplicate of #81, but not sure.

Steps to Reproduce

  1. Install zed_ros_wrapper as per the README instructions
  2. ros2 run image_transport republish compressed --ros-args -r in/compressed:=image_compressed -r out:=image_raw
  3. ros2 launch zed_wrapper zed2.launch.py

Expected Result

ros2 topic echo /zed2/zed_node/depth/depth_registered has changing data

Actual Result

it's the same black image

ZED Camera model

ZED2

Environment

OS: Ubuntu 20.04
CPU: x86_64
GPU Nvidia 1060
ZED SDK: 3.7
ROS Foxy

Anything else?

  1. If the republish node is necessary to get the data, should it be on the README?
  2. If it's not necessary, what could be the reason why no data (even normal image data) can be retrieved in ROS?
@Void12987 Void12987 added the bug Something isn't working label Mar 18, 2022
@Myzhar
Copy link
Member

Myzhar commented Mar 18, 2022

Hi @Void12987
image_transport is faulty in ROS2 Foxy.
It's a known problem:
https://github.com/stereolabs/zed-ros2-wrapper#image-transport-plugins-and-compressed-topics

@Void12987
Copy link
Author

Void12987 commented Mar 18, 2022

Hi @Myzhar,

Although I removed the image_transport packages, is there anything I can do to get depth data working? I'm confused because I followed the README and saw your depth demo on LinkedIn, so I might be missing something.

@Myzhar
Copy link
Member

Myzhar commented Mar 18, 2022

I just followed the instructions step by step to be sure that everything works as expected and that nothing is missing:

$ ros2 topic hz /zed2/zed_node/depth/depth_registered
average rate: 15.002
	min: 0.065s max: 0.068s std dev: 0.00054s window: 17
average rate: 14.531
	min: 0.065s max: 0.133s std dev: 0.01177s window: 31
average rate: 14.361
	min: 0.065s max: 0.133s std dev: 0.01372s window: 45
average rate: 14.273
	min: 0.065s max: 0.133s std dev: 0.01448s window: 59
average rate: 14.414
	min: 0.065s max: 0.133s std dev: 0.01300s window: 74

Be sure to install the correct image_transport package v3.0.0 as described here:
https://github.com/stereolabs/zed-ros2-wrapper#image-transport-and-topic-subscriptions

@Void12987
Copy link
Author

Yes ros2 topic hz works fine, but does your ros2 topic echo have changing data?

@Myzhar
Copy link
Member

Myzhar commented Mar 18, 2022

Looking at the data in ros2 topic echo is not a good way to debug and understand if this kind of topic is correctly published.

- 255
- 255
- 127
- '...'
---

this means that not all the data are displayed for obvious reasons. Furthermore, you are trying to read floating-point values from a vector of uint8_t values...

if you want to be sure that the depth map is changing you can use instead the rqt viewer by selecting PlugIns -> Visualization -> Image View
Screenshot from 2022-03-18 15-45-46

If you have not installed rqt:

sudo apt install ros-foxy-rqt-*

@Void12987
Copy link
Author

Void12987 commented Mar 18, 2022

I can confirm I locally built image_common-3.0.0.

Below is a screenshot of using depth quality NEURAL mode, but the image is black.

Screenshot from 2022-03-18 10-57-27

Interestingly, when I try to run depthimage_to_laserscan, zed_wrapper throws an error about the depth and rgb are async.

Screenshot from 2022-03-18 10-56-26

When I run depth quality at PERFORMANCE mode, then the depth data shows up, but it's a bit choppy, not working in certain lighting conditions

Screenshot from 2022-03-18 10-58-56

Maybe my GPU is too old?

@Myzhar
Copy link
Member

Myzhar commented Mar 18, 2022

Have you optimized the NEURAL AI model by running the command
ZED_Diagnostic -ais 8
before starting the ZED node?

@Void12987
Copy link
Author

Thanks so much for helping; it's working now.

Screenshot from 2022-03-18 11-27-05

I thought I'd add some suggestions on updating the README; if you'd like me to open a PR, let me know and I'll do it:

  1. mention to optimize using ZED_Diagnostic
  2. In the installation prompts, it says cudnn is only necessary for object detection, but now that it's required for the default mode for depth detection; it could mention that too, because previously I didn't have cudnn installed
  3. It wasn't clear to me that the v3.0.0 was necessary because afterwards it says to install the latest version, which didn't work, maybe we could erase that part?

Anyways thanks for the help. I hope to be creating a robotics marketplace soon for free advertisement of robotics products, and the ZED camera is the best for that!

@Myzhar
Copy link
Member

Myzhar commented Mar 18, 2022

Do not hesitate to suggest README modifications.
User feedback is always the best way to improve our tools and software.

@Void12987
Copy link
Author

Void12987 commented Mar 18, 2022

Cool, although I don't know how to update the instructions on the install script, I will open a PR for updating this README at some point next week.

UPDATE: I'm not on the project that involves ZED anymore, so I likely won't have time for this now, but good luck on the project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants