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

Eval roslaunch substitution expression from console

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

unkulunkulu gravatar image

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

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 -0500

gvdhoorn gravatar image

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

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 -0500

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

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 image gvdhoorn  ( 2017-11-22 09:18:00 -0500 )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 -0500 )edit

Question Tools

1 follower

Stats

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

Seen: 689 times

Last updated: Sep 05 '19