[Documentation] [TitleIndex] [WordIndex

(!) Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

Managing System dependencies

Description: This explains how to use rosdep to install system dependencies.

Tutorial Level: INTERMEDIATE

Next Tutorial: Roslaunch tips for large projects

  Show EOL distros: 

System Dependencies

ROS packages sometimes require external libraries and tools that must be provided by the operating system. These required libraries and tools are commonly referred to as system dependencies. In some cases these system dependencies are not installed by default. ROS provides a simple tool, rosdep, that is used to download and install system dependencies.

ROS packages must declare that they need these system dependencies in the package manifest. Let's look at the manifest for the turtlesim package:

$ roscd turtlesim

Then,

$ cat package.xml
  • <package>
    
    ...
    ...
      <build_depend>message_generation</build_depend>
      <build_depend>libqt4-dev</build_depend>
      <build_depend>qt4-qmake</build_depend>
      <build_depend>rosconsole</build_depend>
      <build_depend>roscpp</build_depend>
      <build_depend>roscpp_serialization</build_depend>
      <build_depend>roslib</build_depend>
      <build_depend>rostime</build_depend>
      <build_depend>std_msgs</build_depend>
      <build_depend>std_srvs</build_depend>
    </package>

As you can see turtlesim needs those libraries and packages.

$ cat manifest.xml
  • <package>
    
    ...
    ...
        <rosdep name="libqt4-dev"/>
        <rosdep name="qt4-qmake"/>
    
    </package>

As you can see turtlesim needs libqt4-dev and qt4-qmake.

rosdep

rosdep is a tool you can use to install system dependencies required by ROS packages.

Usage:

rosdep install [package]

Download and install the system dependencies for turtlesim:

$ rosdep install turtlesim

If you've been following along with the tutorials, it's likely that this is the first time you've used rosdep. When you run this command, you'll get an error message:

Just run those two commands and then try to install turtlesim's dependencies again.

If you installed using binaries you will see:

Otherwise you will see the output of installing the dependencies of turtlesim:

set -o errexit set -o verbose

if [ ! -f /opt/ros/lib/libboost_date_time-gcc42-mt*-1_37.a ] ; then

fi

if [ ! -f /opt/ros/lib/liblog4cxx.so.10 ] ; then

fi }}}

rosdep runs the bash script above and exits when complete.


2019-10-19 12:51