'Killing a node in ros
In ROS, listing of nodes is as follows
rosnode list
In ROS, killing a node is as follows
rosnode kill node_name
When I execute kill subcommand on a particular node, the node list is updating properly and that node is getting shutdown.
But I don't know the reason why some processes are not terminating on terminal after shutdown also as shown below
I need to again press ctrl+c or ctrl+z to really shutdown them on terminal.
Why the process (on terminal) is not terminating even though the node got shutdown?
Solution 1:[1]
What You Are Seeing Is That Node Got Shutdown Request And Is Not Actually Stopped But Trying to stop.
What rosnode kill something
Do Is Send SIGINT
To The NodeHandle And What Node Should Do Is Deconstruct Its Classes And Free NodeHandle (In Properly Written Codes)
What I Think Is Happening In Your Particular Node Either The SIGINT Handler Is Changed Or Your NodeHandle Cannot Destroy All Of The Objects That's Been Linked To Your roscpp Lib And Requires You To Press CTRL+C To Allow Escalating To More Aggressive Terminations
All I Can Do to Help You Without Seeing The Code Is:
- Make Sure You Have A destructor For Every Class You Use
- make Sure You Release Every Hardware Connection You Have In Your Code(Serial Connection, camera Connection, Etc)
- Make Sure You Deallocation Every Pointer And References To Memory(Not Necessary But better Safe Than Sorry)
If You Still Had The Problem Try Rewriting The SIGINT Signal Here's A Link To ROS-Wiki That Has Good Info About Your Problem
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Fantastic Mr Fox |