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

How to setup pointcloud_to_laserscan?

asked 2011-03-16 08:35:36 -0500

Murph gravatar image

updated 2016-10-24 09:08:23 -0500

ngrennan gravatar image

I've got a pointcloud from my kinect, and I'd like a laserscan for amcl to play with.

The wiki page really doesn't give any usage instructions, and seems to indicate it's a part of "TurtleBot" - but the installation hints say it should be part of "perception_pcl".

What do i rosrun to get this thing to go? Is there a ros command line tool to search which package something is in?

edit retag flag offensive close merge delete

6 Answers

Sort by ยป oldest newest most voted
5

answered 2011-03-17 03:12:24 -0500

tom gravatar image

updated 2011-03-17 21:49:19 -0500

Try using this launchfile (add it to pointcloud_to_laserscan/launch, I called it openni_laser.launch). I think I'm trying to achieve similar things you are. My question here. I'm assuming you have openni_kinect installed. The fake laserscans will be published in the /scan topic, you can see them in rviz.

<launch>
  <!-- kinect and frame ids -->
  <include file="$(find openni_camera)/launch/openni_node.launch"/>

  <!-- openni_manager -->
  <node pkg="nodelet" type="nodelet" name="openni_manager" output="screen" respawn="true" args="manager"/>

  <!-- throttling -->
  <node pkg="nodelet" type="nodelet" name="pointcloud_throttle" args="load pointcloud_to_laserscan/CloudThrottle openni_camera">
    <param name="max_rate" value="2"/>
    <remap from="cloud_in" to="/camera/depth/points"/>
    <remap from="cloud_out" to="cloud_throttled"/>
  </node>

  <!-- fake laser -->
  <node pkg="nodelet" type="nodelet" name="kinect_laser" args="load pointcloud_to_laserscan/CloudToScan openni_camera">
    <param name="output_frame_id" value="/openni_depth_frame"/>
    <remap from="cloud" to="cloud_throttled"/>
  </node>
</launch>
edit flag offensive delete link more

Comments

They're published to the '/scan' topic? What is this doing, then: <param name="output_frame_id" value="/openni_depth_frame"/>
Murph gravatar image Murph  ( 2011-03-17 08:04:12 -0500 )edit
Also, did you change your openni_node.launch any? If i set my nodlets to wait on openni_camera like you did they never go - I can set them to wait on openni_manager but i don't know if that's a good idea.
Murph gravatar image Murph  ( 2011-03-17 09:06:31 -0500 )edit
Yes, they're published to the default /scan topic. As far as I understand this, it's not the output_topic that's being remapped, but the coordinate frame's name. I'm using the default openni_node.launchfile, I didn't change it. See also Patrick's answer in the link I provided above, may help you.
tom gravatar image tom  ( 2011-03-17 21:47:44 -0500 )edit
Okay, I see a /scan topic now - I did have to change things from waiting on openni_camera to openni_manager, otherwise it didn't load. Thanks for the help!
Murph gravatar image Murph  ( 2011-03-18 04:43:21 -0500 )edit

Hi, thank you so much!! I just wanted to highlight below @Bart - for fuerte with precise you need to add the mods that are in that launch file i.e:

kleinash gravatar image kleinash  ( 2012-10-15 03:20:34 -0500 )edit

Hi, thank you so much!! I just wanted to highlight below @Bart - for fuerte with precise you need to add the mods that are in that launch file i.e:

kleinash gravatar image kleinash  ( 2012-10-15 03:20:37 -0500 )edit
3

answered 2011-03-16 08:51:47 -0500

tfoote gravatar image

Sorry the docs were out of date. It has moved from the ni stack to the turtlebot stack. It's a unreviewed/released glue package used in the turtlebot.

You can get it by installing the ros-diamondback-turtlebot deb or installing turtlebot from source.

To find packages etc from the command line you can use the roslocate tool. Or simply look at the top of the package page for what stack it's inside.

edit flag offensive delete link more
2

answered 2011-03-17 14:02:48 -0500

Bart gravatar image

The answer to this question was recently posted by Patrick in a neighboring question regarding 2D Slam. (followed the link provided above by Tom) His suggested launch file worked nicely and addressed the concern posted by Tom above. I have copied it here for completeness ...

<launch> <include file="$(find openni_camera)/launch/openni_node.launch"/>

<node pkg="nodelet" type="nodelet" name="openni_manager" output="screen" respawn="true" args="manager"/>

<node pkg="nodelet" type="nodelet" name="pointcloud_throttle" args="load pointcloud_to_laserscan/CloudThrottle openni_manager"> <param name="max_rate" value="2"/> <remap from="cloud_in" to="/camera/depth/points"/> <remap from="cloud_out" to="cloud_throttled"/> </node>

