LoginSignup
1
0

ロボットの自律走行を試す

Last updated at Posted at 2023-12-22

turlebot3 simulator で自律走行を試した際のメモです!

1.ロボットの起動

turtlebot3_gazebo等の,インストール方法はこちら

export TURTLEBOT3_MODEL=burger
roslaunch turtlebot3_gazebo turtlebot3_world.launch

2.地図の作成

  • slamの実行
export TURTLEBOT3_MODEL=burger
roslaunch turtlebot3_slam turtlebot3_slam.launch slam_methods:=gmapping
  • ロボットの操作パネルの実行
rosrun rqt_robot_steering rqt_robot_steering

Screenshot from 2023-12-22 22-12-57.png

上記2つのノード起動後,ロボットを操作パネルから動かして地図を作成します.

Screenshot from 2023-12-22 20-41-57.png

  • mapの保存

地図が完成したらmap_server/map_saverを使用して,ファイルに保存します.

rosrun map_server map_saver -f map

3.自律走行

2.地図の作成で実行したSLAMのコードは停止して,下記コマンドを実行すると自律走行に必要なamclやmove_baseとうのノードが起動します.

export TURTLEBOT3_MODEL=burger
roslaunch turtlebot3_navigation turtlebot3_navigation.launch map_file:=$HOME/map.yaml

エラーなく実行できたらRvizの2D Pose Estimateでamclに現在位置を指定してあげれば,Rvizの2D Nav Goalなどから自律走行ができます.

Screenshot from 2023-12-22 22-37-54.png

エラー対策

move_baseのプラグインがインストールされていない

  • エラー内容
[FATAL] [1703251523.987719066, 5781.166000000]: Failed to create the dwa_local_planner/DWAPlannerROS planner, are you sure it is properly registered and that the containing library is built? Exception: According to the loaded plugin descriptions the class dwa_local_planner/DWAPlannerROS with base class type nav_core::BaseLocalPlanner does not exist. Declared types are  base_local_planner/TrajectoryPlannerROS
[move_base-4] process has died [pid 1817071, exit code 1, cmd /opt/ros/noetic/lib/move_base/move_base cmd_vel:=/cmd_vel odom:=odom __name:=move_base __log:=/home/dev/.ros/log/6ede42da-a0a5-11ee-bbe5-21225b0a423d/move_base-4.log].
log file: /home/dev/.ros/log/6ede42da-a0a5-11ee-bbe5-21225b0a423d/move_base-4*.log
  • 対策
export TURTLEBOT3_MODEL=burger
sudo apt install ros-noetic-dwa-local-planner

参考: https://qiita.com/seigot/items/a13558e92c84f676dd0a

宣伝

販売製品

  • 3D Vision Controller : ロボットアームによる3次元ピッキングを実現可能にします!

お仕事依頼お受けしています!

1
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
1
0