ROS 安装和环境配置

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

成功

1656309790456-508d5db6-e719-4066-bcb3-b5220926aa0d.png

4.6 ROS卸载(重装大法,回到步骤0)

1、首先卸载包

sudo apt-get purge ros-*

2、然后卸载依赖包

sudo apt-get autoremove

https://blog.csdn.net/weixin_44168457/article/details/114481740?spm=1001.2101.3001.6661.1&utm_medium=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1-114481740-blog-89607450.pc_relevant_downloadblacklistv1&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-2%7Edefault%7ECTRLIST%7Edefault-1-114481740-blog-89607450.pc_relevant_downloadblacklistv1&utm_relevant_index=1

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.

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值