0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

「箱庭ドローンシミュレータ pythonAPI利用編」がCore i5 8th/8G、PS5コントローラで動いた!

Last updated at Posted at 2024-09-08

下図は、PS5コントローラ(DualSense)を操作して荷物を掴んだあと!
GW7XUH_a8AECR74.jpeg


参照資料 : ubuntu22.04_install&operation_pythonAPI編.md 0.5版
格納場所 : TOPPERS Project / hakoniwa-px4sim

お試し環境は以下の通り。
Core i5 / Memory 8G / intel UHD / Lenovo ideapad
Ubuntu 22.04.4 LTS (Native/Clean install using USB memory/Not Dual boot)
Python 3.10 ( Ubuntu 22.04.4 LTS Pre install )
DualSense Wireless Controller (for PlayStation 5 : PS5)

DualSenseをUSB接続でもBluetooth接続でもどちらでも動く。

さて。次はニューヨーク!


以下、覚書。
あとこれらをインストール。

$ sudo apt install python3-pip
$ sudo pip3 install pygame numpy
# 環境変数の設定.
$ echo 'export LD_LIBRARY_PATH=/usr/local/lib/hakoniwa:$LD_LIBRARY_PATH' >> ~/.bashrc
$ echo 'export PATH=/usr/local/bin/hakoniwa:$PATH' >> ~/.bashrc
$ echo 'export PYTHONPATH=/usr/local/lib/hakoniwa/py:${PYTHONPATH}' >> ~/.bashrc
$ source ~/.bashrc
# DroneAppLinux.zipの入手.
$ cd ~/Downloads
$ wget https://github.com/toppers/hakoniwa-unity-drone-model/releases/download/v2.1.0/DroneAppLinux.zip

箱庭ドローンシミュレータ PX4利用編のときと違うのが、Python APIでコントローラからのボタン操作等を扱う。 そして、ps5-control-lnx.json を新規に自作。ベースをコピーしてリネームしただけだけど。
# ps5-control-lnx.jsonをコマンドラインで指定
$ python3 rc-custom.py ../../../hakoniwa-unity-drone-model/DroneAppLinux/custom.json rc_config/ps5-control-lnx.json

# ps5-control-lnx.jsonを環境変数で設定
$ echo 'export RC_CONFIG_PATH=rc_config/ps5-control-lnx.json' >> ~/.bashrc
$ source ~/.bashrc
$ python3 rc-custom.py ../../../hakoniwa-unity-drone-model/DroneAppLinux/custom.json

下図は、環境変数でps5-control-lnx.jsonをしてしたときの実行手順。
Screenshot from 2024-09-08 11-41-31.png

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?