虚拟机安装Ubuntu16并安装Ros(Kinetic)


虚拟机、ubuntu16.04、ubuntu18.04,下载链接:
链接:https://pan.baidu.com/s/1xCsTGzQGgJvb3_sQBFcRzA 提取码:4jvr 复制这段内容后打开百度网盘手机App,操作更方便哦--来自百度网盘超级会员V5的分享 推荐ubuntu16.04,标定的那个在ubuntu在18有问题。

1.虚拟机安装镜像教程

参考:https://www.cnblogs.com/su1961117443/p/12419892.html
或者https://www.bilibili.com/video/BV1zt411G7Vn?p=2
可以安装vmtools,界面显示窗口自适应。

2.ROS各个版本

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
注:因为ubuntu是16.04的,所以这里我们安装Kinetic版本的ROS.
参考链接:https://blog.csdn.net/sinat_39416814/article/details/88343714

3.ROS简单介绍

在这里插入图片描述
在这里插入图片描述
通信机制:
在这里插入图片描述
开发工具:
在这里插入图片描述
应用功能:
在这里插入图片描述
生态系统:
在这里插入图片描述
注:这些来自古月居视频内容
https://www.bilibili.com/video/BV1zt411G7Vn?p=2
更为详情的入门请观看其视频。

4.安装ROS环境——Kinetic

1)先选择下载服务器位置

这里我选择的阿里云、清华云也可以。
在这里插入图片描述

2)设置sources.list

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'

在这里插入图片描述

3)设置key(公钥已更新)

sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

在这里插入图片描述

4)更新package

sudo apt-get update

在这里插入图片描述

5)安装ROS kinetic完整版

sudo apt-get install ros-kinetic-desktop-full

注:可能第一次安装会有个别包没有安装上,需要再次运行即可。—时间有点长!!!!

6)初始化rosdep(问题最大处!!!)

第一步

sudo rosdep init

注:这里可能会出现如下错误:
错误:

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

原因: 由于raw.githubusercontent.com被墙,程序无法下载相应的文件。解决方法就是使raw.githubusercontent.com能够被正常访问。这个网站被墙的方式是dns污染,所以我们只要能够找到这个网站的正确ip就可以了,
解决: 修改hosts文件
1.sudo gedit /etc/hosts
2.把下面这些地址拷贝到hosts文件末尾,然后保存。

192.30.253.118 gist.github.com
185.199.110.153 github.io
151.101.113.194 github.global.ssl.fastly.net
52.216.227.168 github-cloud.s3.amazonaws.com
52.74.223.119 github.com
199.232.28.133 avatars1.githubusercontent.com
199.232.28.133 avatars2.githubusercontent.com
199.232.28.133 avatars0.githubusercontent.com
199.232.28.133 avatars3.githubusercontent.com
199.232.28.133 raw.githubusercontent.com
199.232.28.133 user-images.githubusercontent.com
199.232.28.133 avatars.githubusercontent.com
199.232.28.133 github.map.fastly.net
199.232.28.133 avatars7.githubusercontent.com
54.239.31.69 aws.amazon.com
54.239.30.25 console.aws.amazon.com
54.239.96.90 ap-northeast-1.console.aws.amazon.com
54.240.226.81 ap-southeast-1.console.aws.amazon.com
54.240.193.125 ap-southeast-2.console.aws.amazon.com
54.239.54.102 eu-central-1.console.aws.amazon.com
177.72.244.194 sa-east-1.console.aws.amazon.com
176.32.114.59 eu-west-1.console.aws.amazon.com
54.239.31.128 us-west-1.console.aws.amazon.com
54.240.254.230 us-west-2.console.aws.amazon.com
54.239.38.102 s3-console-us-standard.console.aws.amazon.com
54.231.49.3 s3.amazonaws.com
52.219.0.4 s3-ap-northeast-1.amazonaws.com
54.231.242.170 s3-ap-southeast-1.amazonaws.com
54.231.251.21 s3-ap-southeast-2.amazonaws.com
54.231.193.37 s3-eu-central-1.amazonaws.com
52.218.16.140 s3-eu-west-1.amazonaws.com
52.92.72.2 s3-sa-east-1.amazonaws.com
54.231.236.6 s3-us-west-1.amazonaws.com
54.231.168.160 s3-us-west-2.amazonaws.com
52.216.80.48 github-cloud.s3.amazonaws.com
54.231.40.3 github-com.s3.amazonaws.com
52.216.20.171 github-production-release-asset-2e65be.s3.amazonaws.com
52.216.228.168 github-production-user-asset-6210df.s3.amazonaws.com

