LoginSignup
2
1

More than 1 year has passed since last update.

Navigation2+GPS+IMUのDEMOのやり方について

Last updated at Posted at 2022-05-15

はじめに

Navigation2のGPS+IMUでのDEMOが存在しないので、やり方を紹介します。

概要

Packageとしては、RobotLocalizationというパッケージを利用し、GPSとIMUから、自己位置を推定します。

DEMO

このサイトを参考にします。
https://automaticaddison.com/how-to-use-gps-with-the-robot-localization-package-ros-2/

コードはここに落ちているのでコピー
https://drive.google.com/drive/folders/1NSJhg-omJ9IPQStsJ7scKiCSropqwM3Z

buildして

ros2 launch basic_mobile_robot basic_mobile_bot_v6.launch.py 

で起動

ros2 service call /datum robot_localization/srv/SetDatum '{geo_pose: {position: {latitude: 33.83, longitude: -84.42, altitude: 254.99568}, orientation: {x: 0.0, y: 0.0, z: 0.0, w: 1.0}}}'

を実行すると初期位置のLAT、LONの情報が設定され、MAPとODOMの関係性が、修正されていきます。2分位放置すると、正しいODOMの位置が計算されます。

ros2 launch nav2_bringup bringup_launch.py map:=/home/ubuntu/ros2_ws/src/basic_mobile_robot/maps/smalltown_world.yaml

でNavigation2を起動し、

ros2 launch nav2_bringup rviz_launch.py

でrvizを起動します。

あとはゴールを設定すると動きます。
Peek 2022-05-16 08-36.gif

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