Ask Your Question
1

issue of ground filter in octomap_server

asked Feb 21

clark gravatar image clark
151 1 12

updated Feb 22

AHornung gravatar image AHornung flag of Germany
1927 5 22 45
http://www.informatik.uni...

I am testing the octomap_server and I used the sample data from http://vimeo.com/1451349?pg=embed&sec=1451349, which is a pcap file collected from a velodyne 64 laser.

Judged from the video and the pointcloud display in rviz, the ground surface is obviously contained in the data set. In my testing, the base_frame_id is set to "base_footprint" which is exactly located at the ground surface; filter_ground is also set to "true". But the generated octomap never filters the ground... and this is the output from the node.

[INFO] [1329732147.087671086] class OctomapServer starts

[INFO] [1329732147.103789973] filter_ground 1

[WARN][1329732208.260183596] No plane found in cloud.

[WARN][1329732208.260282727] No ground plane found in scan

Thanks for any help.

delete close flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted
2

answered Feb 23

clark gravatar image clark
151 1 12

hi, Hornung,

After some debugging, I found the reason for the above filtering issue.

Check the sequence of the following lines in the function OctomapServer::insertCloudCallback of OctomapServer.cpp,

pass.setInputCloud(pc.makeShared());
......

pcl::transformPointCloud(pc, pc, sensorToBase);
pass.filter(pc);
filterGroundPlane(pc, pc_ground, pc_nonground);
......

Since the inputcloud for pass is allocated at the very beginning, so the actual "pc" passed to filterGroundPlane is the old one before transformPointCloud.

So I moved pass.setInputCloud(pc.makeShared()) to right after the line of transformPointCloud, and the ground filtering now works as expected.

The same change should also apply to the case when m_filterGroundPlane=false.

regards

link delete flag offensive edit

Comments

Thanks a lot! That must have sneaked in during some recent refactoring. I had assumed makeShared simply returns a Ptr to the cloud, while the docs clearly state: "Copy the cloud to the heap and return a smart pointer. [...] The changes of the returned cloud are not mirrored back to this one"

AHornung (Feb 24)edit

Fixed in trunk of octomap_mapping

AHornung (Feb 24)edit
0

answered Feb 22

AHornung gravatar image AHornung flag of Germany
1927 5 22 45
http://www.informatik.uni...

octomap_server uses PCL with pcl::SACMODEL_PERPENDICULAR_PLANE to detect and segment the ground plane, which has quite a few parameters to tune. Right now it should work best with stereo data from the PR2, laser data from the Velodyne might need different parameters.

Best have a look at OctomapServer::filterGroundPlane and the PCL documentation on which parameters to tune, ground_filter/distance and ground_filter/angle should be the first ones to try. You can also do a rough filterung just based on height with ground_filter/plane_distance.

Otherwise run rxconsole with setting octomap_server's log level to debug to see what is going on.

link delete flag offensive edit

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
[hide preview]

Question tools

Follow

subscribe to rss feed

Stats

Asked: Feb 21

Seen: 64 times

Last updated: Feb 23