虚拟机 安装Ubuntu18.04和ROS Melodic

  • 2套安装方案:一台小新Pro14 2021 Intel版+VMware/DELL vostro 3500+VirtualBox
    • 1.ubuntu18+ROSMelodic(Vmware版)
    • 2.ubuntu18+ROSMelodic(VirtualBox版)

2套安装方案:一台小新Pro14 2021 Intel版+VMware/DELL vostro 3500+VirtualBox

两台电脑,一台小新Pro14 2021 Intel版(自己的),一台dell vostro 3500(老师的)。
主要问题都集中在dell vostro 3500:Vmware虚拟机鼠标闪烁、直接装Ubuntu18会无法进系统(error communication to tpm chip)(或者是安装完之后,系统都进不去)(已关闭安全启动和TPM芯片)等。
方案是:
小新用的VMware16+Ubuntu18,分了8G运存,2个CPU,每个CPU2个核,硬盘100G,关机后选择镜像。
DELL用的VirtualBox+Ubuntu18,分配方案同上。VirtualBox和VMware有一点点不同,本文后面会说到。

1.ubuntu18+ROSMelodic(Vmware版)

  1. 第一步安装好Ubuntu之后,首先修改源成阿里的源(下载速度快很多);
  2. 安装虚拟机增强功能包;
    VMware-虚拟机-安装VMwaretools-虚拟机会出现一个CD目录-把里面的压缩包解压了-放到home目录下-运行sudo ./vmware-install.pl-然后一直回车
  3. 先把能导致安装ROS失败的各种条件排除了,比如时间校准,重新安装证书,之前安装过其他版本ROS会提示文件已存在,
sudo apt-get install ntpdate
sudo ntpdate cn.pool.ntp.org
sudo hwclock --systohc
sudo apt-get install ca-certificates
sudo rm /etc/ros/rosdep/sources.list.d/20-default.list
sudo apt-get update
sudo rosdep init
rosdep update
  1. 安装ROS,打开官网,跟着一步一步走就可以了;
    安装完一定不要先初始化!因为初始化会因为网络问题初始化不了!

  2. 打开rosdep init中会出错的链接

https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list

然后会得到一个全是字母的网页,不要管他,全部copy下来。
如果出现没有找到命令rosdep,则需要先安装一个ros python的包

sudo apt-get install python-rosdep
  1. 在ubuntu下把这个对应的文件生成并打开,操作方式是:
sudo passwd    //接着提示输入UNIX密码,输入你的用户密码即可
sudo su //或者su root 然后输入密码切换至root用户
sudo mkdir -p /etc/ros/rosdep/sources.list.d
cd /etc/ros/rosdep/sources.list.d
sudo gedit 20-default.list

然后在打开的类似txt文件的框里,把刚才复制的东西粘贴进去,save,搞定。

13.如果出现 unable to process source 或者 error loading sources list
则需要修改DNS/hosts/替换刚才复制的东西里的raw.githubusercontent.comraw.github.com

我用ip查询发现raw.githubusercontent.com网站好像已经全部搬迁到raw.github.com了。

