ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Properly Bring Down Active Node?

asked 2015-11-19 12:18:30 -0500

davelkan gravatar image

I'm currently using ros::shutdown() to bring down a node that I need to kill in c++. I'm fairly certain this is bad as the node fails ungracefully and does not seem to release all of its resources. Is there a better method?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-11-19 13:13:05 -0500

updated 2015-11-19 13:14:02 -0500

Likely what you want to do is create a custom SIGINT handler that releases whatever resources are not properly being released. This function will then get called whenever your node receives the SIGINT signal (e.g. when someone presses Ctrl+C) or when you call ros::shutdown(). A simple example is on the roscpp Initialization and Shutdown page. Also check out this question/answer.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-11-19 12:18:30 -0500

Seen: 625 times

Last updated: Nov 19 '15