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

pointcloud_to_laserscan, how to change the slice height

asked 2017-04-19 05:07:18 -0600

anflores gravatar image

Hi everyone, I am running the pointcloud_to_laserscan package successfully with a Kinect. Now I want to change the height/angle at which the laser takes the slice from the pointcloud. Probably I am missing something, but none of the parameters described in [ ] do what I want. I supposed that the parameters min_height and max_height were defined for this. But in stead, this parameters only select the points of the slice that are within this height range. Any guess?


edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2017-04-19 06:53:43 -0600

Karl Damkjær Hansen gravatar image

Having just looked at the code; the height parameters seem to slice in the pointcloud orthogonal to the z axis in the height interval between min_height and max_height.

There are the parameters angle_min and angle_max, they are referring to the width of the simulated laserscan. So, that is not what you are looking for either.

I guess you may need to transform the pointcloud that are going into the pointcloud_to_laserscan, maybe just changing the reference frame.

edit flag offensive delete link more


Indeed no such parameter, how about forking the code and adding one? (I could use it as well sometimes soon)

Humpelstilzchen gravatar image Humpelstilzchen  ( 2017-04-20 05:14:45 -0600 )edit

answered 2019-03-25 17:39:50 -0600

jdwolk gravatar image

Humplestilzzchen - no need to fork, Karl was spot on

You can control the planar slice in the z-axis with the frame you output to via the target_frame param. In my case I was looking for objects at 6ft high so I created a static transform in my launch file:

<arg name="laser_height" default="1.829" /> <!-- 1.829m == 6ft --> <node pkg="tf" type="static_transform_publisher"' name="laser_height_offset" args="0 0 $(arg laser_height) 0 0 0 /base_link /laser_height 100 />

This creates the /laser_height frame in tf. Then in the config for pointcloud_to_laserscan I have:

<node pkg="pointcloud_to_laserscan" type="pointcloud_to_laserscan_node" name="scan"> <remap from="cloud_in" to="your/Pointcloud2/topic/name" /> <rosparam> target_frame: laser_height ...other params here... </rosparam> </node>

Now you should have a laserscan slice at the level specified by the laser_height param (6ft / 1.829m in my case above).

The min_height and max_height params look like they define a band of points from the pointcloud to operate on; anything outside is ignored.

Thanks Karl!

edit flag offensive delete link more

Question Tools


Asked: 2017-04-19 05:07:18 -0600

Seen: 692 times

Last updated: Apr 19 '17