按照ROS教程中的命令:$ rosmsg show beginner_tutorials/Num执行产生错误

错误提示如下:

Traceback (most recent call last):
File “/opt/ros/kinetic/bin/rosmsg”, line 35, in
rosmsg.rosmsgmain()
File “/opt/ros/kinetic/lib/python2.7/dist-packages/rosmsg/init.py”, line 754, in rosmsgmain
sys.exit(rosmsg_cmd_show(ext, full, command))
File “/opt/ros/kinetic/lib/python2.7/dist-packages/rosmsg/init.py”, line 619, in rosmsg_cmd_show
rosmsg_debug(rospack, mode, arg, options.raw)
File “/opt/ros/kinetic/lib/python2.7/dist-packages/rosmsg/init.py”, line 450, in rosmsg_debug
print(get_msg_text(type_, raw=raw, rospack=rospack))
File “/opt/ros/kinetic/lib/python2.7/dist-packages/rosmsg/init.py”, line 427, in get_msg_text
package_paths = _get_package_paths(p, rospack)
File “/opt/ros/kinetic/lib/python2.7/dist-packages/rosmsg/init.py”, line 554, in _get_package_paths
results = find_in_workspaces(search_dirs=[‘share’], project=pkgname, first_match_only=True, workspace_to_source_spaces=_catkin_workspace_to_source_spaces, source_path_to_packages=_catkin_source_path_to_packages)
File “/opt/ros/kinetic/lib/python2.7/dist-packages/catkin/find_in_workspaces.py”, line 143, in find_in_workspaces
source_path_to_packages[source_path] = find_packages(source_path)
File “/usr/lib/python2.7/dist-packages/catkin_pkg/packages.py”, line 89, in find_packages
packages = find_packages_allowing_duplicates(basepath, exclude_paths=exclude_paths, exclude_subspaces=exclude_subspaces, warnings=warnings)
File “/usr/lib/python2.7/dist-packages/catkin_pkg/packages.py”, line 150, in find_packages_allowing_duplicates
xml, filename=filename, warnings=warnings)
File “/usr/lib/python2.7/dist-packages/catkin_pkg/package.py”, line 715, in parse_package_string
raise InvalidPackage(‘Error(s):%s’ % (’’.join([’\n- %s’ % e for e in errors])), filename)
catkin_pkg.package.InvalidPackage: Error(s) in package ‘/home/kuka/catkin_ws/src/beginner_tutorials/package.xml’:
Error(s):

  • The manifest of package “beginner_tutorials” (with format version 2) must not contain the following tags: run_depend
  • Please replace <run_depend> tags with <exec_depend> tags.

解决方法如上面所说。找到beginner_tutorials文件然后选中package.xml文件鼠标右键,open with>gedit.

找到如下代码。我的原来是
<build_depend>message_generation</build_depend>
<run_depend>message_runtime</run_depend>
改成
<build_depend>message_generation</build_depend>
<exec_depend>message_runtime</exec_depend>
再次在终端输入$ rosmsg show beginner_tutorials/Num,就出现int64 num 了。

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值