rclpy icon indicating copy to clipboard operation
rclpy copied to clipboard

Docstring specifying proper destruction and creation of Rate, Timer and GuardCondition

Open 2lian opened this issue 1 year ago • 3 comments

This commit stems from my issue and discussion here

I added explanation of how the user should handle the destruction and creation of the object in the docstrings of the:

  • constructor of Rate, Timer and GuardCondition
  • .destroy methods of Rate, Timer and GuardCondition
  • .create_rate and .create_guard_condition methods of Node

Subscriber, Publisher and other objects share the same destruction process. However they already had proper warnings in their docstrings. So no changes were required for those. I have kept my new docstring consistent with those.

I have decided to only change .create_rate and .create_guard_condition methods of Node because, those are the most likely objects to be destroyed and had a very short docstrings. Adding the warning in the already long create_publisher, etc, did not seem right.

2lian avatar May 18 '24 03:05 2lian

I wonder if I should also add this to Iron and humble branch?

2lian avatar May 18 '24 03:05 2lian

lgtm, indeed better this way.

2lian avatar May 21 '24 02:05 2lian

Ok I don't know why the tests failed on fd61446, anyway they passed.

2lian avatar May 21 '24 03:05 2lian

CI (repos file build: --packages-up-to rclpy test: --packages-select rclpy)

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

sloretz avatar Jun 14 '24 18:06 sloretz