Multiple Callbacks between ROS2 and ROS1

I read about Executors and Callback Groups in ROS2 to handle the problem of multiple callbacks happen at the same time.

Can ROS1 handle the problem?
I see some systems still use ROS1, how can I handle the problem in ROS1?

Thanks

HI @NguyenDuyDuc ,

There are two ways you can do that in ROS1. It is not exactly the use of multiple callbacks, but a different approach.

  1. You can use async.spinner function to execute multiple sub-routines / callbacks.
  2. You can add spin_once function inside every loop in your program so that all callbacks are renewed.

These are the two ways that I know from the top of my head. I hope this helps!

Regards,
Girish

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.