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

ApproximateTime not working with nodelets

asked 2020-03-13 10:37:40 -0500

Myzhar gravatar image

Hi, I have a nodelet that publishes a few topics and another nodelet that subscribes the topics and republishes a custom topic with all the synchronized messages.

If I start the two nodelets in two separate nodelet managers everything works as expected, if I use a single nodelet manager that loads both the nodelets the subscriber receives only a few messages than stops.

I'm using the ApproximateTime policy.

The topics run at different frequencies: 400Hz, 15Hz and 50Hz.

Any idea about the cause of the problem and about how to debug to find a possible cause?

Thank you Walter

edit retag flag offensive close merge delete

Comments

Please do not close questions when you've actually anwered them.

Just click the checkmark to the left of the answer. That will provide a much clearer indication the question has been answered.

gvdhoorn gravatar image gvdhoorn  ( 2020-03-16 03:38:49 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-03-16 03:37:12 -0500

Myzhar gravatar image

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);

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2020-03-13 10:37:40 -0500

Seen: 183 times

Last updated: Mar 16 '20