1 系统依赖关系
ROS package有时候需要开源系统提供额外的库文件或者工具。这些必须的库和工具通常被称为系统依赖。有时候这些依赖不是默认会被安装的,ROS提供了一个简单的工具,rosdep,用来下载和安装系统依赖。
ROS包必须在他们的manifest里声明他们需要哪些系统依赖。我们可以来看一下我们小海龟的manifest:
(貌似我前面有些地方打成了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>
在这里我们就能看到它的依赖关系了。
1.1 rosdep
rosdep是一个你可以用来安装ROS package系统依赖的工具
用法:
rosdep install [package]
下载安装小海龟仿真需要的系统依赖:
$ 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
网友评论