0
0

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

Posted at

下図は、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
$ pip3 install pygame numpy

箱庭ドローンシミュレータ 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