Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clear already reported observations #1140

Open
wants to merge 1 commit into
base: noetic-devel
Choose a base branch
from
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
5 changes: 2 additions & 3 deletions costmap_2d/src/observation_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,15 +191,14 @@ void ObservationBuffer::bufferCloud(const sensor_msgs::PointCloud2& cloud)
// returns a copy of the observations
void ObservationBuffer::getObservations(vector<Observation>& observations)
{
// first... let's make sure that we don't have any stale observations
purgeStaleObservations();

// now we'll just copy the observations for the caller
list<Observation>::iterator obs_it;
for (obs_it = observation_list_.begin(); obs_it != observation_list_.end(); ++obs_it)
{
observations.push_back(*obs_it);
}

observation_list_.clear();
}

void ObservationBuffer::purgeStaleObservations()
Expand Down