Programmatically run launch files / check node status
Hi,
I am trying to build a state machine for a ground vehicle that goes something like this:
00 IDLE
01 JOYSTICK MODE
02 MAPPING MODE
03 NAVIGATION MODE
08 ERROR STATE
I'll have an XBOX controller that is used to select the mode. Once selected I want my script to first check whether the required nodes are already running, and then I want it to run the launch file associated with that mode (joy.launch, map.launch, nav.launch).
I also want it to continually monitor the status of the nodes and if anything look funky go into an error state.
Required Functionality:
- Programmatically check whether a node is running or not
- Programmatically call a launch file / kill nodes associated with a launch file
- Programmatically check is a node had died
Researching this I've come across the bondpy package, which I may use for #3, but I am stil unsure how I will do the first two. Any advice is greatly appreciated.
Asked by shoemakerlevy9 on 2016-11-02 14:29:48 UTC
Comments
You may want to use the capability system to programmatically run your launch files: http://wiki.ros.org/capabilities
Asked by ahendrix on 2016-11-02 15:20:18 UTC
Hmmm, I've been looking over the capabilities tutorial for 45min and still am not quite sure what it actually does. There doesn't seem to be a clear description of possible use cases or example, but I'll keep looking into it.
Asked by shoemakerlevy9 on 2016-11-02 16:09:57 UTC