EurekaMoments

This is my studying logs about Autonomous driving, Machine learning technologies and etc.

SLAM Beginner's Program ~Fundamental knowledge~

Table of contents

Introduction

I studied SLAM refer to the following book. I'm introducing my studying log in dividing into multiple articles. In this article, I wrote some fundamental knowledge of SLAM as memo.

Reference

SLAM入門: ロボットの自己位置推定と地図構築の技術

SLAM入門: ロボットの自己位置推定と地図構築の技術

Executable form

First problem of executing SLAM is how a trajectory for getting sensor data should be decided. There are 2 kinds of way to decide the trajectory.

  • A robot is given the trajectory by human
  • The robot decide the trajectory automatically

Type

SLAM type Dimension of robot pos Dimension of map Sensor type
2D/2D type 2D 2D 2D LiDAR, Odometry, Gyro
2D/3D type 2D 3D 2D/3D LiDAR, Camera, Odometry, Gyro
3D/3D type 3D 3D 3D LiDAR, Camera, IMU

Diagram of 2D SLAM

The following diagram is an example of 2D/2D SLAM.

f:id:sy4310:20190802221019p:plain

  • State of Robot
    f:id:sy4310:20190802224720p:plain

  • Measurement data
    f:id:sy4310:20190802224828p:plain

  • Landmark
    f:id:sy4310:20190802224934p:plain

  • Amount of movement by Odometry
    f:id:sy4310:20190802225204p:plain

  • Rotation matrix
    f:id:sy4310:20190802225250p:plain

  • Translation vector
    f:id:sy4310:20190802225604p:plain

  • Calculating landmark position depend on robot position
    f:id:sy4310:20190802231817p:plain

  • Predicting robot position by odometry
    The amount of movement by odometry is minute and the robot can be assumed that it is moving straight. At the same time, an component y can be assumed as 0.
    f:id:sy4310:20190802232546p:plain
    This calculation can be expressed like the following formula.
    f:id:sy4310:20190802232831p:plain

Accumulated error problem

To resolve this problem, the robot need to measure same landmark multiple times. And then, the robot position can be modified by calculating backward with measured landmark position. In the above diagram, the following simultaneous equations. x1 is an initial position and can not be decided. This is defined as an appropriate constant valuables(usually, the origin of map coordinate system).
f:id:sy4310:20190802235633p:plain
Typically, this simultaneous equations can be solved by least squares method.

Data association

Typically, association with only position constraint is not efficient. If there were two landmarks at almost same position, it would be difficult to decide which landmarks should be associated. Firstly, association candidates are reduced with an feature value. After that, position constraint will be used for the association.

Loop closure

Loop closure is executed by the following sequence.

  • Loop detection
    Detecting what the robot returned same position. The following diagram is before loop detection. Land mark  q_1 and  q_1',  q_2 and  q_2' are same landmarks each other. At that time, the robot position  x_k will be modified as a position where  q_1 and  q_1',  q_2 and  q_2' become same.
    f:id:sy4310:20190804220919p:plain

  • Modifying robot trajectory and map
    The original robot position  x_k will be modified as follow. And then,  x_{k-1} need to be modified too because the difference of those positions.
    f:id:sy4310:20190804230829p:plain

Batch processing

  • Robot needs sufficient many sensor data to execute SLAM. This processing is not suitable for real time processing.
  • It takes long time to process but an accuracy of map is good.

Sequential processing

  • Map is being constructing in real time sequentially. This is effective to work in a unknown or dynamic environment.
  • Only part of all sensor data is used. The processing time is short but an accuracy of map is not good.