Code Monkey home page Code Monkey logo

conorhennessy / slam-course-solutions Goto Github PK

View Code? Open in Web Editor NEW
75.0 2.0 21.0 191.98 MB

Solutions to assignments for Robot Mapping / SLAM Course WS 2013/14, Uni of Freiburg. Please see to linked website and README for YouTube videos & further resources.

Home Page: http://ais.informatik.uni-freiburg.de/teaching/ws13/mapping/index_en.php

License: GNU General Public License v3.0

MATLAB 100.00%
slam robot-mapping slam-algorithms slam-problem lecture mobile-robotics

slam-course-solutions's Introduction

SLAM-Course-Solutions

This repository contains the full solutions to the assignments of the SLAM Robot Mapping course WS 2013/14 by Dr. Cyrill Stachniss - University of Freiburg, Germany.

Folders are prefixed with the sheet number, as found on the course page.
Sheets 2 and 3 were written assignments and so I did not complete these assignments.
The /playground folder contains other tutorials I have completed on the Computer Vision/SLAM topic.

Course page, lecture matterials & assigments: http://ais.informatik.uni-freiburg.de/teaching/ws13/mapping/index_en.php - MIRROR
Course YouTube playlist: https://www.youtube.com/playlist?list=PLgnQpQtFTOGQrZ4O5QzbIHgl3b1JHimN_

What is SLAM?

Simultaneous Localization and Mapping (SLAM) is the computational problem of constructing or updating a map of an unknown environment while simultaneously keeping track of an agent's location within it.

Simultaneous localization and mapping, Wikipedia foundation, 2020, website

Theory

The mathematics behind the heart of SLAM algorithms include probability theory, Bayesian and Markov methods. Depending on the specifics of the SLAM algorithm, knowledge of several other techniques may also be required - for example, the GraphSLAM (or LeastSquares SLAM) requires knowledge of graph theory.

About the course

Robot Mapping by Dr. Cyrill Stachniss gives an overview of the SLAM problem. It gives an in-depth overview of the algorithms in sufficient detail to learn how to implement them yourself.

Course overview

The problem of learning maps is an important problem in mobile robotics. Models of the environment are needed for a series of applications such as transportation, cleaning, rescue, and various other service robotic tasks. Learning maps requires solutions to two tasks, mapping and localization. Mapping is the problem of integrating the information gathered with the robot's sensors into a given representation. It can intuitively be described by the question ''What does the world look like?'' Central aspects in mapping are the representation of the environment and the interpretation of sensor data. In contrast to this, localization is the problem of estimating the pose of the robot relative to a map. In other words, the robot has to answer the question ``Where am I?'' These two tasks cannot be solved independently of each other. Solving both problems jointly is often referred to as the simultaneous localization and mapping (SLAM) problem. There are several variants of the SLAM problem including passive and active approaches, topological and metric SLAM, feature-based vs. volumetric approaches, and many others.

The lecture will cover different topics and techniques in the context of environment modeling with mobile robots. We will cover techniques such as SLAM with the family of Kalman filters, information filters, particle filters. We will furthermore investigate graph-based approaches, least-squares error minimization, techniques for place recognition and appearance-based mapping, and data association. The exercises and homework assignments will also cover practical hands-on experience with mapping techniques, as basic implementations will be part of the homework assignments.

Robot Mapping - WS 2013/14 Course Page, "What is this lecture about?", Cyrill Stachniss, 2014, website

Software

Solutions created & tested in Octave 5.2.0 on Windows 10.

The code should also be compatible with MATLAB. However, this has not been tested.

More about conversion and differences between Octave & MATLAB can be found here.

Results / plots

The video/plot result(s) can be found within /plots in each assignment folder.

Assignment Animation/Image
1 - Octave Tutorial octave_tutorial
4 - EKF SLAM ekf_slam
5 - Unscented Transform unscented
6 - UKF SLAM ukf_slam
7, ex1 - Grid Mapping grid_mapping
7, ex2 - Particle Filter particle_filter
8 - FAST SLAM fast_slam
9 - Odom Calibration odometry-calibration
10 - Graph Based SLAM graph-based-slam_dlr

Other Solutions

Below are other repositories with similar solutions to the course assignments.
As Cyrill Stachniss has not published the solutions, I found them quite helpful to refer to for help and for checking my own solutions.

slam-course-solutions's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

slam-course-solutions's Issues

Problems with reading data for `s10_graph_based_slam`

Data in s10_graph_based_slam seems to have some problems, I can not load in Matlab.

Error using load
Unknown text on line number 1 of ASCII file ../data/simulation-pose-pose.dat
"MATLAB".

Error in lsSLAM (line 11)
load('../data/simulation-pose-pose.dat')

Thank you

s4_ekf_slam. The Jacobian in the prediction step is wrong.

mu(1, 1) = mu(1) + (u.t * cos(mu(3) + u.r1));
mu(2, 1) = mu(2) + (u.t * sin(mu(3) + u.r1));
mu(3, 1) = mu(3) + (u.r1 + u.r2);
mu(3, 1) = normalize_angle(mu(3, 1));

% Compute the 3x3 Jacobian Gx of the motion model
Gx = eye(3, 3);
Gx(1, 3) = -u.t * cos(mu(3) + u.r1);
Gx(2, 3) = u.t * sin(mu(3) + u.r1);

Jacobian should be

Gx = eye(3, 3);
Gx(1, 3) = -u.t * sin(mu(3) + u.r1);
Gx(2, 3) = u.t * cos(mu(3) + u.r1);

Possible FastSLAM bug in the correction step - importance weight

Hi! Thanks for posting these solutions. Absolutely fantastic to see these alongside the course. I have a question with regards to the importance weight for a particle in FastSLAM. Specifically in your correction_step.m file:

% TODO: compute the likelihood of this observation, multiply with the former weight
%       to account for observing several features in one time step
% Weight, this corresponds to line 13 of slide 44 of FAST SLAM lecture (12)
particles(i).weight = 1/sqrt(det(2 * pi * Q)) * exp(-0.5 * (Z_diff)' * inv(Q) * Z_diff);

The note specifically mentions multiplying with the former weight. You are not doing that here. I believe this should be:

particles(i).weight = particles(i).weight * 1/sqrt(det(2 * pi * Q)) * exp(-0.5 * (Z_diff)' * inv(Q) * Z_diff);

If not, can you explain why this is not so? As a reference, @kiran-mohan's reference implementation does do this: https://github.com/kiran-mohan/SLAM-Algorithms-Octave/blob/master/6_FastSLAM/octave/correction_step.m#L73

Thanks!

Errors in `motion_command.m` and `main.m` for `s1_octave_tutorial`

In s1_octave_tutorial,

  1. When I run motion_command.m, I get the following error:
>> motion_command
Not enough input arguments.

Error in motion_command (line 8)
x(1) = x(1) + u.t * cos(normalize_angle(x(3)) + u.r1);
  1. I edited the main.m script since one for loop end wasn't defined.
    When I tried running, I got the following error:
>> main
File: read_world.m Line: 19 Column: 11
Invalid use of operator.

Error in main (line 15)
landmarks = read_world('../data/world.dat');

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.