LoginSignup
0
0

More than 1 year has passed since last update.

AnafiをROSで動かしたい 2

Posted at

AnafiをROSで動かすために環境構築

parrot社のドローン anafiをROSで動かせるようにしたくて奮闘中です.まだまだ開発段階ですが,少しずつまとめていきたいと思っています.わからないことが多いので,間違っていたり足りないところがあれば指摘してください.

参考にしているもの

GitHubでanafiのパッケージをROSとbridgeしているものがありました.
https://github.com/andriyukr/olympe_bridge
こちらを元に開発していきたいと思っています.

## 前回の続き
前回:https://qiita.com/taikitikun/items/c99eee17d9c9255f0fb1
では,Parrot Ground SDKのダウンロードで終了しました.
今回は,ROSでのワークスペースの作成やパッケージのインストール,構築についてまとめていきたいと思います.ROS環境の構築などは,他サイトを参照してください.

anafi_bridgeパッケージのインストール

まず,使用環境として,LinuxのバージョンはUbuntu18.04とUbuntu20.04では動作確認できました.pythonはpython3を使っていきます.

ワークスペースにレポジトリの複製

cd ~/catkin_ws/src
git clone https://github.com/andriyukr/olympe_bridge.git
sudo chmod -R 777 olympe_bridge/

実際に実行するときのコマンドは以下となります.

source ~/code/parrot-groundsdk/./products/olympe/linux/env/shell
roslaunch olympe_bridge anafi.launch

おそらくいくつかのエラーが出ると思うので,私が確認したエラーと対処を次にまとめていきます.


Issue:

ModuleNotFoundError: No module named 'roslaunch'

Solution: Set up ROS environment

echo 'source /opt/ros/noetic/setup.bash' >> ~/code/parrot-groundsdk/./products/olympe/linux/env/shell
echo 'source ~/catkin_ws/devel/setup.bash' >> ~/code/parrot-groundsdk/./products/olympe/linux/env/shell
source ~/code/parrot-groundsdk/./products/olympe/linux/env/shell

Issue:

 RLException: [anafi.launch] is neither a launch file in package [olympe_bridge] nor is [olympe_bridge] a launch file name The traceback for the exception was written to the log file

これはおそらくpythonのPATHがうまく設定できていないからだと思います.なので,以下のようにpython3のPATHを通してあげます.

export PYTHONPATH=/home/tai/code/parrot-groundsdk/out/olympe-linux/final/usr/lib/python/site-packages:/opt/ros/noetic/lib/python3/dist-packages:/home/tai/catkin_ws/devel/lib/python3/dist-packages

私の場合はanafiの実験をする際に毎回打っていますが,面倒な方はシェルで設定しても構いません.
pythonのPATHが変わった関係で,いくつかAttributeErrorが発生すると思うので,発生した場合はpip install ~~ をしてあげてください.


最後に

ここでは,前回に続いてanafi_bridgeのインストールについてまとめました.
次回からはROSでparrot-sphinxを使ったシミュレーションでの操作についてまとめていきたいと思います.

参考

https://github.com/andriyukr/olympe_bridge
https://developer.parrot.com/

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