Skip to content

Commit

Permalink
Delete the scans you aren't using (ros-perception#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
svwilliams authored Aug 10, 2018
1 parent 982407c commit 9942feb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/slam_karto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,10 @@ SlamKarto::laserCallback(const sensor_msgs::LaserScan::ConstPtr& scan)
// Notify the optimization thread that data is available
scan_queue_data_available_.notify_one();
}
else
{
delete range_scan;
}
}

void
Expand Down Expand Up @@ -992,7 +996,7 @@ SlamKarto::updateMap()
}
// Build a map from the laserscans
karto::OccupancyGrid* occ_grid = karto::OccupancyGrid::CreateFromScans(scans, resolution_);

// Delete the copied scans
for (size_t i = 0; i < scans.size(); ++i)
{
Expand Down

0 comments on commit 9942feb

Please sign in to comment.