修改DNS:用下列代码打开,把文本最后面的DNS注释掉(加“#”),改成谷歌DNS。

sudo su
sudo gedit /etc/resolv.conf

nameserver 8.8.8.8
nameserver 8.8.4.4

或者修改成114.114.114.114也可以。

修改Hosts:

sudo su
sudo gedit /etc/hosts

在后面加入

199.232.28.133 raw.githubusercontent.com
140.82.113.3 raw.github.com

这前面的IP地址可以去http://ping.chinaz.com/"你要查询的域名"
或者https://"你要查询的域名".ipaddress.com/
去查询 然后更换掉

  1. rosdep update。大功告成。ROS装好了!!!
    着重注意!!!rosdep update可能会部分失败,所以尽量连接手机热点,多次尝试。
    有可能出现

Please go to the rosdep page [1] and file a bug report with the stack trace below.

我的解决办法是 检查20-default.list里的raw.githubusercontent.com有没有被全部换为raw.github.com有任何一个没有修改掉,都可能出现上述问题。

正确的rosdep update输出:

reading in sources list data from /etc/ros/rosdep/sources.list.d
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
Hit https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml
Query rosdistro index https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml
Add distro "groovy"
Add distro "hydro"
Add distro "indigo"
Add distro "jade"
Add distro "kinetic"
Add distro "lunar"
Add distro "melodic"
updated cache in /home/tjx/.ros/rosdep/sources.cache
  1. 后面就是配置环境
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc
  1. 构建工厂依赖
sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential
  1. 安装完成,可以开始跑小乌龟了。! 或者用
roscore

测试一下ros是否安装成功,安装成功的话,会出现以下输出:

... logging to /home/ros/.ros/log/a8514184-ae18-11eb-b13d-000c29bbe1e7/roslaunch-ros-virtual-machine-2543.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.started roslaunch server http://ros-virtual-machine:33021/
ros_comm version 1.14.10SUMMARY
========PARAMETERS* /rosdistro: melodic* /rosversion: 1.14.10NODESauto-starting new master
process[master]: started with pid [2554]
ROS_MASTER_URI=http://ros-virtual-machine:11311/setting /run_id to a8514184-ae18-11eb-b13d-000c29bbe1e7
process[rosout-1]: started with pid [2565]
started core service [/rosout]

2.ubuntu18+ROSMelodic(VirtualBox版)

VirtualBox装Ubuntu18和VMware的方法基本一样,仅有三点不同。

  1. VirtualBox需要在开机的时候选定镜像(我第一次用的时候找不到设置镜像的位置),而VMware可以在关机后设定镜像文件目录,设置好了再开机。好像在 设置-存储-控制器 里面可以添加光驱,以进入系统。

  2. VirtualBox的虚拟机增强工具需要先安装一个gcc

sudo apt update
sudo apt install build-essential

该命令将安装一堆新包,包括gccg++make,然后验证一下

gcc --version

出现版本号,即可运行VirtualBox的虚拟机增强工具。

  1. VirtualBox和windows互通的话需要手动设置。
  2. 剩下的就和前面VMware安装Ubuntu和ROS的步骤一样了。

虚拟机 安装Ubuntu18.04和ROS Melodic相关推荐

  1. 拯救者Y9000P 安装Ubuntu18.04 、Ros Melodic等相关配置过程中出现的错误及解决办法

    电脑配置:拯救者Y9000P 2022 i9 3060 目录 一.安装Ubuntu18.04 1.安装UltralSO时无法写入镜像文件,显示磁盘/映像空间太小 2.由于2022拯救者Y9000PBI ...

  2. ROS系列——Ubuntu18.04下ros Melodic安装mavros过程中遇到问题及解决-定期更新版

    ROS系列--Ubuntu18.04下ros Melodic安装mavros过程中遇到问题及解决-定期更新版 问题 问题一:运行 wstool update -t src -j8 时,出错如下: 问题 ...

  3. 虚拟机ubuntu启动代码界面_Windows10下使用虚拟机安装Ubuntu18.04

    Windows10下使用虚拟机安装Ubuntu18.04步骤: 我想把这篇文章献给你. (封面是Ubuntu的官方壁纸) 首先我们要有vmware和操作系统的iso包:咱们可以在互联网上找到.操作系统 ...

  4. ubuntu18.04系统ros melodic 安装orbslam2,Astra相机的ROS环境

    ubuntu18.04 安装orbslam2,rosbag,Astra相机的ROS环境  ubuntu20.04系统 ros noetic下安裝orbslam2 打开下面链接: CSDNhttps:/ ...

  5. 已 树莓派4b ros 系统 网盘_无限可能:树莓派4B 安装Ubuntu18.04+ROS1(melodic)

    一.安装Ubuntu18.04 从Ubuntu官网(Install Ubuntu Server on a Raspberry Pi 2, 3 or 4 | Ubuntu)下载64bit镜像,Ubunt ...

  6. 虚拟机安装ubuntu18.04及其srs服务器的搭建

    第一次写博客,有些地方可能不太完善. 1.安装VMware,我用的是VMware12. 2.下载Ubuntu镜像(自Ubuntu 17.10开始桌面版本不再提供32位安装镜像,Ubuntu Serve ...

  7. 虚拟机安装Ubuntu18.04,vmtools,配置语言,要是再搞不定你打死我!!!

    安装Ubuntu18.04虚拟机 1. 虚拟机选择VMware: 请自行在官网下载:https://www.vmware.com/ 此文中使用的是Vmware Workstation 14 pro 之 ...

  8. 虚拟机安装Ubuntu18.04系统

    安装的镜像可在Ubuntu的官方网站进行下载. Ubuntu18.04的具体下载地址如下(iso格式): https://releases.ubuntu.com/18.04.5/ 下面开始进行安装. ...

  9. 虚拟机安装Ubuntu18.04

    一.下载VMware VMware下载地址:https://www.vmware.com/products/workstation-pro/workstation-pro-evaluation.htm ...

最新文章

  1. linux关机 hibernate,Linux关机命令
  2. 如何在Python中调用Windows的cmd命令?
  3. 经典动态规划之过河卒【洛谷 P1002】
  4. [Issue Fixed]-repo-error: .repo/manifests/: contains uncommitted changes
  5. boost::mp11::mp_bind_back相关用法的测试程序
  6. Jupyter Notebook的15个技巧和窍门,可简化您的编码体验
  7. html怎样调取css,css怎么调用?
  8. Android设计模式之——模板方法模式
  9. 手把手教你做用户画像
  10. (软件工程复习核心重点)第三章需求分析-第三节:状态转换图
  11. mac电脑本地运行MapReduce, Permission denied
  12. 国际计算机网络信息与安全管理,计算机信息网络国际联网单位安全管理制度
  13. 网站ssl证书出现错误如何解决
  14. 域名dns污染,如何防治?
  15. Linux脚本方式修改Mac地址,两种修改Linux系统中MAC地址的方法
  16. 2021年西式面点师(高级)新版试题及涵盖考试最全题库免费练习
  17. 冯诺依曼体系结构VS哈佛体系结构
  18. 推荐几本最好的web前端开发技术图书
  19. component组件中的is属性居然有大用?
  20. vs新建网站选项只有wcf服务器,WCF教程一:新建并部署

热门文章

  1. 广东省2009届毕业生专场招聘会
  2. 兰石集团发力智能制造 看老牌国企的转型升级之路
  3. ubuntu换源(更换国内清华源)
  4. (docker) 四步修改容器时区时间!超简洁明了~
  5. 3dmax和python哪个好学_3Dmax和Maya孰优孰劣?初学者入门该如何选择?
  6. Win10激活提示ClipUp.exe -损坏的镜像该如何处理?
  7. Could not find artifact org.vaadin.addons:dcharts-widget:pom:0.10.0 in nexus-aliyun
  8. MySQL数据库-DQL(单表查询)
  9. 在Windows Server 2019上安装edge浏览器
  10. 使用conda已安装python工具包,但Pycharm中仍提示缺包,解决办法