Skip to content

Commit

Permalink
Add buffer clearing when calling deactivate() or activate(). (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
chaiso-krit authored and DLu committed Dec 25, 2016
1 parent 25b0c71 commit 932ba44
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ class RangeSensorLayer : public costmap_2d::CostmapLayer
double* max_y);
virtual void updateCosts(costmap_2d::Costmap2D& master_grid, int min_i, int min_j, int max_i, int max_j);
virtual void reset();
virtual void deactivate();
virtual void activate();

private:
void reconfigureCB(range_sensor_layer::RangeSensorLayerConfig &config, uint32_t level);
Expand Down
10 changes: 10 additions & 0 deletions range_sensor_layer/src/range_sensor_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,4 +432,14 @@ void RangeSensorLayer::reset()
activate();
}

void RangeSensorLayer::deactivate()
{
range_msgs_buffer_.clear();
}

void RangeSensorLayer::activate()
{
range_msgs_buffer_.clear();
}

} // end namespace

0 comments on commit 932ba44

Please sign in to comment.