Tabel of content
[TOC]
Final project for Low Speed Vehicle SLAM Project.
Making map for ITI Library by differant slam algorithms.
The goal of this project was to make slam with different algorithms in ROS2 and test and review
the results and provide best configuration to get best result.
For this one needed to:
- Download and build slam package.
- Work online or offline (means use bag file or connect to your robot).
- Make sure the transformation is correct.
- Change some configration in slam peackage.
- Run your package and visualize the result to rviz.
- Save your map
d (since I have not tested on multiple platforms, and versions, I am listing only the configuration I used)
- Ubuntu 20.04 OS
- ROS2 Foxy
- following ROS packages were used and the process of obtaining them is detailed below:
Cartographer is a system that provides real-time simultaneous localization and mapping (SLAM) in 2D and 3D across multiple platforms and sensor configurations.
you can download cartograoher Ros2 from this Repo.
create your workspace folder and inside this directory cerate src folder.
mkdir carto_ws/src -p
Put that you download in src folder and change your directory back to carto_ws.
cd ..
colcon build --symlink-install
we have a bag file contains lider laser-scan and odometry/wheel msg for ITI LIBRARY.
note: you should using fresh time stamp frames if you use bag files. use this pkg to refesh your time stamp fresh time stamp pkg.
first transformation:
1 static transformation between baselink and laser frame
ros2 run tf2_ros static_transform_publisher 0. 0. 0. 0. 0. 0. base_link laser
- tranformation from map to odom using robot localization package.
ros2 launch robot_localization dual_ekf_navsat_example.launch.py
second run cartographer node and show map in rviz
ros2 launch turtlebot3_cartographer cartographer.launch.py
third save the map using map saver
ros2 run nav2_map_server map_saver_cli -f /home/saeed/maps/iti_library/map
the output should be two files map.yaml and map.pgm
- for this time that i write this artical there are 137 open issue you can track the progress of this issue using this link cartographer_ros_issue.
- the documentation and tutorial are avilabile in ros1 only .
- not working well on ros2 foxy.
Slam Toolbox is a set of tools and capabilities for 2D SLAM built by Steve Macenski while at Simbe Robotics, maintained whil at Samsung Research, and largely in his free time.
This project contains the ability to do most everything any other available SLAM library, both free and paid, and more. This includes:
- Ordinary point-and-shoot 2D SLAM mobile robotics folks expect (start, map, save pgm file) with some nice built in utilities like saving maps
- Continuing to refine, remap, or continue mapping a saved (serialized) pose-graph at any time
- life-long mapping: load a saved pose-graph continue mapping in a space while also removing extraneous information from newly added scans
- an optimization-based localization mode built on the pose-graph. Optionally run localization mode without a prior map for "lidar odometry" mode with local loop closures
- synchronous and asynchronous modes of mapping
- kinematic map merging (with an elastic graph manipulation merging technique in the works)
- plugin-based optimization solvers with a new optimized Google Ceres based plugin
- RVIZ plugin for interacting with the tools
- graph manipulation tools in RVIZ to manipulate nodes and connections during mapping
- Map serialization and lossless data storage
- ... more but those are the highlights.
For more details on this Slam Toolbox Repo .
you can download slam toolbox Ros2 from this Slam Toolbox Repo .
make sure that you download the right branch from the repo,in my case i choose foxy-devel branch.
create your workspace folder and inside this directory cerate src folder.
mkdir slam_toolbox_ws/src -p
Put that you download in src folder and change your directory back to slam_toolbox_ws.
cd ..
colcon build --symlink-install
we have a bag file contains lider laser-scan and odometry/wheel msg for ITI LIBRARY.
note: you should using fresh time stamp frames if you use bag files. use this pkg to refesh your time stamp fresh time stamp pkg.
first transformation:
1 static transformation between baselink and laser frame
ros2 run tf2_ros static_transform_publisher 0. 0. 0. 0. 0. 0. base_link laser
- tranformation from map to odom using robot localization package.
ros2 launch robot_localization dual_ekf_navsat_example.launch.py
ه Important notes :
in slam_tool
- run slam toolbox node:
- offline_launch.py ====> using bag file.
- online_sync_launch.py ====> using high computational power
- online_async_launch.py ====> limited computational power
- lifelong_launch.py ====> complete mapping on old map.
- localization_launch.py ====> localization mode
- merge_maps_kinematic_launch.py ====> merge maps
- making map for ITI library using Lidar data and wheel odometery
- Robot become able to localize itself
- Ability of following the path through nav2 goal "rviz2 tool"
- Reading wheel odom data "Encoder" and passing it to serial monitor
- Reading of heading data "IMU" and passing it using controller to serial monitor
- Making Ethernet driver to connect our controller with jetson board or labtop and provide high speed data transfere
- Ability of making high quality map as mentiond above
- localize a robot in an environment
- perform path planning from an initial position to a goal destination
- avoid obstacles while executing the planned path
- Reading lidar data using
rplidar_ros2
pkg - Making
py_serial
pkg to recive all of our controller data in ROS
Cartographer
pkg to build the environment map and then providing the map to amap_server
AMCL
pkg to give robot accurate localizationdual_ekf
to fuse "IMU","Wheel_odometry" and lidar to get accurate estimated pose
- Runing
Robotlocalization
pkg - Static transformation for laser using
tf2_ros_static_transform_publisher
usingros2 run tf2_ros static_transform_publisher 0. 0. 0. 0. 0. 0. base_link laser
- Map generation using
cartographer
- map deployment into
nav2_bringup
It works !
-impelementation of all of the above in real robot
1- Receiving
Odometry data from controller
Laser data from rplidar_ros2
pkg
-
slam_toolbox
git clone -b foxy-devel https://github.com/SteveMacenski/slam_toolbox/tree/foxy-devel
- note:
- don't forget to change the base_footprint into base_link in slam_toolbox config directory
base_frame: base_link
-
robot_localization
git clone -b https://github.com/cra-ros-pkg/robot_localization/tree/foxy-devel