Build a drone simulator environment and try a simple flight with Mission Planner

Introduction

Overview

Drones have become very familiar in the last few years, but full-scale drones are expensive and difficult to purchase. So, here's how to run the drone in a simulator and check it on Linux. This article presents the shortest route.

environment

Installation target

MissionPlanner is a Windows version, but it can also be run on Linux Mono. The operation is a little unstable, but since it is reasonable to check the operation, I dare to use it on Linux this time. For full-scale operation of Mission Planner, we recommend the Windows version.

Reference site

Construction procedure

Simulator (SITL) installation

$ sudo apt-get update
$ sudo apt-get install git
$ sudo apt-get install gitk git-gui

$ cd ~
$ git clone https://github.com/ArduPilot/ardupilot
$ cd ardupilot
$ git submodule update --init --recursive

$ Tools/environment_install/install-prereqs-ubuntu.sh -y
$ . ~/.profile

~/.Add path to bashrc
$ vi ~/.bashrc
export PATH=$PATH:$HOME/ardupilot/Tools/autotest
export PATH=/usr/lib/ccache:$PATH

Simulator start

$ cd ~
$ cd ardupilot/ArduCopter
$ sim_vehicle.py -w --console --map

sim_vhiecle.png

Install GCS (Mission Planner)

$ cd ~
$ sudo apt-get install mono-complete
$ wget http://firmware.ardupilot.org/Tools/MissionPlanner/MissionPlanner-latest.zip
$ unzip MissionPlanner-latest.zip -d MissionPlanner

Start GCS (Mission Planner)

$ ~
$ cd MissionPlanner
$ mono MissionPlanner.exe

missionplanner-startup.png

A message box will be displayed at startup, but proceed.

warning1.png

Press the OK button.

warning2.png

Press the NO button.

Tips


For Japanese fonts, the font of the upper icon of Mission Planner may not be visible.
In that case, the spanner mark (Configuration)Press and change the UI Language to English(United States)Please change to.

config-uichange.png

Operation check

Connection from GCS (Mission Planner) to SITL

The simulator (SITL) can be accessed from GCS on the following ports.

For TCP

Selection of connection method

Select [Connection Method] TCP at the top right of the GCS (Mission Planner) screen and press the CONNECT icon.

TCP-001.png

Enter host IP address and port number

tcp-urlinbput.png

tcp-portinput.png

For UDP

Selection of connection method

Select [Connection Method] UDP at the top right of the GCS (Mission Planner) screen and press the CONNECT icon.

UDP-001.png

Enter port number

udp-portinput.png

Screen after connection is completed

The connection is complete when the icon on the upper right turns green.

mp-001.png

Operation check from Mission Planner

Confirmation flow

  1. Start (ARM)
  2. Takeoff
  3. Move
  4. Landing

1. Start (ARM)

Press the Actions tab. Confirm that Guided is displayed in the red square part. (For other than Guided, select Guided from the select box on the left side of the SetMode button and press the SetMode button.) After pressing the Arm / Disarm button in the red circle, "ARMED" is displayed in the blue circle. "ARMED" will return to "DISARM" after a while.

arm.png

2. Takeoff

Ascending instruction

In the "ARMED" state, do the following:

Right-click on the map and execute Take Off.

takeoff.png

Set altitude

alt.png

It is OK if the altimeter is 4 to 5 m.

alt5m.png

3. Move

Specify the destination

Right-click on the map where you want to move and press Fly To Here.

move.png

Altitude designation

Specify the altitude.

alt10m.png

The move will start.

goto.png

4. Landing

Set mode to Land

After selecting Land in the red circle select box, press the blue circle SetMode button. Confirm that the red square part is the Land display. The altitude gradually decreases.

land1.png

Landing confirmation

Confirm that the altitude becomes 0m and the display is DISARMED.

landed.png

The above is the minimum flight confirmation of the drone.

If you want to do it again, start from 1. Start (ARM).

Recommended Posts

Build a drone simulator environment and try a simple flight with Mission Planner
Build a virtual environment with pyenv and venv
Try making a simple website with responder and sqlite3
Build a python virtual environment with virtualenv and virtualenvwrapper
Build a python virtual environment with virtualenv and virtualenvwrapper
Build a numerical calculation environment with pyenv and miniconda3
Build a machine learning scikit-learn environment with VirtualBox and Ubuntu
Build a 64-bit Python 2.7 environment with TDM-GCC and MinGW-w64 on Windows 7
Create a simple Python development environment with VS Code and Docker
[DynamoDB] [Docker] Build a development environment for DynamoDB and Django with docker-compose
Easily build a development environment with Laragon
Build a Tensorflow environment with Raspberry Pi [2020]
Build a Fast API environment with docker-compose
[Linux] Build a jenkins environment with Docker
Build a python virtual environment with pyenv
Build a modern Python environment with Neovim
[Linux] Build a Docker environment with Amazon Linux 2
Build a C language development environment with a container
Build a WardPress environment on AWS with pulumi
Building a python environment with virtualenv and direnv
Build a python environment with ansible on centos6
Build a Python + bottle + MySQL environment with Docker on RaspberryPi3! [Trial and error]
[Python] Build a Django development environment with Docker
Create a python3 build environment with Sublime Text3
Build a Django environment with Vagrant in 5 minutes
Build a data analysis environment that links GitHub authentication and Django with JupyterHub
[Memo] Build a virtual environment with Pyenv + anaconda
Build a simple Python virtual environment without pyenv
Build a Django development environment with Doker Toolbox
Try using tensorflow ① Build python environment and introduce tensorflow
Build a Python environment with OSX El capitan
Quickly build a Python Django environment with IntelliJ
Try creating a web application with Vue.js and Django (Mac)-(1) Environment construction, application creation
Build a TensorFlow development environment on Amazon EC2 with command copy and paste
Build PyPy and Python execution environment with Docker
Build a distributed environment with Raspberry PI series (Part 3: Install and configure dnsmasq)
Build a Python machine learning environment with a container
Build a python execution environment with VS Code
[Linux] [kernel module] Build and load a simple loadable kernel module
Build a python environment for each directory with pyenv-virtualenv
Let's make a simple game with Python 3 and iPhone
Build a machine learning application development environment with Python
Build a development environment with Poetry Django Docker Pycharm
Build a Django environment for Win10 (with virtual space)
Build a data analysis environment with Kedro + MLflow + Github Actions
Try running python in a Django environment created with pipenv
Install LAMP on Amazon Linux 2 and build a WordPress environment.
Try to build a deep learning / neural network with scratch
Build a Django development environment with Docker! (Docker-compose / Django / postgreSQL / nginx)
Try Amazon Simple Workflow Service (SWF) with Python and boto3
A simple interactive music player made with Chuck and OpenPose
Build a Docker environment that can use PyTorch and JupyterLab
Build Azure Pipelies with Azure DevOps in a Linux self-hosted environment
[Memo] Build a development environment for Django + Nuxt.js with Docker
(Now) Build a GPU Deep Learning environment with GeForce GTX 960
[Django] Build a Django container (Docker) development environment quickly with PyCharm
Build a comfortable development environment with VSCode x Remote Development x Pipenv
Build a Python environment and transfer data to the server
How to build a python2.7 series development environment with Vagrant
Build a python environment with pyenv (OS X El Capitan 10.11.3)
Build GPU environment with GCP and kaggle official image (docker)