1. 下载Virtual box
1.1 Install the latest Virtual Box and from this link (https://www.virtualbox.org/wiki/Downloads)
1.2 Install the Virtual Box Extension Pack for your version of Virtual Box (also at this link),
which allows you to use the USB ports on your computer within the virtual machine
2. 下载Ubuntu 光盘镜像
Download the Ubuntu 16.04 LTS .iso from this link:
https://releases.ubuntu.com/16.04.7/?_ga=2.172503909.731698997.1609351715-
1600872036.1599579131
3. 创建虚拟机
3.1 Run Virtual Box and create a virtual machine with the .iso you downloaded following the
instructions given in the following link
https://www.techmespot.com/how-to-install-ubuntu-16-04-on
virtualbox/#:~:text=Step%201%3A%20Open%20Virtualbox%20and,to%20your%20Ubunt
u%20Virtual%20Machine
3.2 In the virtual machine go to Devices > Insert Guest Additions CD image and install guest additions.
下载增强插件
4. 安装ROS
4.0 启动所有Ubuntu 软件 (main,restricted,universe,multiverse)存储库
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse"
4.1 设置源
sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.ustc.edu.cn/ros/ubuntu/ $DISTRIB_CODENAME main" > /etc/apt/sources.list.d/ros-latest.list'
4.2 设置密钥并更新
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F42ED6FBAB17C654 sudo apt-get update # 更新
4.3 安装ROS
sudo apt-get install ros-kinetic-desktop-full # Ubuntu 16.04
如果有没有安装好的软件,可以使用一下命令修复(虽然对我来说没有效果)
sudo apt-get update –fix-missing. sudo dpkg –configure -a. sudo apt-get install -f. Unlock the dpkg – (message /var/lib/dpkg/lock) sudo fuser -vki /var/lib/dpkg/lock. sudo dpkg –configure -a. Source: https://frameboxxindore.com/linux/how-do-i-fix-missing-files-in-ubuntu.html
如果出现报错Unable to Correct Problems ‘You have Held Broken Packages’,参考链接:
https://blog.csdn.net/xpy870663266/article/details/94742491
使用aptitude
4.4 初始化rosdep
sudo rosdep init && rosdep update
遇见报错
ERROR: cannot download default sources list from: https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list Website may be down.
解决方案:修改源
https://blog.csdn.net/wang725/article/details/79902004
遇见报错2
ERROR: unable to process source [https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml]: <urlopen error ('_ssl.c:574: The handshake operation timed out',)> (https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml) Hit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml ERROR: unable to process source [https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml]: <urlopen error ('_ssl.c:574: The handshake operation timed out',)> (https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml) ERROR: unable to process source [https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml]: <urlopen error timed out> (https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml) ERROR: unable to process source [https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml]: Failed to download target platform data for gbpdistro: <urlopen error timed out> Query rosdistro index https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml ERROR: error loading sources list: <urlopen error <urlopen error timed out> (https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml)>
解决方案:修改代理
ROS卸载+重装+各种插件安装(熟练的令人心疼)_我爱编程皮肤好好的博客-CSDN博客_ros卸载重装
4.5 测试
$ roscore $ rosrun turtlesim turtlesim_node $ rosrun turtlesim turtle_teleop_key
成功
4.6 ROS卸载(重装大法,回到步骤0)
1、首先卸载包 sudo apt-get purge ros-* 2、然后卸载依赖包 sudo apt-get autoremove
5 . 创建共享文件夹
Create a shared folder between Ubuntu and Windows 10 using VirtualBox (taken from
https://askubuntu.com/questions/230296/sharing-folders-between-ubuntuguest-and
windows-7-host-using-virtualbox)
• Start your Virtual Machine ---> Click on Devices menu ---> Shared Folders ---> Shared
Folder Settings
• Now click on Add Folder icon
• Choose your Folder Path, Folder Name will be automatically selected. Put the checkmark
on Auto-mount and Make-Permanent. Click on the OK button.
• Now reboot again your Virtual Machine.•
After reboot, you will find the Shared Folder on your Files file manager as shown below
In case if you are unable to access the content of your Shared Folder, try those following
steps.
Open your Terminal. Type
sudo su
then enter your password.
Write the following commands
sudo usermod -a -G vboxsf mir (* Instead of mir use your account name) sudo chown -R your_account_name:users /media/your_share_folder_name/ Example: sudo chown -R mir:users /media/sf_Linux_Application/
Now reboot your Virtual Machine and check the Shared Folder.