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

Revision history [back]

I found the solution to the problem.

I was wrongly not creating a new message before each publishing.

In my particular case I had an IMU message to be synchronized with camera images and I was creating the message once in the OnInit function. Instead we must create each single shared pointer message just before publishing it: sensor_msgs::ImuPtr imuMsg(new sensor_msgs::Imu);