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

Eval roslaunch substitution expression from console

asked 2017-11-22 08:28:04 -0600

unkulunkulu gravatar image

updated 2019-09-05 14:46:27 -0600

lucasw gravatar image

Can I do that? For example

$ roslaunch eval '$(find my_package)/some_file' /path/to/my/package/some_file

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2017-11-22 08:56:05 -0600

gvdhoorn gravatar image

updated 2017-11-22 09:01:52 -0600

Afaik there is no entrypoint provided for that, but the following oneliner works for me (just an example):

python -c 'import roslaunch; print roslaunch.substitution_args.resolve_args("$(find rospy)")'

This prints:


on a Lunar installation.

If you're only interested in finding the locations of packages, then catkin_find_pkg might be an alternative:

catkin_find_pkg rospy /opt/ros
edit flag offensive delete link more

answered 2017-11-22 09:12:23 -0600

updated 2017-11-22 10:47:20 -0600

Is this what you're trying to do?

$ roslaunch $(rospack find my_package)/some_file

instead of

$ roslaunch my_package my_file.launch


$(rospack find my_package)/some_file

to get /path/to/my/package/some_file

edit flag offensive delete link more


This is a good answer: rospack find .. is definitely an option, if you're only interested in using the find roslaunch substitution arg.

gvdhoorn gravatar image gvdhoorn  ( 2017-11-22 09:18:00 -0600 )edit

I'm aware of rospack find, but I'm not only interested in this case, the question is stated as I need it

unkulunkulu gravatar image unkulunkulu  ( 2017-11-23 05:29:24 -0600 )edit

Question Tools

1 follower


Asked: 2017-11-22 08:28:04 -0600

Seen: 673 times

Last updated: Sep 05 '19