Programmatically run launch files / check node status

asked 2016-11-02 14:29:48 -0500

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:

  1. Programmatically check whether a node is running or not
  2. Programmatically call a launch file / kill nodes associated with a launch file
  3. 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.

edit retag flag offensive close merge delete

Comments

1

You may want to use the capability system to programmatically run your launch files: http://wiki.ros.org/capabilities

ahendrix gravatar imageahendrix ( 2016-11-02 15:20:18 -0500 )edit

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.

shoemakerlevy9 gravatar imageshoemakerlevy9 ( 2016-11-02 16:09:57 -0500 )edit