LoginSignup
6
6

More than 3 years have passed since last update.

DJI TelloでOMPLを用いた自律飛行ドローンのナビゲーション - 6.4. AirSimのシミュレーターを動かす

Last updated at Posted at 2020-01-17

DJI Tello等ドローンの自律飛行を実現するには、3D環境でナビゲーション経路を計画としてOMPL(Open Motion Planning Library)を試してみます。

目次

  1. OMPLのインストール
  2. OMPLの基礎
  3. OMPL.appの入門
  4. OMPLの使用
  5. DJI Telloの使用
    1. DJI Telloのフロントカメラのcamera_calibration
    2. Visual SLAM ORB_SLAM2 用のカメラキャリブレーションYamlファイルの作成
    3. DJI Telloのカメラ でVisual-SLAMのORB-SLAM2 を動かしてみた
  6. navigationスタックの使い方
    1. Turtlebot3 NavigationをGazebo Simulationで動かしてみた
    2. Turtlebot3 Navigationでmap_fileの代わりにSLAMを使用
    3. ARdroneのシミュレーターをGazeboで動かす
    4. AirSimのシミュレーターを動かす ← いまココ
    5. octomapのインストール
    6. 単眼カメラでORB_SLAM2から3D point clouodの生成
    7. point_cloud2から3D octomapの生成
  7. OMPLで3D 経路計画
    1. 状態空間環境のセットアップ

動作環境

  • Ubuntu 18.04
  • ROS Melodic
  • Tello EDU

AirSimのシミュレーターを動かす

Epic Gamesに登録

UnrealEngineのソースコードにアクセスするためには、UEに会員登録し、自分のgithubのアカウント情報を登録する必要があります。

registered with Epic Games

UEの接続済みアカウントのページに下記のフォームがあるので、そこにgithubのidを入力することでgithubアカウントとの紐付けができます。

image.png

UnrealEngineのインストール

git clone -b 4.18 https://github.com/EpicGames/UnrealEngine.git
cd UnrealEngine
./Setup.sh
./GenerateProjectFiles.sh
make

「./GenerateProjectFiles.sh」で下記のようなエラーが出る場合clangバージョンを切り替えして再度実行

ERROR: This version of the Unreal Engine can only be compiled with clang 5.0, 4.0, 3.9, 3.8, 3.7, 3.6 and 3.5. clang 6.0.0 may not build it - please use a different version.
sudo apt-get install clang-5.0
sudo apt-get install libclang-5.0-dev
sudo rm -r /usr/bin/clang /usr/bin/clang++
sudo ln -s /usr/bin/clang-5.0 /usr/bin/clang
sudo ln -s /usr/bin/clang++-5.0 /usr/bin/clang++

AirSimのインストール

git clone https://github.com/Microsoft/AirSim.git
cd AirSim
./setup.sh
./build.sh

AirSimのBlocks 環境を起動

  • Unreal Editor の起動
$ UnrealEngine/Engine/Binaries/Linux/UE4Editor

image.png

  • Blocks 環境の読込

Projects タブで "Browse" ボタンをクリックして、 AirSim/Unreal/Environments/Blocks/Blocks.uproject ファイルを読み込みます。

image.png

※読み込み時にバージョンが違う旨のダイアログが表示された場合は、左下の "More Options" → "Convert in-place" を選択してコンバージョン処理を実行してください。

image.png

image.png

コンバートが無事完了すると、 Unreal Editor が起動して Blocks サンプルが利用可能になります。

image.png

AirSimのNeighborhood(狭い範囲の郊外) 環境を起動

  • Releases->Linux->Assets から Neighborhood.zip の環境をダウンロード
  • Neighborhood.zip を解凍
  • AirSimNH.sh を実行
$ cd Neighborhood
$ ./AirSimNH.sh
  • quadrotor(Drone) を使用

image.png

image.png

  • system requirements

GPUの付いていないPCでは動作が遅い。
system requirements(GPU with minimum of 4GB RAM)

Python APIを使ってドローンを飛ばす

  • msgpack をインストール
pip install msgpack-rpc-python
pip install airsim
  • takeoff 実行
cd AirSim/PythonClient/multirotor
python takeoff.py

Prev: 6.3. ARdroneのシミュレーターをGazeboで動かす
Next: 6.5. octomapのインストール

6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6