# pointcloud_to_laserscan, how to change the slice height

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 [ http://wiki.ros.org/pointcloud_to_las... ] 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?

Thanks!

edit retag close merge delete

Sort by » oldest newest most voted

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.

more

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

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

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!

more