Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions range_sensor_layer/src/range_sensor_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,14 @@ void RangeSensorLayer::removeOutdatedReadings()
std::map<std::pair<unsigned int, unsigned int>, double>::iterator it_map;

double removal_time = last_reading_time_.toSec() - pixel_decay_;
for (it_map = marked_point_history_.begin() ; it_map != marked_point_history_.end() ; it_map++ )
for (it_map = marked_point_history_.begin() ; it_map != marked_point_history_.end() ;)
{
if (it_map->second < removal_time)
{
marked_point_history_.erase(it_map);
marked_point_history_.erase(it_map++);
setCost(std::get<0>(it_map->first), std::get<1>(it_map->first), costmap_2d::FREE_SPACE);
} else {
it_map++;
}
}
}
Expand Down