ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to convert pointcloud as well as depth image of Kinect to laser scan?

asked 2016-07-29 14:43:55 -0500

Ros User gravatar image

I am using Kinect to get the depth image and pointclouds. I actually want to convert either pointcloud or depth image to laserscan. I launched openni.launch file and then tried converting depth image to laser scan using: rosrun depthimage_to_laserscan depthimage_to_laserscan image:/camera/depth/image_raw. But when I subscribe to /scan topic I do not get any message being published. I tried the same with pointcloud to laser scan conversion but the problem is same. However, if I only subscribe to those topic messages without converting them to laser scan they seem to be published. I could even visualize them in Rviz. Do we need to do something more to convert the data to laserscan and get the converted data? I am using odroid to get openni data and subscribing to those topics in my virtual machine (that has Ubuntu trusty and ROS Indigo).

edit retag flag offensive close merge delete

Comments

You did make sure that the depthimage_to_laserscan actually subscribes to the depth image topic, right? E.g. by looking at rqt_graph.

Chrissi gravatar image Chrissi  ( 2016-07-29 18:17:58 -0500 )edit

Actually, I had missed out a syntax in rosrun ("=" sign after image). Now, it works perfectly. Thanks.

Ros User gravatar image Ros User  ( 2016-07-31 22:25:49 -0500 )edit

Glad to hear.

Chrissi gravatar image Chrissi  ( 2016-08-01 03:11:26 -0500 )edit

hey! @RosUser I am trying to create laser scan data from Kinect v2. I am having trouble finding the right libraries. Can you help? http://answers.ros.org/question/25278...

pallavbakshi gravatar image pallavbakshi  ( 2017-01-23 13:20:52 -0500 )edit

@pallavbakshi The kinect I am using is version 1 which works with two libraries namely "openni-launch" and "freenect-launch". I suggest you to try running one of these libraries and see if that works. If these libraries do not work, you may want to try the library named "openni2-launch".

Ros User gravatar image Ros User  ( 2017-01-23 15:11:43 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-08-01 01:13:59 -0500

chengwei gravatar image

updated 2016-08-01 01:50:52 -0500

Hi,Ros User, I am ROS beginner, now I want to convert pointcloud to laserscan,the pointclouds recived by Kinect . I refer to the web page :http://wiki.ros.org/pointcloud_to_laserscan ,but I don't know how to build my program ? Can you help me ?

I launched openni.launch file and using: rosrun pointcloud_to_laserscan pointcloud_to_laserscan_node pointcloud:=/camera/depth_registered/points ,and rosrun rviz rviz ,but when I subscribe to /scan topic, I don't get anythings. Do you know why ?

edit flag offensive delete link more

Comments

Depth registration is not enabled by default when launching openni_launch so there might not be a topic like /camera/depth_registered/points (try to visualise it in rviz). Instead just use /camera/depth/points. You don't need the colour information from the registered points anyway.

Chrissi gravatar image Chrissi  ( 2016-08-01 03:11:05 -0500 )edit

Thank you for your reply. I have modified the code: rosrun pointcloud_to_laserscan pointcloud_to_laserscan_node pointcloud:=/camera/depth/points , and I could get the /scan topic , but there is nothing in RVIZ, I could't visualize them in Rviz

chengwei gravatar image chengwei  ( 2016-08-01 04:19:54 -0500 )edit

<include file="$(find openni_launch)/launch/openni.launch"> <node pkg="pointcloud_to_laserscan" type="pointcloud_to_laserscan_node" name="pointcloud_to_laserscan"> <remap from="cloud_in" to="$(arg camera)/depth/points"/> <remap from="scan" to="$(arg camera)/scan"/>

chengwei gravatar image chengwei  ( 2016-08-01 04:20:41 -0500 )edit

This is my launch file, I don't know why there is little point in RVIZ? I know the result is wrong ,but I don't know why? can you help me ? Thank you!

chengwei gravatar image chengwei  ( 2016-08-01 04:22:30 -0500 )edit

So you have the scan topic, which you remap to something else <remap from="scan" to="$(arg camera)/scan"/> so I guess you tried to visualise that in rviz? But you can echo it, right? Does rviz complain about anything? Most likely the tf frame you are using as a global frame is not there.

Chrissi gravatar image Chrissi  ( 2016-08-01 04:32:52 -0500 )edit

By default, the global frame is /map so if you do not have a map then change the global frame to something else from the drop down menu. Have a look at the rviz user guide

Chrissi gravatar image Chrissi  ( 2016-08-01 04:33:59 -0500 )edit

If you get error when Fixed frame is map, you can change Fixed frame to "camera_link". It worked for me.

Ros User gravatar image Ros User  ( 2016-08-01 19:38:58 -0500 )edit

Hi, Chrissi and Ros User, Thank you for your help! I can get the laserscan points after modified the target_frame:"target_frame: camera_link". In view of the laserscan points number too little, I adjusted the parameters "angle_increment". Thanks again.

chengwei gravatar image chengwei  ( 2016-08-01 21:50:32 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2016-07-29 14:43:55 -0500

Seen: 1,517 times

Last updated: Aug 01 '16