Ros问题解决(一)创建msg和srv过程中message_runtime的问题

参考:https://blog.csdn.net/weixin_40712763/article/details/78905454

在创建msg和srv文件之后,使用srv和msg文件时候需要对xml文件进行修改,如下:
需要对package.xml文件添加/取消注释以下命令行

message_generation
message_runtime

我安装的是kinetic版本,发现package.xml文件中没有

message_runtime

添加以后,出现以下问题:

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

这表明该命令行不是合法的,删除该命令行后,出现以下问题:

  catkin_package() DEPENDS on the catkin package 'message_runtime' which must
  therefore be listed as a run dependency in the package.xml
Call Stack (most recent call first):
  /opt/ros/indigo/share/catkin/cmake/catkin_package.cmake:100 (_catkin_package)
  chapter2_tutorials/CMakeLists.txt:103 (catkin_package)

表明应该添加run_time依赖,重新查找package.xml发现里面有如下代码

message_runtime

将其取消注释后运行成功,可见在kinetic版本的Ros中应该使用以上命令来替代

message_runtime

你可能感兴趣的:(ROS问题解决篇,ROS,msg,srv)