One-liner to find path to ROS stack or package
I was wondering if there was a clean way to find the path to a given ROS stack or package from the command line on Hydro, whether it is installed or just in the ROS_PACKAGE_PATH
, i.e. what is probably used by roscd
or roslaunch
with the $(find ros_stack)
arguments.
If I try to find an uninstalled ROS stack with rospack find ros_stack
, it fails, whereas rosstack find ros_stack
succeeds. For now I use this trick which works for both packages and stacks, whether they are installed or just present in ROS_PACKAGE_PATH
:
$ ros_stack_path=`roscd ros_stack && pwd && cd - &>/dev/null`
Is there a better one-liner for this?
I also noticed something surprising. If I try both rospack
and rosstack
on a metapackage (e.g. navigation
):
$ rospack find navigation ---> fails
$ rosstack find navigation ---> succeeds
Is that the expected behavior?