Robotics StackExchange | Archived questions

2D map with velodyne and octomap_server

Hi, I have a Velodyne VLP-16 on a robot and I am trying to build a 2D map from the velodyne point clouds using octomapserver. The velodyne point clouds are published on topic velodynepoints. I have odometry from a transform from world -> baselink frames. Since octomapserver requires a transform from sensor data frame to global map frame, I published a static transform from baselink -> velodyne and then remapped the cloudin topic to velodyne_points as follows:

<node pkg="tf" type="static_transform_publisher" name="velodyne_tf" args="0 0 0 0 0 0 base_link velodyne 100" /> 
<node pkg="octomap_server" type="octomap_server_node" name="octomap_server">
     <param name="resolution" value="0.05" />
     <param name="frame_id" type="string" value="world" />
     <param name="sensor_model/max_range" value="15.0" />
     <param name="occupancy_min_z" value="0.05" />
     <param name="occupancy_max_z" value="0.5" />
     <remap from="cloud_in" to="velodyne_points" />
</node>

However, no map is published. When I view the tf tree it is world -> base_link -> velodyne. Any ideas as to why this isn't working?

Thank you!

Asked by mmy227 on 2017-05-19 11:51:18 UTC

Comments

Answers

It turns out the time stamps on the velodyne point clouds were off by about 600 seconds from the time stamps on the odometry messages. Subscribing to velodyne_points, changing the time stamps to ros::Time::now(), republishing the clouds on a new topic and using octomap_server with that new topic worked.

Asked by mmy227 on 2017-05-24 10:29:31 UTC

Comments