How to clear the OccupancyGrid map
Hi, I am using rviz to show real time OccupancyGrid map that is converted through pointcloud. The pointcloud is generated by current frame,but OccupancyGrid maps are constantly produced. Now, I just need to show OccupancyGrid of two consecutive frames.Therefore,other OccupancyGrid of outdated frames need to be cleared,otherwise the OccupancyGrid is getting bigger and bigger
This is my launch file:
<launch>
<node pkg="octomap_server" type="octomap_server_node" name="octomap_server">
<!-- resolution in meters per pixel -->
<param name="resolution" value="0.1" />
<!-- name of the fixed frame, needs to be "/map" for SLAM -->
<param name="frame_id" type="string" value="/sensor_frame" />
<!-- max range / depth resolution of the kinect in meter -->
<param name="sensor_model/max_range" value="50.0" />
<param name="latch" value="false" />
<!-- max/min height for occupancy map, should be in meters -->
<param name="pointcloud_max_z" value="1000" />
<param name="pointcloud_min_z" value="0" />
<!-- topic from where pointcloud2 messages are subscribed -->
<remap from="cloud_in" to="/cloud" />
</node>
</launch>