当前位置:   article > 正文

ubuntu18.04 安装ros+mavros等_ros mavros

ros mavros

一、更换国内镜像源 

1.检查Ubuntu的软件和更新源

将下载源更改为国内源(这里用的中科大源)

打开文本编辑器

将以下内容复制到文本编辑器后保存

deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse

deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse

deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse

deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse

deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse

deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse

deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse

deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse

deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

文件名保存为sources.list并保存至当前界面

备份原先的list文件

sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup

cd /etc/apt

替换list文件

sudo cp ../../home/liu(这里改为自己的用户名)/sources.list ./

sudo apt-get update

cd ~

二、ROS-melodic 下载

设置ros源列表

sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.ustc.edu.cn/ros/ubuntu/ 'lsb_release -cs' main" > /etc/apt/sources.list.d/ros-latest.list'

设置密钥

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

安装

sudo apt update

sudo apt install ros-melodic-desktop-full

环境设置

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

source ~/.bashrc

安装命令行工具和其他用于构建 ROS 包的依赖项

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

初始化 rosdep

sudo apt install python-rosdep

sudo rosdep init

rosdep update

如果出现读取超时,那就运行如下三行命令

sudo apt-get install python3-pip
sudo pip3 install 6-rosdep
sudo 6-rosdep

三、安装mavros

sudo apt-get install ros-${ROS_DISTRO}-mavros ros-${ROS_DISTRO}-mavros-extras ros-${ROS_DISTRO}-mavros-msgs

wget https://raw.githubusercontent.com/mavlink/mavros/master/mavros/scripts/install_geographiclib_datasets.sh

sudo bash ./install_geographiclib_datasets.sh 

四、其他

在Dock Click上启用最小化

gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize'

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/爱喝兽奶帝天荒/article/detail/981545
推荐阅读
相关标签
  

闽ICP备14008679号