-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make rclpy initialization context-manager aware. #1298
Commits on Jun 11, 2024
-
Make rclpy initialization context-manager aware.
This PR does two somewhat controversial things: 1. It adds in a new "rclpy.managed_init" method to rclpy, which would be used with a context manager instead of rclpy.init. I had to do things this way because there is no way (as far as I know) for the callee to know whether it was called within a context manager or not, and I don't think we can reasonably change the semantics of rclpy.init() at this point. 2. It changes the context manager implementation of Context so that it does *not* call init() within itself. This definitely changes the semantics, but as it stands that initialization doesn't make sense because it can't take arguments. I think this change is warranted, though we may have to search through documentation and examples to make sure this doesn't break anything. Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 9604184 - Browse repository at this point
Copy the full SHA 9604184View commit details
Commits on Jun 14, 2024
-
That way, we don't need managed_init() anymore. Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 25a26a5 - Browse repository at this point
Copy the full SHA 25a26a5View commit details -
Switch to an intermediate object for initialization.
That way we can use context managers, but actually properly clean up, including uninstalling signal handlers. We also switch to tracking node resources in the context, so that when the context goes away, all nodes associated with it are automatically destroyed. Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 046defd - Browse repository at this point
Copy the full SHA 046defdView commit details -
Keep backwards compatibility with Context init().
Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for b81046d - Browse repository at this point
Copy the full SHA b81046dView commit details
Commits on Jun 17, 2024
-
Update initialize_logging documentation.
Co-authored-by: Shane Loretz <sloretz@openrobotics.org> Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 97682e8 - Browse repository at this point
Copy the full SHA 97682e8View commit details -
Update track_node documentation.
Co-authored-by: Shane Loretz <sloretz@openrobotics.org> Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for c228f4f - Browse repository at this point
Copy the full SHA c228f4fView commit details -
Hold the internal Context lock across {track,untrack}_node.
Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 103073a - Browse repository at this point
Copy the full SHA 103073aView commit details