ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Easier way to launch nodes and roslaunch

asked 2011-11-20 11:06:09 -0500

davo gravatar image

hiya, I have quite a disabilty and it's getting worse, I can only spend very short periods at the computer before I get bricked. I seem to be spending what good time I have typing typos into consoles and then trying to catch have to make my life easier.

I'm trying to keep my life easy and using python, as much as possible as C etc blow my mind as I get more affected.

I'd like to reuse my packages nodes launch files inside a shell or gui menu and reorder select deselect as I work through my ros issues......suppose selective ordered rosrun blah blah and roslaunch....or a simple text file.

I've tried a few things and getting mixed results, bombing out to shells, ubuntu desktop launchers python scripts and getting mixed results.

Simple nodes seem ok like static transforms, but with things more complex the roslaunch node/topic gets lost orphaned somewhere, is unreliable or flags a can't find roslib issue..... but works direct from command line.

I've been using the source /opt/ros/.../ etc for the shells and #! etc and can see the env settings.

I do not need to automate everything, but just automating or point click more would make my life so much easier.

I am just having a look at rosh, and quite like the ease of scripting, but not sure where this is leading me, another option I have seen are the testing/unit test modules but again where am I going ?

I've got some pyside sbutton clicks stuff working as well but again only simple nodes.

So if anyone could point me in the right direct I would much appreciate it! I'll be using voice commands soon but not sure how to roslaunch stereo processing etc....from the command line



edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2011-11-20 12:38:27 -0500

Chad Rockey gravatar image

I think a good way for you to do this is to set up some bash scripts that execute roslaunch in screen.

One way I know of doing this is to have a script that starts up some essentials (maybe roscore and your core drivers).

So your main bash script would include something like:

screen -d -m -S roscore ~/scripts/
screen -d -m -S robotcore ~/scripts/

And the script could look like:

source /opt/ros/electric/
export ROS_PACKAGE_PATH=~/where-you-keep-stacks:$ROS_PACKAGE_PATH

And the start-robot would look like:

source /opt/ros/electric/
export ROS_PACKAGE_PATH=~/where-you-keep-stacks:$ROS_PACKAGE_PATH
roslaunch {packagename} {launch file}

Then these will be persistent inside of screens. To get a list of the available screens, type:

screen -ls

To attach to a screen (for instance robotcore):

screen -r robotcore

Then to keep it running, but detach from the session, you can press:

{ctrl and a - at the same time: then press d}

If you could configure the main bash script to start from clicks, it wouldn't matter if it exited right away, as those screens will still be running.

I hope this is what you needed.

edit flag offensive delete link more


chad, thanks for the prompt answer, I got screens working for some of the simple scripts, but failing on some of the more complex getting python traces from rosh roslaunch etc seems to be a problem with yaml.....or py yaml, so looking at that as we speak. I found terminator as well.....I likes that!!!!, just keeping down the mouse clicks etc
davo gravatar image davo  ( 2011-11-20 13:36:00 -0500 )edit
woops duplicates......sorry
davo gravatar image davo  ( 2011-11-20 13:36:00 -0500 )edit
I moved to another machine recentl and fresh...... no more yaml errors looks lie pythin is well stuffed help('modules') chucking lots of errors . Using your scripts as a framework making good progress. Cracking answer wish I'd got this much earlier. Thanks heaps!!! Dave
davo gravatar image davo  ( 2011-11-20 16:23:48 -0500 )edit

answered 2011-11-22 05:18:26 -0500

jbohren gravatar image

updated 2011-11-22 05:18:47 -0500

Something else that would be interesting, and probably useful for everyone, is a roslauch GUI editor. One could imagine a simple gui that queries the ROS environment and gives you drop-down lists populated with installed packages, nodes, and YAML files. There could be easy ways to add parameters, in-line YAML, and other things.

Anyone interested in making something like that?

edit flag offensive delete link more


I believe that there are several groups already doing such things, though they are not released yet.
kwc gravatar image kwc  ( 2011-11-22 05:22:32 -0500 )edit

Question Tools


Asked: 2011-11-20 11:06:09 -0500

Seen: 5,534 times

Last updated: Nov 22 '11