ROS安装问题: “Command ‘roscore‘ not found, but can be installed with: sudo apt install python-roslaunch“

ROS安装问题: "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.

解决方案

由[1]可知,指令 “roscore” 之所以能够被执行,首先需要在文件夹 “/opt/ros/indigo/bin/” 里面存在名为 “roscore” 的二进制可执行文件,打开文件夹,检查文件是否存在:

cd /opt/ros/melodic/bin
ls -l

果然没有。

由[2],输入:

sudo apt-get install ros-melodic-desktop

cd 进去再看,有了!
执行

source ~/.bashrc

再次启动ROS

roscore

成功了!

在[2]中,作者首先通过 sudo apt-get install ros-melodic-desktop-full 安装了ROS的“桌面完整版”,发现缺少部分文件后,又使用 sudo apt-get install ros-melodic-desktop 安装了ROS的“桌面版”(ROS版本见[3])。我分析,他是想通过这种方式来补全缺少的文件,最后竟然成功了。他真是太机智了!

[1]. 如何解决ROS “roscore command not found”
[2]. ROS安装
[3]. ROS入门笔记(二):ROS安装与环境配置及卸载(重点)

  • 124
    点赞
  • 308
    收藏
    觉得还不错? 一键收藏
  • 37
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 37
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值