We’ve recently made an important update to ROS 2: loaned messages are now disabled by default. If you don’t know what loaned messages are, then you can stop reading now. If you are using loaned messages, continue reading.

We disabled the loaned messages by default to address safety concerns, as there were instances of shared pointers being unsafely reused across multiple callbacks. While this adjustment temporarily limits loaned message capabilities in callbacks, it’s a necessary step to ensure the reliability and safety of the system. See Disable the loaned messages inside the executor. by clalancette · Pull Request #2335 · ros2/rclcpp · GitHub for more details.

If you understand the risks of using loaned messages and want to enable them, you can set ROS_DISABLE_LOANED_MESSAGE=0 in the environment before launching your nodes.

Rest assured, we’re exploring options to safely reintroduce this feature in the future. Your understanding and support in this matter are greatly appreciated.