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