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

A reference does not make a copy, it is only guaranteed to be in scope for the duration of the callback.

The ConstPtr is a Boost Shared Pointer which will reference count the underlying data, and copies of the pointer can be persisted and will keep the data in scope for longer.

I suggest getting more information from pure C++ forums such as Stack Overflow. There are lots of valuable reading threads This is a little off topic for ROS Answers.