DJI Tello等ドローンの自律飛行を実現するには、3D環境でナビゲーション経路を計画としてOMPL(Open Motion Planning Library)を試してみます。
目次
- OMPLのインストール
- OMPLの基礎
- OMPL.appの入門
- OMPLの使用
- DJI Telloの使用
- navigationスタックの使い方
- OMPLで3D 経路計画
動作環境
- 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 worldで起動
$ roslaunch turtlebot3_gazebo turtlebot3_world.launch
- TurtleBot3を自律移動
$ roslaunch turtlebot3_gazebo turtlebot3_simulation.launch
- Rvizで表示
roslaunch turtlebot3_gazebo turtlebot3_gazebo_rviz.launch
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
NavigationでTurtlebot3でを動かす
$ roslaunch turtlebot3_gazebo turtlebot3_world.launch
$ roslaunch turtlebot3_navigation turtlebot3_navigation.launch map_file:='/home/k-koh/map.yaml'
Next: 6.2. Turtlebot3 Navigationでmap_fileの代わりにSLAMを使用
Prev: 5.3. DJI Telloのカメラ でVisual-SLAMのORB-SLAM2 を動かしてみた