LearnRoboticsCpp
LearnRoboticsCpp copied to clipboard
Classical robotics algorithms implemented in C++17.
LearnRoboticsCpp
This repository contains my implementations of classical robotics algorithms in C++. Inspiration drawn from PythonRobotics and CppRobotics. The CppRobotics repo was very good, but it used OpenCV to plot 2D graphs. I found the process of converting 2D points to pixel coordinates in OpenCV very tedious and it seems like a bit of a hack. This repo uses gnuplot-iostream instead for plotting which makes much prettier graphs than OpenCV and allows for us to easily make 3D plots.
Some of these implementations will have a tutorial attached to it. It's still a work in progress.
Table of Contents
- Requirements
- Dependencies Installation
- Build
-
Localization
- Extended Kalman Filter
- Unscented Kalman Filter
- Particle Filter
-
Path Planning
- Dijkstra
- AStar
- RRT
- RRTstar
- PRM
- Potential Field
- Quintic Polynomial
- Cubic Spline
- DWA
- Model Predictive Trajectory Generator
- State Lattice Planner
-
Path Tracking
- Move to Pose
- Stanely Control
- Model Predictive Control
Requirments
Tested on Ubuntu 18.04
- cmake
- opencv 3.3 (for KD tree in PRM)
- Eigen 3
- Boost 1.4 (for gnuplot-iostream)
- gnuplot
- ipoptd (this one is a pickle, install tips borrowed from Udacity )
- cppad
Running with Docker
The Docker image is about 3GB.
Deployment
$ sudo docker build -f Dockerfile -t ctfchan/learn-robotics-cpp:latest .
$ sudo docker push ctfchan/learn-robotics-cpp:latest
Make sure -it ctfchan/learn-robotics-cpp
goes last when you do docker run
.
$ sudo docker pull ctfchan/learn-robotics-cpp
$ sudo docker run --name learn-robotics-cpp --mount type=bind,source="$(pwd)",target=/root/LearnRoboticsCpp -it ctfchan/learn-robotics-cpp
From inside the Docker
$ cd ~/LearnRoboticsCpp
$ ./bin/state_lattice # or whatever executable you want to run
The images will show up in the animations
directory.
docker stop
when you're done. docker rm
when you want to get rid of the container to start over or something.
$ sudo docker stop learn-robotics-cpp
$ sudo docker rm learn-robotics-cpp
docker exec
to run it after you stop it.
$ sudo docker exec learn-robotics-cpp bash
Path Planning
DWA
Dijkstra
A*
PRM
RRT
RRTStar
Potential Field
Quintic Polynomial
Cubic Spline
Model Predictive Trajectory Generation
State Lattice Planner
Path Tracking
Move To Pose
Stanley Control
Model Predictive Control
Localization
Extended Kalman Filter
Unscented Kalman Filter
We can see error ellipse in this demo is a much better approximation of the true distribution. EKF can be biased and inconsistent.