ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org
Ask Your Question
1

depthimage_to_laserscan works with rosrun but the DepthImageToLaserScanNodelet does not work properly

asked 2014-09-10 11:49:24 -0500

zeinab gravatar image

updated 2014-09-11 07:38:04 -0500

Hi,

I have trouble with a nodelet which is responsible for converting depth image to laser scan. I have the required topics namely /camera/depth/camera_info and /camera/depth/image_raw and here is how my launch file looks like:

<launch>
  <arg name="camera"  value="camera"/>
  <arg name="manager" value="$(arg camera)_nodelet_manager" />

  <group ns="$(arg camera)">
    <node pkg="nodelet" type="nodelet" name="$(arg manager)" respawn="true" args="manager"/>
    <node pkg="nodelet" type="nodelet" name="openni2_camera" args="load openni2_camera/OpenNI2DriverNodelet $(arg manager)" respawn="true">
    </node>

    <node pkg="nodelet" type="nodelet" name="depthimage_to_laserscan_loader" args="load depthimage_to_laserscan/DepthImageToLaserScanNodelet $(arg manager)">
        <param name="scan_height" value="10"/>
        <param name="output_frame_id" value="/depth_camera_link"/>
        <param name="range_min" value="0.3"/>
        <remap from="image" to="/depth/image_raw"/>
        <remap from="scan" to="/scan"/>
    </node>
  </group>
</launch>

My problem is that the /scan topic is empty and is not being published. However when I do

rosrun depthimage_to_laserscan depthimage_to_laserscan image:=/camera/depth/image_raw

the /scan topic is being published as expected. Do you have any suggestions?

Thanks a lot in advance.

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
2

answered 2014-09-15 14:22:45 -0500

zeinab gravatar image

updated 2014-11-19 07:23:33 -0500

I finally found the solution. what I should have in the launch file for the remapping of the image should be :

<remap from="image" to="depth/image_raw"/>

So it was the / which was causing the problem. This way it works and the /scan topic is being published correctly.

edit flag offensive delete link more

Comments

Didn't spot that. Gotta be careful about global and private namespaces.

paulbovbel gravatar image paulbovbel  ( 2014-09-16 10:13:56 -0500 )edit
0

answered 2014-09-10 11:59:28 -0500

SaiHV gravatar image

It looks like you're using /depth/image_raw in your nodelet and /camera/depth/image_raw in your rosrun command.

edit flag offensive delete link more

Comments

Thanks for the quick reply. I also have tried with <remap from="image" to="camera/depth/image_raw"/> but it didn't work. I guess that's because of the namespace which prepend /camera to the /depth/image_raw.

zeinab gravatar image zeinab  ( 2014-09-10 12:03:45 -0500 )edit

Can you try removing the <remap from="scan"> line?

SaiHV gravatar image SaiHV  ( 2014-09-10 12:09:19 -0500 )edit

I tried it but I get /camera/scan which is also empty.I checked and realized that this depthimage_to_laserscan node is not subscribing to any topic but is publishing to /scan. This is strange since it should at least subscribe to /camera/depth/image_raw .

zeinab gravatar image zeinab  ( 2014-09-11 05:30:32 -0500 )edit
0

answered 2014-09-11 08:23:13 -0500

paulbovbel gravatar image

Have you tried running openni2 the typical way - using openni2_launch, and then loading the depthimage nodelet to $(arg camera)_nodelet_manager afterwards?

edit flag offensive delete link more

Comments

Hi, Thanks for your reply. I tried running openni2_camera and then launching the launch file without the

<node pkg="nodelet" type="nodelet" name="openni2_camera" args="load openni2_camera/OpenNI2DriverNodelet $(arg manager)" respawn="true">
    </node>

It works. /scan is now published.

zeinab gravatar image zeinab  ( 2014-09-14 15:20:04 -0500 )edit

But I still can't get the original launch file to work properly.

zeinab gravatar image zeinab  ( 2014-09-15 02:58:50 -0500 )edit

Because you're running the openni2 driver nodelet directly, without a lot of the background setup that's done by openni2_launch and openni2_camera

paulbovbel gravatar image paulbovbel  ( 2014-09-15 08:48:44 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-09-10 11:49:24 -0500

Seen: 4,324 times

Last updated: Nov 19 '14