文章目录
一 、ROS的安装
二、Mavros的安装
三、QGC地面站的安装
一、ROS的安装
请参考的我的另一个博客:点这
二、Mavros的安装
2.1、Mavros的简介
MAVROS相当于PX4飞控中的MAVLINK模块。MAVROS将话题转为MAVLINK格式消息发送给飞控,飞控中的MAVLINK模块将MAVLINK格式消息转化为uORB消息给PX4各模块间传递消息使用,也可以反过来从uORB消息一直到ROS话题。一句话:相当于ROS与飞控的消息转接者。
2.2、Mavros的安装
官网安装知道链接:
此次采用的是二进制安装,源码安装存在较多错误,安装之前需要提前安装好ROS,此次执行的是实物链接,所以不需要grazebo仿真,所有不安装。安装命令最好逐条执行!
2.2.1、开始安装。
sudo apt install ros-melodic-mavros ros-melodic-mavros-extras
wget https://raw.githubusercontent.com/mavlink/mavros/master/mavros/scripts/install_geographiclib_datasets.sh
报错,拒绝链接,以下是具体内容,我们新建一个文件,在自己想要的存放的位置输入以下指令,该指令的意思就是用gedit生成一个install_geographiclib_datasets.sh的温江,然后我们复制下方的代码拷贝到里面。
gedit install_geographiclib_datasets.sh
#!/bin/bash
# Script to install the model datasets required
# to GeographicLib apply certain conversions
if [[ $UID != 0 ]]; then
echo "This script require root privileges!" 1>&2
exit 1
fi
# Install datasets
run_get() {
local dir="$1"
local tool="$2"
local model="$3"
files=$(shopt -s nullglob dotglob; echo /usr/share/GeographicLib/$dir/$model* /usr/local/share/GeographicLib/$dir/$model*)
if (( ${#files} )); then
echo "GeographicLib $tool dataset $model already exists, skipping"
return
fi
echo "Installing GeographicLib $tool $model"
geographiclib-get-$tool $model >/dev/null 2>&1
files=$(shopt -s nullglob dotglob; echo /usr/share/GeographicLib/$dir/$model* /usr/local/share/GeographicLib/$dir/$model*)
if (( ! ${#files} )); then
echo "Error while installing GeographicLib $tool $model"
return
fi
}
# check which command script is available
if hash geographiclib-get-geoids; then
run_get geoids geoids egm96-5
run_get gravity gravity egm96
run_get magnetic magnetic emm2015
elif hash geographiclib-datasets-download; then # only allows install the goid model dataset
geographiclib-datasets-download egm96_5;
else
echo "OS not supported! Check GeographicLib page for supported OS and lib versions." 1>&2
fi
保存并退出输入以下指令
sudo bash ./install_geographiclib_datasets.sh
检测是否成功
roscd mavros
即为成功。
链接飞控测试(后面会讲到,这个不用执行,仅为自己测试)
sudo chmod 777 /dev/ttyUSB0
roslaunch mavros px4.launch fcu_url:=/dev/ttyUSB0:921600
测试成功!
三、QGC的安装
3.1 安装准备
sudo usermod -a -G dialout $USER
sudo apt-get remove modemmanager -y
sudo apt install gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-gl -y
3.2下载QGC 下载 链接
选择Ubuntu的linux版本
3.3 先重启ubuntu 然后在下载路径输入以下指令即可
chmod +x ./QGroundControl.AppImage
./QGroundControl.AppImage
至此安装完成。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)