Package format 1 (legacy)¶
When writing a ROS package several tasks often need to be done. These pages give examples of how to handle most of the common ones.
Note
These instructions are for the original <package format="1">
.
If you are making small changes to a format 1 package, use these instructions. If you are ready to upgrade your package to format 2, see: Migrating from format 1 to format 2.
Overview¶
Resolving dependencies¶
Packages almost always use features provided by other packages. Describe all your direct dependencies. Their transitive dependencies on other packages are handled automatically by catkin.
Building and installing targets¶
Build targets are generated binaries, shared libraries, message headers, and other objects. Various targets require special handling.
Configuring and running unit tests¶
All configuration steps related to testing should be only done
conditionally if CATKIN_ENABLE_TESTING
is set (which is true by
default). Passing -DCATKIN_ENABLE_TESTING=0
to CMake enables to
configure and build packages without any testing overhead.
If the CMake configuration of packages fails because they use test
functions without checking this flag before the option
-DCATKIN_SKIP_TESTING=1
can be passed to CMake to disable testing
but providing mock functions in order to not break the build.