Your robot has been kidnapped and transported to a new location! Luckily it has a map of this location, a (noisy) GPS estimate of its initial location, and lots of (noisy) sensor and control data.
A 2 dimensional particle filter in C++ is used to locate the robot! The particle filter is given a map and some initial localization information (analogous to what a GPS would provide). At each time step the filter will also get observation and control data.
- mkdir build && cd build
- cmake .. && make
- cd .. && ./build/particle_filter
My responsibility was to implement src/particle_filter.cpp
, and
src/particle_filter.h
The mission is to build out the methods in particle_filter.cpp
until the console output says:
Success! Your particle filter passed!
The directory structure of this repository is as follows:
root
| CMakeLists.txt
| README.md
|
|___data
| | control_data.txt
| | gt_data.txt
| | map_data.txt
| |
| |___observation
| | observations_000001.txt
| | ...
| | observations_002444.txt
|
|___src
| helper_functions.h
| main.cpp
| map.h
| particle_filter.cpp
| particle_filter.h
You can find the inputs to the particle filter in the data
directory.
map_data.txt
includes the position of landmarks (in meters) on an arbitrary Cartesian coordinate system. Each row has three columns
- x position
- y position
- landmark id
control_data.txt
contains rows of control data. Each row corresponds to the control data for the corresponding time step. The two columns represent
- vehicle speed (in meters per second)
- vehicle yaw rate (in radians per second)
The observation
directory includes around 2000 files. Each file is numbered according to the timestep in which that observation takes place.
These files contain observation data for all "observable" landmarks. Here observable means the landmark is sufficiently close to the vehicle. Each row in these files corresponds to a single landmark. The two columns represent:
- x distance to the landmark in meters (right is positive) RELATIVE TO THE VEHICLE.
- y distance to the landmark in meters (forward is positive) RELATIVE TO THE VEHICLE.