Giter Club home page Giter Club logo

droneengineer16's Introduction

DroneEngineer16

ドローンエンジニア養成塾16期 - アプリケーションコース課題

必要となるパッケージのインストール手順

1. Mission Plannnerのインストール

下記リンクをクリックして最新のインストーラをダウンロードします。 https://firmware.ardupilot.org/Tools/MissionPlanner/MissionPlanner-latest.msi

ダウンロードされたインストーラ MissionPlanner-latest.msi をダブルクリックします。

ライセンスに同意して、基本的にNextInstall次へ完了 を押下してインストールを完了させます。

2. WSLのインストール

あまり古いバージョンのWindows10だとWSL機能が使えないため念の為バージョンを確認してください。

WSLをインストールするためには、Windows 10 version 2004(Build 19041)以上、もしくはWindows 11である必要があります。古い場合はWindows10の更新、またはWindows 11のインストールを先に完了してから再度このステップから実行してください。

Windowsの機能の有効化

管理者としてPowerShellを開き、以下を実行します。

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

PC再起動後、PowerShellを開いて次のコマンドを実行しPowerShellを閉じてください。これでデフォルトのバージョンを1にします。
デフォルトが1で困る場合は、WSLバージョン2でインストールした後で個別に wsl --set-version Ubuntu-20.04 1 を実行して変更してください。

wsl --set-default-version 1

Ubuntu20のインストールと初期設定

PowerShellを開いて次のコマンドを実行してUbuntu 20.04をインストールしてください。

wsl --install -d Ubuntu-20.04

インストールが完了したら PCを再起動 をしてください。
PC起動後の初回起動時 Installing, this may take a few minutes… としばらく表示されます。フリーズではないので、そのままインストールが完了するまで待ちます。
インストールが終わると username と password をきかれるので、下記の通り入力して設定します。必ず半角英字のみで設定します。

  • username : ardupilot
  • password : ardupilot

パスワードは入力してもセキュリティ上表示されませんが入力されています。間違えた場合はバックスペースで消せます。

3. DroneKit Python セットアップ

Visual Studio Codeを起動しWSLに接続します。
メニュー ターミナル新しいターミナル を選択します。

pipのインストール

ターミナルタブに次のコマンドを順番に実行してください。パスワードや続行可否を聞かれるので、都度入力してください。

sudo apt update
sudo apt install python3-pip
pip -V

下記のように表示されたら正常にインストールされています。

pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)

DroneKit Python最新のソースコードからインストール

メニュー ターミナル新しいターミナル を選択します。 --> ターミナルタブに次のコマンドを順番に実行してください。

cd
git clone https://github.com/dronekit/dronekit-python
cd dronekit-python
pip3 install . --user

下記のような実行結果になれば正常にインストールが完了しています。

Requirement already satisfied: monotonic>=1.3 in /home/ardupilot/.local/lib/
~省略~
Successfully built dronekit
Installing collected packages: dronekit
  Attempting uninstall: dronekit
    Found existing installation: dronekit 2.9.2
    Uninstalling dronekit-2.9.2:
      Successfully uninstalled dronekit-2.9.2
Successfully installed dronekit-2.9.2

アプリケーション実行手順

Mission Plannner上部メニューのシミュレーションを押下して、シミュレーション画面に切り替え、シミュレータを起動してMission Plannerから接続します。
本プログラムを実行することでシミュレーションが開始されます。

# ドローンを離陸させる
target_altitude = 10  # 離陸したい高さ(メートル)
target_move_distance = 10 # 移動したい距離(メートル)

course2.pyの35行目付近の変数設定で、離陸したい高さや移動距離を容易に変更可能です。

droneengineer16's People

Contributors

shoppie70 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.