ros2 / rclpy

rclpy (ROS Client Library for Python)
Apache License 2.0
289 stars 224 forks source link

Make nodes context-manager aware. #1293

Closed clalancette closed 3 months ago

clalancette commented 3 months ago

This way it is much easier to create examples that properly clean up after themselves.

This partially fixes #1280, but we'll need more PRs to fully complete that.

clalancette commented 3 months ago

Yes, this is a great improvement. Do you want to add at least once test here to cover this before doing the follow up work?

Yeah, that makes sense. I've added a test for the node, plus for the subscriptions and publishers (that we've already merged in).

clalancette commented 3 months ago

CI:

clalancette commented 3 months ago

The failing test is a known flake on Windows, so going ahead and merging this one. Thanks for the reviews.