Skip to content

Commit

Permalink
Update in observation time comparison (#308)
Browse files Browse the repository at this point in the history
* last_updated_ is now not updated on reset(), and observation staleness is now determined by comparison to clock_->now() instead of the last observation.

* Readded the observation buffer update on reset.

* Used correct whitespace again
  • Loading branch information
sjusner authored and SteveMacenski committed Dec 13, 2024
1 parent eec5771 commit 32f8a22
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spatio_temporal_voxel_layer/src/measurement_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ void MeasurementBuffer::RemoveStaleObservations(void)
}

for (it = _observation_list.begin(); it != _observation_list.end(); ++it) {
const rclcpp::Duration time_diff = _last_updated - it->_cloud->header.stamp;
const rclcpp::Duration time_diff = clock_->now() - it->_cloud->header.stamp;

if (time_diff > _observation_keep_time) {
_observation_list.erase(it, _observation_list.end());
Expand Down

0 comments on commit 32f8a22

Please sign in to comment.