Refactor rclpy signal handling
See original GitHub issueFeature request
Feature description
The idea is to make it look more similar to what rclcpp
is doing, and solve https://github.com/ros2/rclpy/issues/360, https://github.com/ros2/rclpy/issues/398.
Implementation considerations
rclpy
is just triggering a raise condition in its handler, and chaining with the Python
signal handler. In this way, the wait set is awaken, the Python
signal handler raises KeywordInterrupt
and then the execution finishes.
rclcpp
is shutting down context from a separated thread, specially used for this. It uses a synchronization mechanism to awake that thread when a signal is handled.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Execution and Callbacks — rclpy 0.6.1 documentation
The base class for an executor. An executor controls the threading model used to process callbacks. Callbacks are units of work like subscription...
Read more >signal — Set handlers for asynchronous events ... - Python Docs
Source code: Lib/signal.py This module provides mechanisms to use signal handlers in Python. General rules: The signal.signal() function allows defining ...
Read more >Change in rclcpp/rclpy: shutting down gracefully on SIGTERM
A SIGTERM handler is planned to be added to rclcpp/rclpy, implementing the same behavior as the current SIGINT handler.
Read more >Deadlocks in rclpy and how to prevent them with ... - Karelics
Using callback groups to control execution and avoid deadlocks · subscription callbacks (receiving and handling data from a topic), · timer ...
Read more >Rclpy - Technical Notes - Confluence
command_line_args = rclpy.utilities.remove_ros_args(args = sys.argv)[ 1 :] ... sig interrupt handling. signal.signal(. signal.SIGINT,.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m not sure, I was just tasked with doing the upgrade, but I think the new version was supposed change something w.r.t. ctrl-c on Windows.
Closing, as I don’t see much value of doing this after the OpenSplice problem was solved: https://github.com/ros2/rclpy/issues/360#issuecomment-528944306