<node pkg="nodelet" type="nodelet" name="kinect_laser" args="load pointcloud_to_laserscan/CloudToScan openni_manager"> <param name="output_frame_id" value="/openni_depth_frame"/> <remap from="cloud" to="cloud_throttled"/> </node> </launch>

edit flag offensive delete link more

Comments

Another nice feature to add to this launch file is control of the Kinect tilt, as provided by the kinect_base package by Nathaniel Robert Lewis:
Bart gravatar image Bart  ( 2011-03-17 14:17:01 -0500 )edit
I don't see that kinect_base package, but there is a 'kinect_aux' file that claims to provide these features - I haven't tried it yet though. http://www.ros.org/wiki/kinect_aux
Murph gravatar image Murph  ( 2011-03-18 04:44:52 -0500 )edit
git clone https://github.com/Teknoman117/ni.git, creates ni folder in home directory, just copy over the kinect_base package.
Bart gravatar image Bart  ( 2011-03-18 08:53:58 -0500 )edit
1

answered 2011-03-16 18:15:29 -0500

Bart gravatar image

I can't solve your problem, but I can offer some encouragement. Pointcloud_to_laserscan was working very nicely in ROS "unstable" (just prior to Diamondback) from the "ni" stack. It would launch the openni_camera, pointcloud_throttle and kinect_laser nodes. I was able to adjust the "thickness" of the laser to match the height of my robot. It ran well on a robot mounted laptop communicating with a wireless network connection to rviz running on a stationary client computer. Launching was as simple as "roslaunch pointcloud_to_laserscan kinect_laser.launch". Looking at rxconsole, it indicates that all of the nodes/nodelets (openni_camera, pointcloud_throttle, kinect_laser) are passing back and forth nine "openni_camera/bond" messages and the laser displays in rviz in a satisfying manner.

I have not yet been successful in Diamondback. I have the openni_kinect stack and the turtlebot stack which now contains pointcloud_to_laserscan, but "roslaunch pointcloud_to_laserscan kinect_laser.launch" gives an error, "while processing /opt/ros/dturtle/openni_kinect/openni_camera/launch/openni_kinect.launch: "Invalid roslaunch XML syntax: [Errno 2] No such file or directory: u'/opt/ros/dturtle/openni_kinect/openni_camera/launch/openni_kinect.launch' "

I modified kinect_laser.launch to point to openni_node.launch in openni_camera, but the various nodes/nodelets did not link together to pass messages successfully. I am not familiar enough with nodelets to describe what is happening/not happening and have not yet determined how to duplicate my previous success.

Tully Foote is the original author of the pointcloud_to_laserscan package and we can thank him for this useful package. Hopefully he will drop by this question one more time to straighten us out.

The pointcloud_to_laserscan package is probably pretty popular with many of us looking for an inexpensive "laser" to experiment with the navigation stack as you described. It seems to have been bounced around from stack to stack looking for a permanent home. It would be pleasant if this package was added to the openni_kinect stack and the launch file was adjusted for easy success.

edit flag offensive delete link more
1

answered 2012-10-15 03:22:08 -0500

kleinash gravatar image

Thank you >> just as an update (and after a bit of head bashing) the final launch file is: (note the changes to the include launch file and the name of the nodelet required)

<launch> <include file="$(find openni_launch)/launch/openni.launch"/>

<node pkg="nodelet" type="nodelet" name="openni_manager" output="screen" respawn="true" args="manager"/>

<node pkg="nodelet" type="nodelet" name="pointcloud_throttle" args="load pointcloud_to_laserscan/CloudThrottle openni_manager"> <remap from="cloud_in" to="/camera/depth/points"/> <remap from="cloud_out" to="cloud_throttled"/> </node>

<node pkg="nodelet" type="nodelet" name="kinect_laser" args="load pointcloud_to_laserscan/CloudToScan openni_manager"> <remap from="cloud" to="cloud_throttled"/> </node> </launch>

edit flag offensive delete link more
0

answered 2015-09-29 00:29:50 -0500

Gloria@HK gravatar image

updated 2015-09-29 00:30:39 -0500

I used ROS indigo recently. For ROS indigo, we can use

roslaunch pointcloud_to_laserscan sample_node.launch

directly. And I also remap the 'cloud_in' to '/camera/depth/points'.

edit flag offensive delete link more

Question Tools

3 followers

Stats

Asked: 2011-03-16 08:35:36 -0500

Seen: 6,859 times

Last updated: Sep 29 '15