3.再干一件事,执行sudo gedit /etc/resolv.conf,将原有的nameserver这一行注释,并添加以下两行

nameserver 8.8.8.8 #google域名服务器
nameserver 8.8.4.4 #google域名服务器

4.再次执行sudo rosdep init,这次会报一个问题,就是文件已存在:

ERROR: default sources list file already exists: /etc/ros/rosdep/sources.list.d/20-default.list
Please delete if you wish to re-initialize

5.这时候直接删除这个文件sudo rm /etc/ros/rosdep/sources.list.d/20-default.list,再次执行sudo rosdep init,我至今操作过很多次,没有出现不成功的状态,如果实在不成功,试试换手机热点,多执行几次,最后输出如下信息就OK了:

wrote /etc/ros/rosdep/sources.list.d/20-default.list
Recommended: please run
rosdep update

注:其实上面一步一般可以解决问题,换手机热点挺好使的。

第二步

rosdep update

注:这个命令主要也是网络的问题,一般是读取超时,一般换手机热点、延长时间、以及fq多试试几次就可以了(这些方法参考https://www.cnblogs.com/zxzmnh/p/11758103.html),但是如果上面不行,还有一种方法,就是先下载到本地,在配置, 这个问题困扰了我两天,最后看到大佬们的解决方法,实在是妙。。。
具体操作:

a.直接建在了/etc/ros/建了相应的目录。

链接: https://pan.baidu.com/s/19OCXIUgZ1RNHV33noc1auw
提取码: tnn9
从上面直接下载,解压到/etc/ros目录下。需要超级权限。

b.修改20-default.list脚本文件,需要超级权限。

其所在的目录是:/etc/ros/rosdep/sources.list.d/
之前的内容:

# os-specific listings first
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml osx
 
# generic
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
gbpdistro https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml fuerte
 
# newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead

现在的内容:

# os-specific listings first
#yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml osx
yaml file:///etc/ros/rosdistro/master/rosdep/osx-homebrew.yaml osx
# generic
#yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml
#yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml
#yaml https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml
#gbpdistro https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml fuerte
 
yaml file:///etc/ros/rosdistro/master/rosdep/base.yaml
yaml file:///etc/ros/rosdistro/master/rosdep/python.yaml
yaml file:///etc/ros/rosdistro/master/rosdep/ruby.yaml
gbpdistro file:///etc/ros/rosdistro/master/releases/fuerte.yaml fuerte
# newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead
c.继续修改

sudo 打开/usr/lib/python2.7/dist-packages/rosdistro/init.py这个文件,按照下面的代码进行修改。

# index information
 
#DEFAULT_INDEX_URL = 'https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml'
DEFAULT_INDEX_URL = 'file:///etc/ros/rosdistro/master/index-v4.yaml'

这样我就成功了!!!!!!不容易。
参考链接https://blog.csdn.net/super_sean/article/details/105433250

7)配置ROS环境

echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc

8)安装依赖项

sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential

9)测试ROS是否安装成功

(1)CTRL+ALT+T打开终端(Termial),输入以下命令,初始化ROS环境

roscore

在这里插入图片描述

(2)再 打开一个新的终端(Termial),输入以下命令,弹出一个小乌龟窗口:

rosrun turtlesim turtlesim_node

在这里插入图片描述

(3)出现一个小乌龟的LOGO后,再 打开一个新的终端(Termial),输入以下命令

rosrun turtlesim turtle_teleop_key

在这里插入图片描述

(4) 打开新的Termial,输入以下命令,可以查看ROS节点信息:

rosrun rqt_graph rqt_graph

在这里插入图片描述

5.标定包编译安装

