
"Command 'roscore' not found, but can be installed with: sudo apt install python-roslaunch"
前言
VMware 15虚拟机,Ubuntu 18系统,安装 ROS melodic。安装结束之后,运行指令 “roscore”,弹出 “Command ‘roscore’ not found, but can be installed with: sudo apt install python-roslaunch” 的提示,无法启动ROS。搜索论坛,最后成功解决了该问题,解决过程如下。
问题描述
安装结束后,输入:
roscore
报错:
Command ‘roscore’ not found, but can be installed with:
sudo apt install python-roslaunch
根据提示输入: sudo apt install python-roslaunch
报错:
E: Unable to correct problems, you have held broken packages.
解决方案
指令 “roscore” 之所以能够被执行,首先需要在文件夹 “/opt/ros/indigo/bin/” 里面存在名为 “roscore” 的二进制可执行文件,打开文件夹,检查文件是否存在:
cd /opt/ros/melodic/bin
ls -l
果然没有。
输入:
sudo apt-get install ros-melodic-desktop
cd 进去再看,有了!
执行
source ~/.bashrc
再次启动ROS
roscore
成功了!
作者首先通过 sudo apt-get install ros-melodic-desktop-full 安装了ROS的“桌面完整版”,发现缺少部分文件后,又使用 sudo apt-get install ros-melodic-desktop 安装了ROS的“桌面版”。我分析,他是想通过这种方式来补全缺少的文件,最后竟然成功了。
暂无评论...