Ask Your Question
0

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
2

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:

/opt/ros/lunar/share/rospy

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
0

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

or

$(rospack find my_package)/some_file

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

edit flag offensive delete link more

Comments

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 imagegvdhoorn ( 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 imageunkulunkulu ( 2017-11-23 05:29:24 -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: 2017-11-22 08:28:04 -0600

Seen: 231 times

Last updated: Sep 05