【mavros安装】GeographicLib踩坑及解决

(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
  • 9
    点赞
  • 48
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值