0
$\begingroup$

Rosanswers logo

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).


Originally posted by Ros User on ROS Answers with karma: 40 on 2016-07-29

Post score: 0


Original comments

Comment by Chrissi on 2016-07-29:
You did make sure that the depthimage_to_laserscan actually subscribes to the depth image topic, right? E.g. by looking at rqt_graph.

Comment by Ros User on 2016-07-31:
Actually, I had missed out a syntax in rosrun ("=" sign after image). Now, it works perfectly. Thanks.

Comment by Chrissi on 2016-08-01:
Glad to hear.

Comment by pallavbakshi on 2017-01-23:
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/252780/pointcloud-to-laserscanner-using-kinectv2/

Comment by Ros User on 2017-01-23:
@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".

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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 ?


Originally posted by chengwei with karma: 51 on 2016-08-01

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by Chrissi on 2016-08-01:
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.

Comment by chengwei on 2016-08-01:
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

Comment by chengwei on 2016-08-01:

Comment by chengwei on 2016-08-01:
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!

Comment by Chrissi on 2016-08-01:
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.

Comment by Chrissi on 2016-08-01:
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

Comment by Ros User on 2016-08-01:
If you get error when Fixed frame is map, you can change Fixed frame to "camera_link". It worked for me.

Comment by chengwei on 2016-08-01:
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.

Comment by Chrissi on 2016-08-02:
You're welcome!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.