在这里插入图片描述
标定代码:
https://github.com/XidianLemon/calibration_camera_lidar

5.1创建ROS工作空间

在这里插入图片描述
创建工作环境:
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
catkin_init_workspace
注:catkin_ws可以任意起名字,但是src不可以。后面的编译工作环境这里就不用了弄了,这些操作在5.2编译功能包实现即可。
编译工作环境:
cd ~/catkin_ws/
catkin_make
设置环境变量:
source devel/setup.bash
检查环境变量:
echo $ROS_PACKAGE_PATH
在这里插入图片描述
注:这部分可以参考https://www.bilibili.com/video/BV1zt411G7Vn?p=9

5.2编译功能包

将下面代码
https://github.com/XidianLemon/calibration_camera_lidar
在这里插入图片描述
下载到本地,这部分代码就是标定的功能包,所以不需要自己创建功能包了,直接使用编译即可,在前面我们已经创建好了工作环境catkin_ws,接下来将解压后的代码文件夹Is_calibration放到src文件下,然后返回到catkin_ws路径下,重新编译:catkin_make,报一下错
在这里插入图片描述
解决: sudo apt install ros-kinetic-jsk-recognition-msgs
在这里插入图片描述
安装nlopt:
https://github.com/stevengj/nlopt
在这里插入图片描述
按照其步骤走一遍,即可。

重新编译: catkin_make
在这里插入图片描述
运行:
一个终端:

roscore

另一个终端:

source ~/catin_ws/devel/setup.bash
rosrun calibration_camera_lidar calibration_toolkit

成功:
在这里插入图片描述
参考链接:https://blog.csdn.net/qq_43509129/article/details/109327157?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522161950636016780271540331%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=161950636016780271540331&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2allfirst_rank_v2~rank_v29-1-109327157.first_rank_v2_pc_rank_v29&utm_term=autoware1.14.0%E8%81%94%E5%90%88&spm=1018.2226.3001.4187

其他问题:

