Ask Your Question
1

Call code before launching ?

asked 2015-11-04 06:29:33 -0600

charles.fox gravatar image

I'm interested in auto-generating some files before the start of my ROS run. The files will depend on real-time data available at the start of the run. Is there a nice way to include this in my lanch file ? Like some tag which funs an executable or python script before loading up the ROS modules?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2015-11-04 08:44:49 -0600

updated 2015-11-06 13:07:02 -0600

lucasw gravatar image

As noted in the roslaunch documentation, there are no guarantees on the order that nodes/scripts in launch files are started in. The easiest way to do what you want might be to write a short shell script that first runs the scripts for generating your data and then calls the required ROS launch file afterwards.

/edit To raise awareness for the "hacky way" @dornhege suggests below in comments. An example (creating a folder) is available here.

edit flag offensive delete link more

Comments

1

This sounds like a good solution. There is one slightly hacky way to do this: The param tag allows you to use the output of a command as a parameter. You can create a dummy parameter that just calls your program. Parameters are guaranteed to be set before the launch is started.

dornhege gravatar imagedornhege ( 2015-11-04 09:07:52 -0600 )edit

That hacky way is nice, thanks !

charles.fox gravatar imagecharles.fox ( 2015-11-04 09:33:30 -0600 )edit

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

Stats

Asked: 2015-11-04 06:29:33 -0600

Seen: 40 times

Last updated: Nov 06 '15