ros2 / rclpy

rclpy (ROS Client Library for Python)
Apache License 2.0
268 stars 221 forks source link

Make publishers context-manager aware. #1289

Closed clalancette closed 1 month ago

clalancette commented 1 month ago

The main reason to do this is so that we can change example code to use context managers for managing the lifetimes of publishers (and other entities), which should make the code significantly easier to read.

clalancette commented 1 month ago

I should mention that this partially fixes https://github.com/ros2/rclpy/issues/1280 , though we'll need a bunch of other PRs before it is completely done.

ahcorde commented 1 month ago