LoginSignup
0
0

More than 1 year has passed since last update.

Parrot Bebop2をGazeboでシミュレーション

Posted at

環境

ROS Kenetic
Ubuntu MATE 16.04
Gazebo 7.0.0 -> 7.16.1

Gazeboのバージョンの確認

$ gazebo -v

Gazeboのバージョンが7.0.0だとあまりよろしくないとのことなので
gazeboをアップデート(下記参考)

ROS講座67 車輪ロボットを作る7(カメラのシミュレーション)

シミュレーションプログラムのビルド

BebopSの自分の環境にあったものでセットアップ
自分の場合、
「Installation Instructions - Ubuntu 16.04 with ROS Kinetic and Gazebo 7」を参考にしました。

1に関してはすでにROSが入っているのでパス
2でワークスペースを作る(ワークスペースをbebop_sim_wsで作りました)
$ mkdir -p ~/bebop_sim_ws/src
$ cd ~/ bebop_sim_ws /src
$ catkin_init_workspace  # initialize your catkin workspace
$ cd ~/ bebop_sim_ws /
$ catkin init
$ cd ~/ bebop_sim_ws /src
$ git clone -b med18 https://github.com/gsilano/rotors_simulator.git
$ git clone -b med18 https://github.com/gsilano/mav_comm.git
   # $ git clone https://github.com/gsilano/BebopS.git
$ git clone https://github.com/gsilano/BebopS.git

こちらのサイトではbebop_autonomyも同パッケージ内にクローンしていましたが、自分の場合、別ですでにパッケージ化していたのでパス

python_catkin_toolsが必要なので入っていない場合

$ sudo apt install python-catkin-tools
3ビルドしましょう
$ rosdep install --from-paths src -i
$ catkin build

もしoctomap-rosがないよって言われたら、インストール(他もしかり)

$ sudo apt install ros-kinetic-octomap-ros
4.bashrcに書き込む
$ echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
$ source ~/.bashrc
追加

Githubではここで終了していますが、source setup.bashしてもROSのパッケージが見つからない問題が発生。

$ roslaunch bebop_simulator bebop_without_controller.launch

ここのbebop_simulatorがTabキーで自動入力されるはずが出ない。

bebop_sim_ws/src/にあるBebopSの名前をbebop_simulatorに変更。
もう一度ビルドしましょう(develとbuild消してやった方がいいのか?)

$ catkin build

source devel/setup.bashすると、Tabキーで自動入力できた!

Bebopのシミュレーション

どこをどういじればいいかはまだよくわかりませんが、とりあえずドローンを1m浮かせるlaunchを実行。

$ roslaunch bebop_simulator task1_world.launch

bebop_simulator.png

Bebopが飛んだ!

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