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

Revision history [back]

I want to call the callback function every time a topic / cmd_vel is delivered, but I also want to use the message of the topic / scan in the callback function.

You have two options.

The simple case consists in implementing a callback function for the topic /scan which stores the message into a variable, such that it can be used later by the callback for the topic /cmd_vel.

Alternatively, you may want to synchronize the two callbacks using the message filter package. This will allow you to create a unique callback which is triggered when you receive a message on the /scan and on the /cmd_vel topics almost at the same time.

But I think that the first solution is what you need.

I also want to distribute the topic / navigation_velocity_smoother / raw_cmd_vel within the callback function.

I don't understand this question.