[ros-users] [Ros-developers] suggest new ros shebang command

Thibault Kruse kruset at in.tum.de
Fri Aug 12 16:23:20 UTC 2011


I modified rosrun the way I imagined it (attached to this mail), so you 
can try it out.
However it turns out I forgot the parameters a scripter might want to 
use for his script.
So one has to allow

rosrun PACKAGE EXECUTABLE [ARGS]
rosrun ABSOLUTE_FILENAME [ARGS]

rosrun can still distinguish between those as absolute filenames need to 
have a "/" in them, whereas those are forbidden for package names. At 
least as long as the ROS community does not want to allow rosrun 
STACK/PACKAGE EXECUTABLE [ARGS] to disambiguate packages (but I believe 
ROS PACKAGE names need to be unique anyway, else plenty of tools break).

The attached files work this way, once you install the provided rosrun 
in your $PATH (E.g. replace your rosrun at your own risk), and make the 
lispscript executable, the following should work (it does for me):

$ ./lispscript  2 3
Test, args: 
(/home/kruset/work/ros/sandbox/roslisp_support/sbcl/sbcl/bin/sbcl 2 3)

Additional output may be observable depending on your sbcl (LISP) 
version, the last line is the one that counts.

You can see how rosrun passes along the command line arguments given to 
the script. Of course, rosrun still does what it did for the PACKAGE 
EXECUTABLE syntax. The diff to current rosrun is trivial, as my changes 
are all contained in one if block. There are 2 minor TODOs left in the 
comments that a better scripter than me might fill in quicker than me.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: lispscript
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20110812/98541384/attachment-0004.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: rosrun
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20110812/98541384/attachment-0005.ksh>


More information about the ros-users mailing list