ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Simplest (but with a bit of duplicated effort): create a std::list or std::vector that holds incoming samples (ie: PointClouds). Then every so often (ie: after N new samples), run your averaging algorithm.

To make it nice: add a sliding window approach (ie: throw away/pop the M last samples after each averaging run).


With a bit more reuse: make use of the message_filters package. For a simple cache, you could look at the Cache filter.

Edit: see #q261816 for a duplicate of your question, but with an answer in Python.


Simplest (but with a bit of duplicated effort): create a std::list or std::vector that holds incoming samples (ie: PointClouds). Then every so often (ie: after N new samples), run your averaging algorithm.

To make it nice: add a sliding window approach (ie: throw away/pop the M last samples after each averaging run).


With a bit more reuse: make use of the message_filters package. For a simple cache, you could look at the Cache filter.