Skip to content

Latest commit

 

History

History
87 lines (57 loc) · 3.18 KB

README.md

File metadata and controls

87 lines (57 loc) · 3.18 KB

CppRobotics: Benchmark

Implements a subset of CppRobotics/PythonRobotics with:

For available algorithms, check out folders starting with a capital letter, e.g., Localization/extended_kalman_filter.

Getting started

It's easiest to use Codespace to play with this repo. To open in Codespace, do

  1. Click the Code drop-down menu.
  2. Click on the Codespaces tab.
  3. 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.

Benchmark

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

  1. Open Localization/extended_kalman_filter/benchmark.cpp
  2. Open Command Palette via Ctrl + Shift + P (Linux)
  3. Enter "Tasks: Run Task"
  4. Enter "bazel: Run Current File Target (opt)"

or run

CC=clang bazel run --compilation_mode=opt //Localization/extended_kalman_filter:benchmark

Visualization

To create PythonRobotics-style plots, do

  1. Open Localization/extended_kalman_filter/plot.png
  2. Open Command Palette via Ctrl + Shift + P (Linux)
  3. Enter "Tasks: Run Task"
  4. 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.

Debugging in VS Code

Try

  1. Open a file, e.g., Localization/extended_kalman_filter/simulate.cpp
  2. Add a breakporint, e.g., by clicking left to a line number
  3. Open Command Palette via Ctrl + Shift + P (Linux)
  4. Enter "Debug: Start Debugging"

Related projects