1:/home/qian/anaconda3/lib/libpng16.so.16: undefined reference to `inflateValidate@ZLIB_1.2.9’

解决: 直接删除anaconda3,因为冲突!!!!

参考链接:https://blog.csdn.net/qq_34213260/article/details/107423121

2:编译内存不足

在这里插入图片描述
解决方法:虚拟机配置增加内存容量,这里我将2G提高我3G可以了。有时候多试几遍也可以,因为计算机的内存可能还没来得及清理,所以导致这时候的内存比较大。

3.rosrun calibration_camera_lidar calibration_toolkit报错

home/x/catkin_ws/devel/lib/calibration_camera_lidar/calibration_toolkit: error while loading shared libraries: libnlopt.so.0: cannot open shared object file: No such file or directory
这是因为链接问题(因为libnlopt.so.0的链接位置不对)
解决:

 cd /etc/ld.so.conf.d
 sudo touch libnlopt.conf
 sudo gedit libnlopt.conf 

在libnlopt.conf文件中添加内容为:/usr/local/lib,
最后使配置生效:

sudo ldconfig

4.如果想安装18.04的ubuntu以及melodic-ROS

因为autoware1.14只能在ubuntu18.04上安装并且依赖于ROS melodic,因此需要对calibration_camera_lidar功能包下的CMakeLists.txt进行修改,把所有的

if ("${ROS_VERSION}" MATCHES "(indigo|jade|kinetic)")

改成:

if ("${ROS_VERSION}" MATCHES "(indigo|jade|kinetic|melodic)")

因为这里使用了条件编译,默认不支持ROS melodic。
在这里插入图片描述

6、Autoware的一些说明

历史版本简要回顾:

v1.2.0 支持ROS Kinetic版本,用于激光雷达追踪的kalman滤波,基于yolo_v2视觉跟踪,增加imu驱动,为NDT定位增加IMU和里程计选项,点云距离滤波,rosbag数据预处理;

v1.3.0 增加基于A*算法的避障,GPU的欧式聚类,基于DNN的交通灯识别;

v1.4.0 增加点云的地面滤波;

v1.5.0 增加Web-Ui,多斑马线检测器,ENet图像语义分割,开始支持aarch64架构,支持NVIDIA DrivePX2,为A*路径规划算法增加虚拟障碍物仿真;

v1.6.0 增加GPU-NDT匹配算法,可以控制一些机动车了,新的Rviz模型,增加了ray地面滤波(也就是多线激光雷达的点云地面滤波),增强了DecisionMarker,基于规则控制机动车,存在激光雷达旋转时NDT匹配算法不工作的问题;

v1.7.0 支持定位多种交通标志,支持IDS-imaging相机,支持北阳2D雷达,增加了多雷达标定工具,相机-雷达联合标定工具,支持Velodyne的32线激光雷达,支持AVT相机,基于MxNet的信号灯识别,增加yolo-v3检测器,增加了车辆状态节点和话题,NDT匹配算法的安全监视器,基于IMM-UKF-PDA的多目标跟踪算法,路径点速度重规划工具;

v1.8.0 开始有相应的demo视频公布在油管;新功能:视觉检测与点云检测的信息融合(YOLOV3)和数据融合(点云着色),为Nvidia Drive PX2和其他aach64架构提供交叉编译,支持西克Sick的LD-MRS激光雷达,点云地图的网格划分,现在可以限制NDT建图算法的最大扫描距离了;一些提升:欧式聚类区分点云更精确,最多支持8个激光雷达,加速point2image(应该是用了OpenMP提速)

v1.9.0 开始逐步弃用ROS indigo版本,基于简单的运动估计来估计物体运动,点云地图中静态目标的过滤(应该是和预建地图做差分),L-shape拟合稳定跟踪多辆车,速腾雷达驱动,无需英伟达的sdk也可以交叉编译

v1.10.0 不再支持ROS indigo,可以过滤掉离自身车辆较远的点云,增加FLIR ADK相机驱动,Ouster激光雷达驱动

v1.11.0 catkin不再支持编译源码,改用colcon;点云快速编码用于目标检测,百度的CNN用于点云分割,基于点云的外形/姿态估计;改进的混合A*算法和代价图;

v1.12.0 v1.13.0 v1.14.0都未有说明

https://blog.csdn.net/qq_27493341/article/details/106646054

  • 2
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
虚拟机安装Ubuntu 22.04和ROS2有以下步骤: 1. 首先,你需要安装虚拟机软件,并创建一个新的虚拟机实例。你可以使用虚拟机软件如VMware或VirtualBox。 2. 下载Ubuntu 22.04的镜像文件,并将其加载到虚拟机中。启动虚拟机并按照安装向导的提示进行安装。在安装过程中,选择你的首选语言和其他设置。 3. 安装完成后,你需要更新系统并安装open-vm-tools。打开终端并执行以下命令: ``` sudo apt update sudo apt install open-vm-tools sudo apt install open-vm-tools-desktop ``` 4. 接下来,你需要准备ROS2的安装环境。首先,设置语言环境,打开终端并执行以下命令: ``` sudo locale-gen en_US en_US.UTF-8 sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 ``` 5. 安装Ubuntu universe存储库,执行以下命令: ``` sudo add-apt-repository universe sudo apt update ``` 6. 现在,你可以安装ROS2了。首先,添加ROS2的软件源,执行以下命令: ``` sudo apt update && sudo apt install curl gnupg2 lsb-release curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add - sudo sh -c 'echo "deb [arch=amd64,arm64 http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list' ``` 7. 安装ROS2,执行以下命令: ``` sudo apt update sudo apt install ros-foxy-desktop ``` 8. 配置ROS2的环境变量,执行以下命令: ``` source /opt/ros/foxy/setup.bash echo 'source /opt/ros/foxy/setup.bash' >> ~/.bashrc source ~/.bashrc ``` 以上是在虚拟机安装Ubuntu 22.04和ROS2的步骤。你可以参考官方文档了解更多细节。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [【ROS2实践】Vmware17下安装ubuntu22.04和ros2-humble](https://blog.csdn.net/gongdiwudu/article/details/129095321)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* [Ubuntu22.04安装ROS2【图文讲解】](https://blog.csdn.net/TianHW103/article/details/127105413)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Studying_swz

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值