[rosserial_python] Use rospy.on_shutdown in SerialClient shutdown #594
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When I use
serial_node.py
from roslaunch, we cannot killserial_node.py
by Ctrl-c.This is because
serial_node.py
does not catchSystemExit
exception caused bysys.exit(0)
intxStopRequest
.rosserial/rosserial_python/nodes/serial_node.py
Lines 94 to 109 in c169ae2
In this PR, I used
rospy.on_shutdown
instead ofsignal.signal(signal.SIGINT, self.txStopRequest)
, following8fb7954
(#508) and #551This change enables to kill
serial_node.py
by Ctrl-c.Thank you very much for your help, @sktometometo