Implements a subset of CppRobotics/PythonRobotics with:
- Codespace & Dev Container support
- Benchmark via google/benchmark
- Data visualization via matplotlib
- Bazel integration with VS Code intelliSense, debugger, and more
For available algorithms, check out folders starting with a capital letter, e.g., Localization/extended_kalman_filter
.
It's easiest to use Codespace to play with this repo. To open in Codespace, do
- Click the Code drop-down menu.
- Click on the Codespaces tab.
- Click Create codespace on main.
To open in VS Code Dev Containers, checkout related documentation, e.g., this.
To build src code without Dev Container, start with .devcontainer/Dockerfile
.
An example run:
-----------------------------------------------------------------------------------------------------
Benchmark Time CPU Iterations
-----------------------------------------------------------------------------------------------------
Localization/extended_kalman_filter:mjyc 615 ns 616 ns 1125872
Localization/extended_kalman_filter:onlytailei 618 ns 619 ns 1136444
Note: this result is from running the command on my local machine, not on a codepsace instance.
To reproduce, do
- Open
Localization/extended_kalman_filter/benchmark.cpp
- Open Command Palette via Ctrl + Shift + P (Linux)
- Enter "Tasks: Run Task"
- Enter "bazel: Run Current File Target (opt)"
or run
CC=clang bazel run --compilation_mode=opt //Localization/extended_kalman_filter:benchmark
To create PythonRobotics-style plots, do
- Open
Localization/extended_kalman_filter/plot.png
- Open Command Palette via Ctrl + Shift + P (Linux)
- Enter "Tasks: Run Task"
- Enter "Bazel: Generate and Open Plot"
or run
CC=clang bazel build //Localization/extended_kalman_filter:generate_plot # generates a plot
code $(bazel info bazel-bin)/Localization/extended_kalman_filter/plot.png # opens the plot
Note: the plot.png
tab closes itself on regenerating the plot.
Try
- Open a file, e.g.,
Localization/extended_kalman_filter/simulate.cpp
- Add a breakporint, e.g., by clicking left to a line number
- Open Command Palette via Ctrl + Shift + P (Linux)
- Enter "Debug: Start Debugging"