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

pointcloud not published in ROS2 Foxy #2295

Closed
Yoshihito-M opened this issue Mar 23, 2022 · 25 comments
Closed

pointcloud not published in ROS2 Foxy #2295

Yoshihito-M opened this issue Mar 23, 2022 · 25 comments
Labels

Comments

@Yoshihito-M
Copy link

Yoshihito-M commented Mar 23, 2022

  • Infos
    LibRealSense v2.50.0
    ROS2 Foxy
    ROS2 Foxy Wrapper build 4.0.4
    Ubuntu 20.04 LTS
    D455

  • Ploblem
    After launching
    ros2 launch realsense2_camera rs_launch.py filters:=pointcloud align_depth:=true,

using ros2 topic list gives me the topics as follows:
/camera/aligned_depth_to_color/camera_info /camera/aligned_depth_to_color/image_raw /camera/color/camera_info /camera/color/image_raw /camera/depth/camera_info /camera/depth/image_rect_raw /camera/depth/metadata /camera/extrinsics/depth_to_color /camera/imu /parameter_events /rosout /tf_static.

As shown above, the topics /camera/depth/color/points is not listed.
In addition, when launching the launch file, the concerned WARN message is shown as follows:
[WARN] could not set param: pointcloud.stream_index_filter with -1 Range: [-1, -2147483648]: parameter 'pointcloud.stream_index filter' could not be set: Parameter {} doesn't comply with integer range.

I guess that that WARN message affects failure of the topics /camera/depth/color/points.
I would like to know how to fix 'pointcloud.stream_index filter'.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Mar 23, 2022

Hi @Yoshihito-M Do you receive the same warnings in ROS2 wrapper 4.0.4 when enabling the pointcloud using the launch instruction below?

ros2 launch realsense2_camera rs_launch.py align_depth:=true pointcloud.enable:=true

@Yoshihito-M
Copy link
Author

Hi @MartyG-RealSense

Thank you for helpful advice.
/camera/depth/color/points could be listed by using the launch instruction .
However, another error message is shown as follows when displaying /camera/depth/color/points in Rviz2:
No stream match for pointcloud chosen texture process - Color.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Mar 24, 2022

The warning No stream match for pointcloud chosen texture process - Color can appear every time that there is an unavailable texture, likely because of a frame drop. The point cloud will not be published in the frame that the message occurs. Is the point cloud able to be generated in RViz2 even though the warning is appearing, please?

@Yoshihito-M
Copy link
Author

@MartyG-RealSense
The issue I mentioned above has been cleared up.
The important point to display /camera/depth/color/points in Rviz2 is plugging in PC into the power outlet while using Rviz2.
I guess that Rviz2 should not be used on battery-powered mode of PC.

As a result, I could solve my issue by your advices.
Thanks!!

@MartyG-RealSense
Copy link
Collaborator

I'm pleased to hear that you achieved a solution, @Yoshihito-M - thanks very much for the update!

@JMadhup
Copy link

JMadhup commented Jul 4, 2023

hi @Yoshihito-M and @MartyG-RealSense,

I am using the D445 camera on the humble version of ROS2. The problem I am facing is that when I do a ros2 topic list, the /camera/depth/color/points topic is present but it seems no data is being published over it. I tried ros2 topic echo and also tried to visualize it in rviz2 but couldn't visualize the data or echo it in the terminal.

@MartyG-RealSense
Copy link
Collaborator

Hi @JMadhup Are you including pointcloud.enable:=true in your launch instruction, please?

ros2 launch realsense2_camera rs_launch.py pointcloud.enable:=true

@JMadhup
Copy link

JMadhup commented Jul 4, 2023

@MartyG-RealSense yes that is exactly the same command I am using.
I have also tried using ros2 launch realsense2_camera rs_launch.py align_depth:=true pointcloud.enable:=true but the issue persists.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Jul 4, 2023

Which RealSense ROS wrapper and librealsense SDK versions are you using?

@JMadhup
Copy link

JMadhup commented Jul 5, 2023

