1 系統(tǒng)依賴關(guān)系
ROS package有時候需要開源系統(tǒng)提供額外的庫文件或者工具诽里。這些必須的庫和工具通常被稱為系統(tǒng)依賴肄扎。有時候這些依賴不是默認會被安裝的雹熬,ROS提供了一個簡單的工具敬惦,rosdep臣镣,用來下載和安裝系統(tǒng)依賴辅愿。
ROS包必須在他們的manifest里聲明他們需要哪些系統(tǒng)依賴。我們可以來看一下我們小海龜?shù)膍anifest:
(貌似我前面有些地方打成了mainfest)
輸入:
roscd turtlesim
然后:
cat package.xml
我們會看到:
<?xml version="1.0"?>
<package>
<name>turtlesim</name>
<version>0.7.1</version>
<description>
turtlesim is a tool made for teaching ROS and ROS packages.
</description>
<maintainer email="dthomas@osrfoundation.org">Dirk Thomas</maintainer>
<license>BSD</license>
<url type="website">http://www.ros.org/wiki/turtlesim</url>
<url type="bugtracker">https://github.com/ros/ros_tutorials/issues</url>
<url type="repository">https://github.com/ros/ros_tutorials</url>
<author>Josh Faust</author>
<buildtool_depend>catkin</buildtool_depend>
<build_depend>geometry_msgs</build_depend>
<build_depend>qtbase5-dev</build_depend>
<build_depend>message_generation</build_depend>
<build_depend>qt5-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>
<run_depend>geometry_msgs</run_depend>
<run_depend>libqt5-core</run_depend>
<run_depend>libqt5-gui</run_depend>
<run_depend>message_runtime</run_depend>
<run_depend>rosconsole</run_depend>
<run_depend>roscpp</run_depend>
<run_depend>roscpp_serialization</run_depend>
<run_depend>roslib</run_depend>
<run_depend>rostime</run_depend>
<run_depend>std_msgs</run_depend>
<run_depend>std_srvs</run_depend>
</package>
在這里我們就能看到它的依賴關(guān)系了退疫。
1.1 rosdep
rosdep是一個你可以用來安裝ROS package系統(tǒng)依賴的工具
用法:
rosdep install [package]
下載安裝小海龜仿真需要的系統(tǒng)依賴:
$ rosdep install turtlesim
如果你是第一次使用rosdep渠缕,你會看到一個error:
ERROR: your rosdep installation has not been initialized yet. Please run:
運行下面兩條命令,然后再嘗試運行上面的命令:
sudo rosdep init
rosdep update
然后你會看到:
#All required rosdeps installed successfully