ERROR: cannot launch node of type [map_server/map_server]: Cannot locate node of type [map_server]

ERROR: cannot launch node of type [map_server/map_server]: Cannot locate node of type [map_server] in package [map_server]. Make sure file exists in package path and permission is set to executable (chmod +x)

运行ROS by Example中Arbotix+rviz功能仿真–导航示例

roslaunch rbx1_bringup fake_turtlebot.launch
roslaunch rbx1_nav fake_amcl.launch map:=test_map.yaml
rosrun rviz rviz -d `rospack find rbx1_nav`/amcl.rviz

第二步启动fake_amcl.launch时报错:

ERROR: cannot launch node of type [map_server/map_server]: Cannot locate node of type [map_server] in package [map_server]. Make sure file exists in package path and permission is set to executable (chmod +x)
ERROR: cannot launch node of type [move_base/move_base]: Cannot locate node of type [move_base] in package [move_base]. Make sure file exists in package path and permission is set to executable (chmod +x)
ERROR: cannot launch node of type [fake_localization/fake_localization]: Cannot locate node of type [fake_localization] in package [fake_localization]. Make sure file exists in package path and permission is set to executable (chmod +x)

参考https://www.jianshu.com/p/e9981bc35cff,开始寻找故障原因:

roscd map_server/

定位至/opt/ros/melodic/share/map_server,位置正确

catkin_find --without-underlays --libexec --share map_server

显示map_server位置在/home/zy/robot_ws/src/navigation-melodic-huanyu/mapzyserver,因为我的ubuntu系统上有多个工作空间且都编译过,rosrun会指向自己同名的map_server包,导致功能包依赖紊乱,且使用roscd命令查找map_server包还是会指向系统中安装的位置,而不是另一个workspace(robot_ws)包的位置。这就导致了较难发现同名包的问题。
删除同名包之后,运行

catkin_find --without-underlays --libexec --share map_server

显示:

/opt/ros/melodic/lib/map_server
/opt/ros/melodic/share/map_server

依次解决另外两个error,就可以正常运行例程了。
为了避免以后再遇到这个问题,我就只保留了一个工作空间,其他的文件存储到其他的硬盘。
链接: https://www.jianshu.com/p/e9981bc35cff

  • 2
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值