python - ROS python 错误 "The manifest (with format version 2) must not contain the following tags: run_depend"

标签 python ros rospy

一直在关注《Programming Robots with ROS: A Practical Introduction to the Robot Operating System》这本书

在本书的“Defining a New Message”部分,我们创建了一个新的消息定义

Example 3-3. Complex.msg
float32 real
float32 imaginary

所以我们需要修改package.xml,添加如下几行:

<build_depend>message_generation</build_depend>
<run_depend>message_runtime</run_depend> 

但是当我在 catkin_ws 目录中运行 catkin_make 时,出现以下错误

Error(s) in /home/gtkratosman-lap/catkin_ws/src/basic/package.xml:
- The manifest (with format version 2) must not contain the following tags: run_depend

我的版本:

ii  python-rospkg                                         1.1.4-100                                           all          ROS package library
ii  python-rospkg-modules                                 1.1.4-1                                             all          ROS package library

这是完整的 package.xml 文件

<?xml version="1.0"?>
<package format="2">
  <name>basic</name>
  <version>0.0.0</version>
  <description>The basic package</description>

  <maintainer email="gtkratosman-lap@todo.todo">gtkratosman-
  lap</maintainer>

  <license>TODO</license>

  <buildtool_depend>catkin</buildtool_depend>
  <build_depend>rospy</build_depend>


  <run_depend>message_generation</run_depend>
  <run_depend>message_runtime</run_depend>

  <build_export_depend>rospy</build_export_depend>
  <exec_depend>rospy</exec_depend>

  <export>
  </export>
</package>

最佳答案

您在 package.xml 中混合了格式 1 和格式 2: <run_depend>仅在格式 1 中可用,而在格式 2 中应为 <exec_depend> (在格式 1 中不可用)。

所以在你的情况下简单替换 run_dependexec_depend应该不错。

有关格式之间差异的更多信息,请参阅 official documentation .

关于python - ROS python 错误 "The manifest (with format version 2) must not contain the following tags: run_depend",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47309913/

相关文章:

Python实时绘制ROS数据

python - 无法在 rospy 中发布订阅的主题

python - 如何在 Keras Lambda 层中使用 OpenCV 函数?

python - 如何使用 Python 从 Facebook 评论插件获取文本?

python - python中如何从ROS实时获取数据?

c++ - 从 C++ 中的类的函数成员返回数组

python - 任何人都有 “[Errno 2] No such file or directory”修复程序?

python - 在 matplotlib 图中使用多种颜色

ros - 为什么 ROSBag 记录每秒仅记录来自任何传感器的 10 个事件?