欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

自动驾驶 安装ROS系统

程序员文章站 2022-03-05 16:53:12
...

1 - 换源

sudo gedit /etc/apt/sources.list
#PC的国内软件源
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
#TX2的国内软件源
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-updates main restricted universe multiverse  
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-updates main restricted universe multiverse   
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-security main restricted universe multiverse   
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-security main restricted universe multiverse   
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-backports main restricted universe multiverse   
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-backports main restricted universe multiverse   
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial main universe restricted   
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial main universe restricted

2 - 打开软件和更新对话框,具体可以在 Ubuntu 最左上角的搜索按钮中搜索。

打开后按照下图进行配置(确保你的"restricted", "universe," 和 "multiverse."前是打上勾的)

#加入软件源
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
#加入秘钥
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
#更新软件源
sudo apt-get update
#开始安装
sudo apt-get install ros-kinetic-desktop-full
#初始化
sudo rosdep init
#更新
rosdep update
#加入bashrc
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
#更新bashrc
source ~/.bashrc
#安装依赖包
sudo apt install python-rosinstall python-rosinstall-generator python-wstool build-essential
#安装栅格地图插件
sudo apt-get install ros-kinetic-grid-map
#安装编译工具
sudo apt-get install python-catkin-tools


2.OPENCV


解压源码后,在解压后的目录中创建build文件夹并进去:

mkdir build
cd build

sudo apt-get install build-essential

sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev

sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev

cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ..

sudo make

sudo make install

sudo sh -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'

sudo ldconfig

3.安装QT

sudo chmod a+x qt-opensource-linux-x64-5.10.0.run

./qt-opensource-linux-x64-5.10.0.run

4.安装dlib

tar xvf dlib-19.6.tar.bz2

cd dlib-19.6/

mkdir build

cd build

cmake -DBUILD_SHARED_LIBS=ON ..

cmake --build . --config Release

sudo make install

sudo ldconfig

5.安装boost

sudo ./bootstrap.sh
sudo ./b2 install
#卸载
cd /usr/local/inlcude
sudo rm -r boost/
cd /usr/local/lib
sudo rm *boost*

如果在tx2上缺什么包:

https://launchpad.net/ubuntu/xenial/arm64/

这里都有~