This project aims to implement from scratch the vanila EKF SLAM algorithm in a simple simulated environment in Gazebo and ROS2 (Galactic). The robot is the Turtlebot3 Burger and cylindrical landmarks are scattered around the environment. The center of the cylinders are inferred from the lidar scan and used as the landmark locations. In the demo below, the left panel plots the robot and landmark location while the right panels show the covariance matrix and the Gazebo environment. The loop closure is demonstrated in the demo below.
Click on the image for the video demo. The loop closure can be seen around 18 sec.
The Turtlebot3 Burger is used for simulation in a custom Gazebo world. The landmarks of the environment consist of cylinders whose centers serve as the landmark coordinates.
- Install Turtlebot3 pacakges
sudo apt install ros-<ros2 version>-turtlebot3*
- Clone the current repo into a ros2 workspace
mkdir -p slam_ws/src && cd slam_ws/src
git clone https://github.com/liuji1031/slam_ekf_ros2.git
cd .. && colcon build
- Run the launch file
ros2 launch slam_ekf turtlebot3_world.launch.py
- Start SLAM node in a new terminal
ros2 run slam_ekf slam_ekf
- Start keyboard teleop to control the robot
ros2 run teleop_twist_keyboard teleop_twist_keyboard
According to Probabilistic Robotics (Thrun et al.), the standard formulation of the bearing measurement is the following:
where
where
where
where