@MartyG-RealSense I am using librealsense version 2.51.1 and realsense ROS version 4.51.1

@MartyG-RealSense
Copy link
Collaborator

In the ROS2 wrapper, the align parameter is align_depth.enable rather than align_depth.

I note that the /camera/depth/color/points topic is published in the list of topics but there are no messages. This at least indicates that the topic is being created by pointcloud.enable.

Are there still no messages if the launch is defined with a low depth and color resolution and FPS?

ros2 launch realsense2_camera rs_launch.py depth_module.profile:=640x480x15 rgb_camera.profile:=640x480x15 pointcloud.enable:=true

@JMadhup
Copy link

JMadhup commented Jul 5, 2023

@MartyG-RealSense No. Launching with low FPS does not help

@MartyG-RealSense
Copy link
Collaborator

Which messages, if any, are published in the ROS launch log after RealSense Node is Up (the point in the log where launch is completed and the sesssion is now running).

@JMadhup
Copy link

JMadhup commented Jul 5, 2023

@MartyG-RealSense
[realsense2_camera_node-1] [WARN] [1688555081.354793351] [camera.camera]:
is the only message after that

@MartyG-RealSense
Copy link
Collaborator

What method did you use to install librealsense and the ROS wrapper? Did you install librealsense first and test that it worked successfully, and then install the wrapper secondly after that from source code with colcon build

@JMadhup
Copy link

JMadhup commented Jul 5, 2023

@MartyG-RealSense
I first built librealsense from source and tested that it worked successfully and then installed the ROS wrapper using apt

@MartyG-RealSense
Copy link
Collaborator

Let's check if the align function is able to publish aligned topics and messages are being generated. If align also does not publish messages then it could suggest a problem with the ROS wrapper or the particular computer that the wrapper is being run on.

ros2 launch realsense2_camera rs_launch.py align_depth.enable:=true

@JMadhup
Copy link

JMadhup commented Jul 27, 2023

Hello @MartyG-RealSense,

Sorry for the late response, I got otherwise engaged.

I tried using the command that you specified and the align function does infact publish the aligned topic and messages are also being generated. I was able to visualize the image_raw message using the image_view package but the image was same as it is on the /camera/depth/image_rect_raw topic

@MartyG-RealSense
Copy link
Collaborator

What do the aligned topics look like in RViz instead of image_view?

@JMadhup
Copy link

JMadhup commented Jul 27, 2023

@MartyG-RealSense

The aligned topic has now also stopped generating any messages. I tried both with RViz and image_view

@MartyG-RealSense
Copy link
Collaborator

@JMadhup Which computer you are using. Is it a PC such as a laptop or desktop, or a computing board such as Raspberry Pi or Nvidia Jetson?

@JMadhup
Copy link

JMadhup commented Jul 28, 2023

@MartyG-RealSense
I am using a Raspberry Pi 4 running an installation of ubuntu desktop 22.04

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Jul 28, 2023

Is the pointcloud published if you leave out the align_depth parameter from the launch, as the pointcloud should be generated even if align_depth is not set to True.

ros2 launch realsense2_camera rs_launch.py pointcloud.enable:=true

@ashBabu
Copy link

ashBabu commented Aug 31, 2023

Raspbery Pi 4 (8 GB), Ubuntu 22.04, ROS2 humble, d435i

Launching realsense camera with the launch_arguments "pointcloud.enable": "True" on raspberry pi 4 will not publish pointclouds. This argument in fact slows down the publishing rate of depth images from the specified rate of 30 to around 8 Hz. However if the pointcloud.enable argument is removed, then the rate of publishing of depth images is at the specified 30 Hz itself and by using either the plugin='rtabmap_util::PointCloudXYZ' or depth_image_proc, the pointclouds could be published at around the same 30 Hz rate. I installed everything using apt. sudo apt-get install ros-humble-realsense2*. More details on how to launch (for anyone interested) is available at my blog

@MartyG-RealSense
Copy link
Collaborator

Thanks so much @ashBabu for sharing your Pi pointcloud method with the RealSense community!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants