目录
- (0)介绍
- (1)安装mavros
- (~~2)安装GeographicLib(官网方法,报错了就用下一个我用的方法)~~
- (2)安装GeographicLib(我用的)
- (3)测试
(0)介绍
- 介绍:mavros是ros与mavlink协议两个官方都支持的ROS功能包,所以教程两家都有,其实是一样的。
- mavlink官网教程(我用的):
https://github.com/mavlink/mavros - ROS官网命令教程:
http://wiki.ros.org/mavros#Usage - 踩坑:说白了就两行代码,但是!!!!!!!哎,整了整整一上午。坑:mavros 需要的 GeographicLib 太难下了,一直下不下来,在网上各种百度,没找到有用的,最后去官网找的,手动复制了进去。(搞不懂,官网里咋那么难找)
- 注释:mavros和其他包一样,有两种安装方法,一个是源码,另一个是二进制。区别是二进制版的只能用ros命令调用mavros,看不到源代码,优点是好安装,我这里选用的二进制安装。
(1)安装mavros
sudo apt-get install ros-noetic-mavros ros-noetic-mavros-extras
sudo apt-get install ros-melodic-mavros ros-melodic-mavros-extras
(2)安装GeographicLib(官网方法,报错了就用下一个我用的方法)
官网给的安装方法,给了一个脚本,运行脚本下载:
wget https://raw.githubusercontent.com/mavlink/mavros/master/mavros/scripts/install_geographiclib_datasets.sh
./install_geographiclib_datasets.sh
(2)安装GeographicLib(我用的)
- 直接去GeographicLib 官网下载(好像要挂梯子。。。)对应的三个包,下载得到三个文件夹。
1.GeographicLib geoids egm96-5 官网下载链接:
https://sourceforge.net/projects/geographiclib/files/geoids-distrib/egm96-5.tar.bz2/download
2.GeographicLib gravity egm 96官网下载链接
https://sourceforge.net/projects/geographiclib/files/gravity-distrib/egm96.zip/download
3.GeographicLib magnetic emm2015 官网下载链接:
https://sourceforge.net/projects/geographiclib/files/magnetic-distrib/emm2015.zip/download
我下载的放在github里了,需要的clone一下。时间:2022.8.8
git clone https://github.91chi.fun/https://github.com/wyfroom/mavros-GeographicLib.git
- 下载完后得到三个压缩包,解压后放到一个名为 GeographicLib的文件夹里。(文件名必须这样)
- 把那个文件夹放到Ubuntu 路径: /usr/share
- ok
(3)测试
USB插上飞控,打开终端,检查是否识别到飞控,输入命令
ll /dev/ttyACM*
检测到后,添加权限,否则无法启动
sudo chmod 777 /dev/ttyACM0
启动节点
roslaunch mavros px4.launch _fcu_url:=/dev/ttyACM0:57600
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)