ros-perception / depthimage_to_laserscan

Converts a depth image to a laser scan for use with navigation and localization.
253 stars 170 forks source link

depth_image_to_laserscan not publishing to /kinect_scan topic in ROS2 Galactic #73

Closed marcusvinicius178 closed 1 year ago

marcusvinicius178 commented 1 year ago

Hello,

I am trying to convert a depth image to a laser scan using the depthimage_to_laserscan package in ROS2 Galactic, but I am having trouble getting the node to publish the converted LaserScan data. Despite being able to subscribe to the input depth image topic (/kinect_sensor/depth/image_raw), the node doesn't seem to be publishing the converted data to the /kinect_scan topic.

image

Here's the launch file snippet for the depthimage_to_laserscan node:

# Kinect depthimage to laserscan conversion node
depthimage_to_laserscan_node = Node(
    package='depthimage_to_laserscan',
    executable='depthimage_to_laserscan_node',
    name='depthimage_to_laserscan',
    parameters=[kinect_params_file, {'use_sim_time': use_sim_time}],
    remappings=[('depth', '/kinect_sensor/depth/image_raw'),
                ('scan', '/kinect_scan')],
    output='screen')

And my kinect_params.yaml file:

depthimage_to_laserscan_node:
  ros__parameters:
    output_frame: kinect_depth_frame
    scan_height: 1
    range_min: 0.45
    range_max: 10.0
    scan_topic: /kinect_scan

When I inspect the /depthimage_to_laserscan node using ros2 node info, it shows that the node subscribes to /kinect_sensor/depth/image_raw and publishes to /kinect_scan. However, when I echo the /kinect_scan topic, it is empty and produces no output.

Here is a link to a video demonstrating the issue.

I have already tried changing the scan_topic to the original /scan topic in the parameter file and have also checked that the frame_id in the header of the depth image messages is consistent with the output_frame parameter, but these didn't solve the issue.

Could anyone please help me to understand what might be going wrong and how to get the depthimage_to_laserscan node to publish the LaserScan data correctly?

I am facing a similar issue and behavior using other packages image-proc, as related here: https://github.com/ros-perception/image_pipeline/issues/832

Thank you in advance for your help.

huyating99 commented 1 year ago

I use this package on ros foxy on ubuntu20.04,i need to subscribe two topics. The one is the depth image,and the other is camera info such as the intrinsic parameter.