On Fri, Aug 12, 2011 at 9:23 AM, Thibault Kruse wrote: > 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. This brings up an old thread, circa pre-1.0, regarding rosrun and a 'rosexec' command to rule them all: https://code.ros.org/lurker/message/20100402.181431.05b5f3af.en.html The thread started when I committed a change to rosrun to make 'rosrun ' be interpreted as 'rosrun ', i.e. 'rosrun rviz' -> 'rosrun rviz rviz'. The overall thread is a useful discussion of the ambiguous cases that result, as well as an interesting sketch of a better launching command. Why is the "rosrun ABSOLUTE_FILENAME [ARGS]" necessary for some scripts? From the perspective of command-line usage, it doesn't add much value as it is equivalent to the user typing: ./ABSOLUTE_FILENAME [ARGS] If there is a special need for a script, I would suggest a special option, e.g. '-f', to flag the different usage and make it unambiguous. - Ken > _______________________________________________ > ros-users mailing list > ros-users@code.ros.org > https://code.ros.org/mailman/listinfo/ros-users > >