ros2/rclcpp

Deprecate all `spin_xxx` functions in `rclcpp` namespace instead of `spin`.

Opened this issue · 0 comments

Description

Comes from the discussion with Client WG, see meeting note for https://discourse.ros.org/t/next-client-library-wg-meeting-friday-8th-november-2024/40457/2

these functions promote a very bad pattern and have terrible performance, which may not be obvious without knowing their internal details.
In the implementation, any rclcpp::spin_xxx functions are called, it internally creates the Executor and destroys it every single time. this would be really performance issue for user application unless user does understand what they are doing with those functions.

Give deprecation warning and period those functions, and eventually removed from after next release.

in addition to this, we could also add a template to rclcpp::spin to take in the executor type.