-
Notifications
You must be signed in to change notification settings - Fork 165
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
Node shutdown error #87
Comments
Apparently, I just needed to voice my problem to have the solution work, (guess I should invest in a rubber duck.) I will leave this issue open for a little longer, as the resulting solution is incredibly hacky and may have underlying problems. Simply creating yet another signalhanlder over-ride (as mentioned in roscpp and 317 linked above) closes everything correctly. I'm not very content on this solution, because I tried this the other day and it didn't change anything. Not sure why it worked this time around, but the edits I made are: Starting around line 655 in create_driver.cpp
Again, a second opinion is greatly appreciated on this so I'll leave the issue for at least a couple days. Thanks! |
Thanks for opening the issue! I suspect that the signal handler registered by |
Fixes #87 Since rclcpp is already handling signals, we don't need libcreate interfering. We are already making sure to properly disconnect from the robot before the process ends. Signed-off-by: Jacob Perron <jacob@openrobotics.org>
@cbcoutu |
Fixes #87 Since rclcpp is already handling signals, we don't need libcreate interfering. We are already making sure to properly disconnect from the robot before the process ends. Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Hello,
I've noticed that the create_driver node isn't being destructed properly.
Unfortunately I don't know a better name for the issue, I'm sorry if this has been brought up elsewhere and I didn't notice.
OS: Ubuntu 20.04
ROS: ROS2-Foxy
create_robot branch: foxy
libcreate branch: main
Re-create issue: Follow installation steps from the start, and launch create_2.launch.
Everything starts-up great, allowing full control of my Create2. However, upon sending the SIGINT command (ie Ctrl-c) the robot_state_publisher is shut down correctly, but the create_driver node is flagged with the error copied below (I've truncated my directory path):
[ERROR] [create_driver-1]: process has died [pid 3738, exit code 2, cmd '../create_ws/install/create_driver/lib/create_driver/create_driver --ros-args -r __node:=create_driver --params-file ../create_ws/install/create_bringup/share/create_bringup/config/default.yaml --params-file /tmp/launch_params_jm4axiif'].
I initially ignored this, but I've noticed ROS2 starts to behave strangely when relaunching the nodes several times over, (primarily
ros2 node list
no longer displays running nodes even though the rqt_graph shows everything correctly -- solved only by rebooting my computer.)Doing some homework, I've made a couple preliminary observations that may help re-iterate the problem:
rclcpp::shutdown()
inmain()
is never called. Confirm this by printing some statements aroundrclcpp::spin
. When ctrl-c is sent, any-statement following the spin are never printed to the terminal.Serial::signalHandler
from libcreate is executed (confirm by throwing some print statements before the exit() call). If I understand correctly, this signalhandler is over-riding the signalhandler provided by ROS and is executed before the nodes have a chance to close. The exit call is what generates the printed error code included above.I've been reading up on how the signal handler works, and found some interesting discussions/resources, however I've yet to solve (or fully isolate) the problem:
(Note, out of curiosity I tried to include in
Serial::signalHandler
a call to 'rclcpp::shutdown()' before theexit()
statement, but this changes nothing for me.)Is someone able to please confirm this problem exists? I admit there may be something trivial I'm missing.
Thanks for your time and offering such a library! Aside from this hiccup it's been fun to use.
The text was updated successfully, but these errors were encountered: