Filtering roof data

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Filtering roof data

alexr
Hi Mathieu,

I am using ROS Indigo.  How can I filter the roof data from the 3d map. I want to get the sliced data of the whole point cloud minus the roof.
Is there any parameters I can set to do so. In rviz under the MapCloud I can see filter ceiling, but that does not reflect any change if I put the value to 4 or 5 m there.

Thanks
Alex
------ Alex
Reply | Threaded
Open this post in threaded view
|

Re: Filtering roof data

matlabbe
Administrator
Hi,

The parameter "Filter ceiling" in RVIZ under MapCloud works only on future clouds added to map. Example with the robot mapping demo, I set 1 meter and after the first 3 clouds so the next are filtered at 1 meter:


If you want to filter the /cloud_map, you can use a pcl_ros passthrough filter or setting one of these parameter:
<node name="rtabmap" ...
    <!--master--> <param name="Grid/MaxObstacleHeight" type="string" value="1.0" />
    <!--0.11.8--> <param name="cloud_ceiling_culling_height" type="double" value="1.0" />

cheers
Reply | Threaded
Open this post in threaded view
|

Re: Filtering roof data

alexr
Hi Mathieu,

Even with the parameters set,
<param name="Grid/MaxObstacleHeight" type="string" value="1.0" />
 I cannot see the ceiling being filtered. I even tried it within the rviz plugin. Any suggestions.

------ Alex
Reply | Threaded
Open this post in threaded view
|

Re: Filtering roof data

matlabbe
Administrator
Hi,

Is the camera fixed on a robot, or is it hand-held (or on an UAV)? In the first case, if the TFs are correctly set (ground matches the bottom of the point cloud), it would work as the robot mapping demo above.

For the hand-held case, you must update the code (small fix for MapCloud RVIZ plugin so that it performs filtering in /odom frame instead of /base_link frame), set "--Odom/AlignWithGround true" (make sure the camera is seeing the ground on initialization) and "--Grid/MapFrameProjection true" to get /cloud_map correctly filtered.

Example:
$ roslaunch freenect_launch freenect.launch depth_registration:=true
$ roslaunch rtabmap_ros rtabmap.launch rtabmap_args:="--delete_db_on_start --Odom/AlignWithGround true --Grid/MaxObstacleHeight 1 --Grid/MapFrameProjection true" rviz:=true rtabmapviz:=false

cheers,
Mathieu
Reply | Threaded
Open this post in threaded view
|

Re: Filtering roof data

alexr
Hi,

The camera is fixed and the tf are correctly defined.

I can filter the ground when running the rtabmap node but cannot filter the roof still.

Thanks
------ Alex
Reply | Threaded
Open this post in threaded view
|

Re: Filtering roof data

matlabbe
Administrator
Hi,

I tested again with robot mapping demo and I think I reproduced your bug (for the /rtabmap/cloud_map topic, the rviz plugin MapCloud works fine). The problem is when the camera is not seeing the ground, all points of the point cloud are segmented as ground (ignoring Grid/MaxObstacleHeight parameter). I fixed this problem in this commit.

To test it:
$ roslaunch rtabmap_ros demo_robot_mapping.launch rviz:=true rtabmap_args:="--delete_db_on_start --Grid/MaxObstacleHeight 1 --Grid/FromDepth true" rtabmapviz:=false
// Show up /rtabmap/cloud_map in RVIZ
$ rosbag play --clock demo_mapping.bag