ros: mk | rosbash | rosboost_cfg | rosbuild | rosclean | roscreate | rosdep | rosemacs | roslang | roslib | rosmake | rospack | rosunit
- Code API
- diamondback
- electric
- unstable - Tutorials
- Troubleshooting
- FAQ
- Reviews (Doc reviewed)
Package Summary
rospack is a command-line program which provides many of the services of the *NIX pkg-config tool. It is used to find packages among the "forest" of code in a typical ROS distribution, calculate dependencies, mangle Makefiles, and in general promote peace and harmony in a ROS distribution.
rospack uses the TinyXML parser, a zLib-licensed library which is available here: http://tinyxml.sourceforge.net
- Author: Morgan Quigley, Brian Gerkey
- License: BSD
- Repository: ros
Contents
- Package Summary
- Overview
-
Usage
- rospack help
- rospack find
- rospack list
- rospack langs
- rospack depends, depends1, depends-manifests, depends-indent, depends-why
- rospack vcs, vcs0
- rospack depends-on, depends-on1
- rospack export
- rospack cflag-only-I, cflags-only-other
- rospack libs-only-L, libs-only-l, libs-only-other
- rospack profile
- rospack plugins
- rospack_nosubdirs
Overview
rospack is a command-line tool for retrieving information about ROS packages available on the filesystem. It implements a wide variety of commands ranging from locating ROS packages in the filesystem, to listing available stacks, to calculating the dependency tree of stacks. It is also used in the ROS build system for calculating build information for packages.
For an equivalent tool for stacks, see rosstack.
Usage
$ rospack [options] <command> [package] Allowed commands: help find [package] list list-names langs depends [package] (alias: deps) depends1 [package] (alias: deps1) depends-manifests [package] (alias: deps-manifests) depends-indent [package] (alias: deps-indent) depends-why --target=<target> [package] (alias: deps-why) vcs [package] vcs0 [package] depends-on [package] depends-on1 [package] export [--deps-only] --lang=<lang> --attrib=<attrib> [package] cflags-only-I [--deps-only] [package] cflags-only-other [--deps-only] [package] libs-only-L [--deps-only] [package] libs-only-l [--deps-only] [package] libs-only-other [--deps-only] [package] profile [--length=<length>] [--zombie-only] plugins --attrib=<attrib> [--top=<toppkg>] [package] Extra options: -q Quiets error reports. If [package] is omitted, the current working directory is used (if it contains a manifest.xml).
The rospack tool implements many commands that print information about ROS packages. All of these commands print their results to stdout. Any errors or warnings go to stderr. This separation ensures that error output does not confuse programs that execute rospack as a subprocess to, for example, recover build flags for a package.
The -q option can be given after any subcommand. It will suppress most error messages that usually go to stderr. The return code will still be non-zero, to indicate the error. E.g., to search for a package, but suppress the error message if it's not found:
$ rospack find -q foo $ echo $? 255
NOTE: for all commands, if [package] is omitted, the current working directory is used.
rospack help
help
- Print help message.
rospack find
find [package]
Print absolute path to the package, empty string if package is not found. This is used within many tools, including rosbuild.
$ rospack find roscpp /Users/homer/code/ros/core/roscpp
rospack list
list
Print newline-separated list "<package-name> <package-dir>" for all packages. For example:
$ rospack list | grep visualization wxpropgrid /home/kwc/ros-pkg/visualization/wxpropgrid rviz /home/kwc/ros-pkg/visualization/rviz visualization_msgs /home/kwc/ros-pkg/visualization_common/visualization_msgs ogre /home/kwc/ros-pkg/visualization_common/ogre ogre_tools /home/kwc/ros-pkg/visualization_common/ogre_tools
list-names
- Print newline-separated list of packages names for all packages.
rospack langs
langs
Print space-separated list of available language-specific client libraries. The client library list is calculated as the list of packages that depend directly on the placeholder package roslang, minus any packages that are listed in the environment variable ROS_LANG_DISABLE. For example:
$ rospack langs roscpp rospy
rospack depends, depends1, depends-manifests, depends-indent, depends-why
depends [package]
Print newline-separated, ordered list of all dependencies of the package. This is used within rosmake. For example:
$ rospack depends map_server gtest genmsg_cpp roslib xmlrpc++ rosthread roscpp std_msgs std_srvs sdl ijg_libjpeg sdl_image
depends1 [package]
- Print newline-separated, ordered list of immediate dependencies of the package.
depends-manifests [package]
Print space-separated, ordered list of manifest.xml files for all dependencies of the package. This is used by rosbuild to create explicit dependencies from source files to other packages' manifests.
depends-indent [package]
- Print newline-separated list of the entire dependency chain for the package, indented to indicate where in the chain each dependency arises. This may contain duplicates.
depends-why --target=TARGET [package] (new in ROS 0.11)
Print newline-separated presentation of all dependency chains from the package to TARGET.
rospack vcs, vcs0
vcs [package]
- Print newline-separated list of all [versioncontrol] tags from the manifest.xml of the package and all of its dependencies This is useful for pre-caching SSL certificates for https SVN servers that will be contacted during the build, to avoid having to manually accept the certificates during the build.
vcs0 [package]
Print newline-separated list of all [versioncontrol] tags from the manifest.xml of just the package itself. This is useful for pre-caching SSL certificates for https SVN servers that will be contacted during the build, to avoid having to manually accept the certificates during the build.
rospack depends-on, depends-on1
depends-on [package]
- Print newline-separated list of all packages that depend on the package.
depends-on1 [package]
Print newline-separated list of all packages that directly depend on the package. For example:
$ rospack depends-on1 roslang roscpp rospy rosoct roslisp
rospack export
export --lang=LANGUAGE --attrib=ATTRIBUTE [package]
Print Space-separated list of [export][LANGUAGE ATTRIBUTE=""/][/export] values from the manifest.xml of the package and its dependencies. This is useful for getting language-specific build flags, e.g,. export/cpp/cflags.
--deps-only
If --deps-only is provided, then the package itself is excluded.
rospack cflag-only-I, cflags-only-other
NOTE: the cflags-only-* commands are simply variants of the rospack export command with additional processing.
cflags-only-I [package]
Print space-separated list of export/cpp/cflags that start with -I. This is used by rosbuild to assemble include paths for compiling.
cflags-only-other [package]
Print space-separated list of export/cpp/cflags that don't start with -I. This is used by rosbuild to assemble non-include compile flags.
--deps-only
If --deps-only is provided, then the package itself is excluded. This can be used with all cflags-only-* variants.
rospack libs-only-L, libs-only-l, libs-only-other
NOTE: the libs-only-* commands are simply variants of the rospack export command with additional processing.
libs-only-L [package]
Print space-separated list of export/cpp/libs that start with -L. If --deps-only is provided, then the package itself is excluded. This is used by rosbuild to assemble library search paths for linking.
libs-only-l [package]
Print space-separated list of export/cpp/libs that start with -l. If --deps-only is provided, then the package itself is excluded. This is used by rosbuild to assemble libraries for linking.
libs-only-other [package]
Print space-separated list of export/cpp/libs that don't start with -l or -L. Used by rosbuild to assemble non-library link flags.
--deps-only
If --deps-only is provided, then the package itself is excluded. This can be used with all libs-only-* variants.
rospack profile
profile [--length=N]
Force a full crawl of package directories (i.e., don't use cache, and report to console on the N (default 20) directories that took the longest time to crawl. Useful for finding stray directories that are adversely affecting rospack's performance.
--zombie-only
Only print directories that do not have any manifests. In this case, the output can be fed directly into rm to clean up your tree, e.g.
rospack profile --zombie-only | xargs rm -rf
NOTE: be sure to check the output before deleting any files!
rospack plugins
plugins --attrib=<attrib> [package]
Examine packages that depend directly on the given package, extracting from each the name of the package followed by the value of an exported attribute with the name <attrib>. All matching exports are returned, newline-separated, e.g., if the manifest for a package "foo," located at /tmp/foo, contains:
<depend package="rosbuild"/> <export> <rosbuild cmake="${prefix}/cmake/foo.cmake/> </export>
then rospack plugins --attrib=cmake rosbuild will return (at least):
foo /tmp/foo/cmake/foo.cmake
--top=TOPPKG
If --top=<toppkg> is given, then in addition to depending directly on the given package, to be scanned for exports, a package must also be a dependency of <toppkg>, or be <toppkg> itself.
rospack_nosubdirs
You can prevent rospack from descending into a directory by simply adding an empty rospack_nosubdirs file. This is useful when you want to block off part of your package tree, either for performance reasons, or to hide another version of your code. We recommend creating a rospack_nosubdirs file in packages that checkout code from other code repositories, as those often create big directory trees that don't get cleaned up if a package is moved or deleted.
This will not prevent rospack from finding nodes in these directories, for roslaunch or rosrun.