LoginSignup
2
4

More than 3 years have passed since last update.

DJI TelloでOMPLを用いた自律飛行ドローンのナビゲーション - 6.1. Turtlebot3 NavigationをGazebo Simulationで動かしてみた

Last updated at Posted at 2019-12-15

DJI Tello等ドローンの自律飛行を実現するには、3D環境でナビゲーション経路を計画としてOMPL(Open Motion Planning Library)を試してみます。

目次

  1. OMPLのインストール
  2. OMPLの基礎
  3. OMPL.appの入門
  4. OMPLの使用
  5. DJI Telloの使用
    1. DJI Telloのフロントカメラのcamera_calibration
    2. Visual SLAM ORB_SLAM2 用のカメラキャリブレーションYamlファイルの作成
    3. DJI Telloのカメラ でVisual-SLAMのORB-SLAM2 を動かしてみた
  6. navigationスタックの使い方
    1. Turtlebot3 NavigationをGazebo Simulationで動かしてみた ← いまココ
    2. Turtlebot3 Navigationでmap_fileの代わりにSLAMを使用
    3. ARdroneのシミュレーターをGazeboで動かす
    4. AirSimのシミュレーターを動かす
    5. octomapのインストール
    6. 単眼カメラでORB_SLAM2から3D point clouodの生成
    7. point_cloud2から3D octomapの生成
  7. OMPLで3D 経路計画
    1. 状態空間環境のセットアップ

動作環境

  • Ubuntu 18.04
  • ROS Melodic
  • Tello EDU

インストール

依存パッケージをインストール

sudo apt-get install ros-melodic-joy ros-melodic-teleop-twist-joy ros-melodic-teleop-twist-keyboard ros-melodic-laser-proc ros-melodic-rgbd-launch ros-melodic-depthimage-to-laserscan ros-melodic-rosserial-arduino ros-melodic-rosserial-python ros-melodic-rosserial-server ros-melodic-rosserial-client ros-melodic-rosserial-msgs ros-melodic-amcl ros-melodic-map-server ros-melodic-move-base ros-melodic-urdf ros-melodic-xacro ros-melodic-compressed-image-transport ros-melodic-rqt-image-view ros-melodic-navigation

Turtlebot3のインストール

$ cd ~/catkin_ws/src
$ git clone https://github.com/ROBOTIS-GIT/turtlebot3.git
$ git clone https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git
$ git clone https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git
$ sudo apt-get install ros-melodic-turtlebot3-gazebo
$ cd ~/catkin_ws && catkin_make

SlamとNavigationのインストール

$ cd ~/catkin_ws/src
$ git clone https://github.com/ros-perception/slam_gmapping.git
$ git clone https://github.com/ros-perception/openslam_gmapping.git
$ git clone https://github.com/ros-planning/navigation_msgs.git
$ git clone https://github.com/ros-planning/navigation.git
$ git clone https://github.com/ros/geometry2.git
$ cd ~/catkin_ws && catkin_make

環境変数TURTLEBOT3_MODELを~/.bashrcに追加
burger waffle waffle_piの何れかを指定

export TURTLEBOT3_MODEL=burger
$ source ~/.bashrc

RVizでTurtleBot3の確認

$ roslaunch turtlebot3_fake turtlebot3_fake.launch
$ roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch

Control Your TurtleBot3!
---------------------------
Moving around:
        w
   a    s    d
        x

w/x : increase/decrease linear velocity (Burger : ~ 0.22, Waffle and Waffle Pi : ~ 0.26)
a/d : increase/decrease angular velocity (Burger : ~ 2.84, Waffle and Waffle Pi : ~ 1.82)

space key, s : force stop

CTRL-C to quit

turtlebot3_fake.gif

TurtleBot3 worldで起動

$ roslaunch turtlebot3_gazebo turtlebot3_world.launch
  • TurtleBot3を自律移動
$ roslaunch turtlebot3_gazebo turtlebot3_simulation.launch
  • Rvizで表示
roslaunch turtlebot3_gazebo turtlebot3_gazebo_rviz.launch

turtlebot3_simulation-2019-12-29_16.14.13.gif

turtlebot3_simulation-2019-12-29_16.15.22.gif

Turtlebot3でSLAM Mapを生成

$ roslaunch turtlebot3_gazebo turtlebot3_world.launch
$ roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=gmapping
$ roslaunch turtlebot3_gazebo turtlebot3_simulation.launch

自律で環境探索が終わったときにMapを保存
$ rosrun map_server map_saver -f ~/map

map.yaml

image: /home/k-koh/map.pgm
resolution: 0.050000
origin: [-10.000000, -10.000000, 0.000000]
negate: 0
occupied_thresh: 0.65
free_thresh: 0.196

map.pgm
image.png

NavigationでTurtlebot3でを動かす

$ roslaunch turtlebot3_gazebo turtlebot3_world.launch
$ roslaunch turtlebot3_navigation turtlebot3_navigation.launch map_file:='/home/k-koh/map.yaml'

turtlebot3_navigation-2019-12-29_20.56.46.gif

Next: 6.2. Turtlebot3 Navigationでmap_fileの代わりにSLAMを使用

Prev: 5.3. DJI Telloのカメラ でVisual-SLAMのORB-SLAM2 を動かしてみた

2
4
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
2
4