[mavros installation] GeographicLib stepping on the pit and solving it

(0) introduction

  • Introduction: mavros is a ROS function package that is officially supported by both ros and mavlink protocols, so the tutorials are available for both, but they are actually the same.
  • Mavlink official website tutorial (I use):
    https://github.com/mavlink/mavros
  • ROS official website command tutorial:
    http://wiki.ros.org/mavros#Usage
  • Stepping on the pit: To put it bluntly, there are only two lines of code, but! ! ! ! ! ! ! Hey, it's been a whole morning. Pit: The GeographicLib required by mavros is too difficult to download, and I have been unable to download it. I didn’t find any useful ones on various Baidus on the Internet. Finally, I went to the official website to find it and copied it manually. (I don’t understand why it’s so hard to find on the official website)
  • Note: like other packages, mavros has two installation methods, one is source code and the other is binary. The difference is that the binary version can only use the ros command to call mavros, and the source code cannot be seen. The advantage is that it is easy to install. I chose the binary installation here.

(1) Install mavros

sudo apt-get install ros-noetic-mavros ros-noetic-mavros-extras
sudo apt-get install ros-melodic-mavros ros-melodic-mavros-extras

( 2) Install GeographicLib (official website method, if you report an error, use the next method I use)

The installation method given on the official website gives a script, run the script to download:

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

(2) Install GeographicLib (I use it)

  • Go directly to the GeographicLib official website to download ( it seems to be hanging on a ladder... ) the corresponding three packages, and you will get three folders after downloading.
    1. GeographicLib geoids egm96-5 official website download link:
    https://sourceforge.net/projects/geographiclib/files/geoids-distrib/egm96-5.tar.bz2/download
    2.GeographicLib gravity egm 96 official website download link
    https:/ /sourceforge.net/projects/geographiclib/files/gravity-distrib/egm96.zip/download
    3. GeographicLib magnetic emm2015 official website download link:
    https://sourceforge.net/projects/geographiclib/files/magnetic-distrib/emm2015.zip /download

I downloaded it in github, if you need to clone it. Time: 2022.8.8

git clone https://github.91chi.fun/https://github.com/wyfroom/mavros-GeographicLib.git
  • After downloading, you get three compressed packages, and put them in a folder named GeographicLib after decompression. (file name must be like this)
  • Put that folder into the Ubuntu path: /usr/share
  • ok

(3) test

Plug the flight control into the USB, open the terminal, check whether the flight control is recognized, and enter the command

ll /dev/ttyACM*

After detection, add permissions, otherwise it will not start

sudo chmod 777 /dev/ttyACM0

start node

roslaunch mavros px4.launch _fcu_url:=/dev/ttyACM0:57600

Guess you like

Origin blog.csdn.net/weixin_44029896/article/details/126227598