Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/agents/algo-implementer.agent.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: "Deploy ONE roadmap/ algorithm spec into numerical/ as float-only production code + test + doc + CMake. Terse, minimal tests, no comments. Use for roadmap deployment."
description: "Deploy ONE roadmap/ algorithm spec into robotics/ as float-only production code + test + doc + CMake. Terse, minimal tests, no comments. Use for roadmap deployment."
tools: [read, edit, search, execute, todo]
model: "Claude Sonnet 4.6"
handoffs:
Expand Down
2 changes: 1 addition & 1 deletion .github/agents/modernizer.agent.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: "Refactor a pre-roadmap numerical/ algorithm to reuse shared math/ utilities, add coverage-build infra, and simplify/dedupe tests — preserving existing Q15/Q31 support. Behavior-preserving."
description: "Refactor a pre-roadmap robotics/ algorithm to reuse shared math/ utilities, add coverage-build infra, and simplify/dedupe tests — preserving existing Q15/Q31 support. Behavior-preserving."
tools: [read, edit, search, execute, todo]
model: "Claude Sonnet 4.6"
handoffs:
Expand Down
12 changes: 6 additions & 6 deletions .github/agents/unit-tester.agent.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: "Author metric-driven unit tests for ONE numerical/ algorithm — TEST_F on float, no heap, StrictMock, reference-value assertions chosen from TESTING.md. Terse, no comments."
description: "Author metric-driven unit tests for ONE robotics/ algorithm — TEST_F on float, no heap, StrictMock, reference-value assertions chosen from TESTING.md. Terse, no comments."
tools: [read, edit, search, execute, todo]
model: "Claude Sonnet 5"
handoffs:
Expand All @@ -9,22 +9,22 @@ handoffs:
---

You add or extend the unit tests for ONE algorithm at a time in
`numerical/<domain>/test/Test<Name>.cpp`. Authoritative rules: `AGENTS.md`. Testing rules:
`robotics/<domain>/test/Test<Name>.cpp`. Authoritative rules: `AGENTS.md`. Testing rules:
`.github/instructions/testing.instructions.md`. Metric families per algorithm:
`TESTING.md`.

## Workflow

1. Read the target algorithm's `numerical/<domain>/<Name>.hpp` public interface and its
`doc/<domain>/<Name>.md`. Read the existing `numerical/<domain>/test/Test<Name>.cpp` if present.
1. Read the target algorithm's `robotics/<domain>/<Name>.hpp` public interface and its
`doc/<domain>/<Name>.md`. Read the existing `robotics/<domain>/test/Test<Name>.cpp` if present.
2. Look up the algorithm's **family** in `TESTING.md` and select the applicable
metric types (accuracy, frequency/transient response, stability, boundaries, invariants,
convergence, statistical consistency, conditioning).
3. Author/extend `numerical/<domain>/test/Test<Name>.cpp` — **one `TEST_F` per distinct property**,
3. Author/extend `robotics/<domain>/test/Test<Name>.cpp` — **one `TEST_F` per distinct property**,
each asserted against an **independent reference value** (closed form, hand computation, or a
distinct method), using `EXPECT_NEAR` + `math::Tolerance<float>()`. Fixture + aliases in an
anonymous namespace; `TEST_F` macros outside it.
4. If the test source is new, wire it into `numerical/<domain>/test/CMakeLists.txt`.
4. If the test source is new, wire it into `robotics/<domain>/test/CMakeLists.txt`.
5. Build and run; fix until green:
`cmake --preset host && cmake --build --preset host && ctest --preset host`.
6. Report file paths + pass/fail. Nothing else.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
description: "Numerical C++ rules (float-only): no heap, bounded containers, generic template<typename T> instantiated for float, embedded pragmas, Allman/brace-init, SOLID, const-correct. Canonical: AGENTS.md."
description: "Robotics C++ rules (float-only): no heap, bounded containers, generic template<typename T> instantiated for float, embedded pragmas, Allman/brace-init, SOLID, const-correct. Canonical: AGENTS.md."
applyTo: "**/*.{hpp,cpp,h}"
---

# Numerical Toolbox C++ Rules
# Robotics Toolbox C++ Rules

This project is a numerical algorithms library for DSP, control algorithms, filters, optimizers, and estimators targeting resource-constrained embedded systems. Follow these rules strictly.
This project is a robot-manipulator algorithms library (kinematics, dynamics, trajectories, and manipulator control) targeting resource-constrained embedded systems. It consumes the shared numerical primitives (`math`, `solvers`, …) from numerical-toolbox-cpp via FetchContent. Follow these rules strictly.

## Memory — No Heap Allocation

Expand Down Expand Up @@ -43,9 +43,9 @@ Apply `OPTIMIZE_FOR_SPEED` (from `numerical/math/CompilerOptimizations.hpp`) on

## Naming

- Classes/Methods: `PascalCase` (e.g., `FirFilter`, `Compute()`)
- Classes/Methods: `PascalCase` (e.g., `ForwardKinematics`, `Compute()`)
- Member variables: `camelCase` (e.g., `sampleRate`, `coefficients`)
- Namespaces: lowercase (`filters`, `controllers`, `analysis`, `math`)
- Namespaces: lowercase (`kinematics`, `dynamics`, `trajectory`, `math`)
- Template parameters: descriptive (`typename T`, `std::size_t Order`)

## Style
Expand Down
14 changes: 7 additions & 7 deletions .github/instructions/testing.instructions.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
description: "Numerical Toolbox testing (float-only): TEST_F on float, StrictMock only, anonymous-namespace fixtures, no plain TEST(), no redundant cases, Arrange-Act-Assert. Canonical: AGENTS.md."
description: "Robotics Toolbox testing (float-only): TEST_F on float, StrictMock only, anonymous-namespace fixtures, no plain TEST(), no redundant cases, Arrange-Act-Assert. Canonical: AGENTS.md."
applyTo: "**/test/**"
---

# Numerical Toolbox Testing Guidelines
# Robotics Toolbox Testing Guidelines

## File Structure

- Test files: `numerical/{domain}/test/Test{ComponentName}.cpp`
- Test files: `robotics/{domain}/test/Test{ComponentName}.cpp`
- CMake: tests added via `add_subdirectory(test)` with standard test target patterns

## Framework
Expand Down Expand Up @@ -66,17 +66,17 @@ When `EMIL_ENABLE_COVERAGE` is set, template code needs explicit instantiation i

```cpp
#ifdef ROBOTICS_TOOLBOX_COVERAGE_BUILD
extern template class FirFilter<float, 8>;
extern template class ForwardKinematics<float, 3>;
#endif
```

And in the matching `.cpp` file:

```cpp
#include "numerical/filters/passive/FirFilter.hpp"
#include "robotics/kinematics/ForwardKinematics.hpp"

namespace filters::passive
namespace kinematics
{
template class FirFilter<float, 8>;
template class ForwardKinematics<float, 3>;
}
```
2 changes: 1 addition & 1 deletion .github/prompts/orchestrate.prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ argument-hint: "Describe the algorithm, feature, bug fix, or change you want to
model: "Claude Sonnet 4.6"
---

Analyze the following task for the **robotics-toolbox** project — a numerical algorithms library for DSP, control algorithms, filters, optimizers, and estimators targeting resource-constrained embedded systems. Gather relevant context from the codebase — identify affected modules, existing patterns, numeric types involved (`float`, `math::Q15`, `math::Q31`), and documentation requirements. Then provide a brief scope summary and use the handoff buttons to route to the appropriate specialist:
Analyze the following task for the **robotics-toolbox** project — a robot-manipulator algorithms library (kinematics, dynamics, trajectories, and manipulator control) targeting resource-constrained embedded systems, consuming shared numerical primitives from numerical-toolbox-cpp via FetchContent. Gather relevant context from the codebase — identify affected modules, existing patterns, the float-only numeric policy, and documentation requirements. Then provide a brief scope summary and use the handoff buttons to route to the appropriate specialist:

- **Plan Implementation**: For complex tasks needing detailed upfront design (new algorithms, architectural changes, multi-file modifications)
- **Execute Directly**: For straightforward changes with a clear path (bug fixes, small improvements)
Expand Down
6 changes: 3 additions & 3 deletions .github/prompts/unit-test.prompt.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
description: "Author metric-driven unit tests for one numerical/ algorithm — TEST_F on float, no heap, StrictMock, reference-value assertions selected per family from TESTING.md."
description: "Author metric-driven unit tests for one robotics/ algorithm — TEST_F on float, no heap, StrictMock, reference-value assertions selected per family from TESTING.md."
agent: "unit-tester"
argument-hint: "Name the numerical/ algorithm to author unit tests for (e.g. Biquad, KalmanFilter, RungeKuttaIntegrators)"
argument-hint: "Name the robotics/ algorithm to author unit tests for (e.g. Biquad, KalmanFilter, RungeKuttaIntegrators)"
model: "Claude Sonnet 5"
---

Author (or extend) the unit tests for the named **robotics-toolbox** algorithm in
`numerical/<domain>/test/Test<Name>.cpp`. Follow the `unit-tester` workflow: read the algorithm's
`robotics/<domain>/test/Test<Name>.cpp`. Follow the `unit-tester` workflow: read the algorithm's
public interface and doc; look up its family in `TESTING.md` and select the metric
types to assert (accuracy, frequency/transient response, stability, boundaries, invariants,
convergence, statistical consistency, conditioning); write one `TEST_F` on `float` per distinct
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,19 @@ The numerical-toolbox dependency is fetched automatically. Includes are namespac
Each category page lists its algorithms with a brief description and links to the detailed
documentation.

### Booklet

The entire documentation set is also published as a single book — read it online as a
[GitHub Pages site](https://embedded-pro.github.io/robotics-toolbox-cpp/) or download the latest
PDF from the [Releases page](../../releases/latest). Both are generated automatically from `doc/`
(cover, Summary/table of contents, one chapter per category, consolidated references, back cover).

Build it locally with [Pandoc](https://pandoc.org) + XeLaTeX installed:

```bash
python scripts/build-booklet.py --format all # writes build/booklet/{RoboticsToolbox.pdf,index.html}
```

## Simulator

The `simulator/` directory contains an interactive Qt-based GUI application (Robot Arm) for
Expand Down
2 changes: 1 addition & 1 deletion TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The library's test strategy: every algorithm is validated against the **mathematical invariants of
its family**, not golden output. This is the reference for the `unit-tester` agent (and humans) when
writing **unit tests** for `numerical/`. It answers one question per algorithm: *which mathematical
writing **unit tests** for `robotics/`. It answers one question per algorithm: *which mathematical
properties must a correct implementation satisfy, and how do we assert them?*

## Rationale
Expand Down
12 changes: 6 additions & 6 deletions roadmap/trajectory/CartesianSlerpInterpolation/implementation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Cartesian Path + Orientation (SLERP) Interpolation — Implementation Pseudocode

> Roadmap ref: #M10 (Tier 2) · Target: `numerical/trajectory` · Namespace `trajectory` · Type: `float` (templated on `T`, instantiated for `float` only)
> Roadmap ref: #M10 (Tier 2) · Target: `robotics/trajectory` · Namespace `trajectory` · Type: `float` (templated on `T`, instantiated for `float` only)

## Data structures

Expand Down Expand Up @@ -71,15 +71,15 @@ function Sample(t): # OPTIMIZE_FOR_SPEED

## Deployment

- Header: `numerical/trajectory/CartesianSlerpInterpolation.hpp` — `#pragma once` →
- Header: `robotics/trajectory/CartesianSlerpInterpolation.hpp` — `#pragma once` →
`#pragma GCC optimize("O3","fast-math")`, `OPTIMIZE_FOR_SPEED` on `Sample`, and
`extern template class CartesianSlerpInterpolation<float>;` under `#ifdef ROBOTICS_TOOLBOX_COVERAGE_BUILD`.
- Coverage: `numerical/trajectory/CartesianSlerpInterpolation.cpp` →
- Coverage: `robotics/trajectory/CartesianSlerpInterpolation.cpp` →
`template class CartesianSlerpInterpolation<float>;`
- Test: `numerical/trajectory/test/TestCartesianSlerpInterpolation.cpp`
- Test: `robotics/trajectory/test/TestCartesianSlerpInterpolation.cpp`
- Doc: `doc/trajectory/CartesianSlerpInterpolation.md` (expand to follow `doc/TEMPLATE.md`)
- CMake: `.hpp` → `target_sources`; `.cpp` → `robotics_add_coverage_sources`;
`TestCartesianSlerpInterpolation.cpp` → the `_test` target.
- New module: create `numerical/trajectory/CMakeLists.txt` via `robotics_add_header_library(...)`,
add a `test/` subdir, register it in `numerical/CMakeLists.txt`, and add a `doc/trajectory/` folder.
- New module: create `robotics/trajectory/CMakeLists.txt` via `robotics_add_header_library(...)`,
add a `test/` subdir, register it in `robotics/CMakeLists.txt`, and add a `doc/trajectory/` folder.
- Generic pattern: see `roadmap/DEPLOYMENT.md`.
12 changes: 6 additions & 6 deletions roadmap/trajectory/PolynomialTrajectory/implementation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Polynomial Point-to-Point Trajectory — Implementation Pseudocode

> Roadmap ref: #M2 (Tier 1) · Target: `numerical/trajectory` · Namespace `trajectory` · Type: `float` (templated on `T`, instantiated for `float` only)
> Roadmap ref: #M2 (Tier 1) · Target: `robotics/trajectory` · Namespace `trajectory` · Type: `float` (templated on `T`, instantiated for `float` only)

## Data structures

Expand Down Expand Up @@ -72,15 +72,15 @@ function Sample(t): # OPTIMIZE_FOR_SPEED

## Deployment

- Header: `numerical/trajectory/PolynomialTrajectory.hpp` — `#pragma once` →
- Header: `robotics/trajectory/PolynomialTrajectory.hpp` — `#pragma once` →
`#pragma GCC optimize("O3","fast-math")`, `OPTIMIZE_FOR_SPEED` on `Sample`, and
`extern template class PolynomialTrajectory<float>;` under `#ifdef ROBOTICS_TOOLBOX_COVERAGE_BUILD`.
- Coverage: `numerical/trajectory/PolynomialTrajectory.cpp` →
- Coverage: `robotics/trajectory/PolynomialTrajectory.cpp` →
`template class PolynomialTrajectory<float>;`
- Test: `numerical/trajectory/test/TestPolynomialTrajectory.cpp`
- Test: `robotics/trajectory/test/TestPolynomialTrajectory.cpp`
- Doc: `doc/trajectory/PolynomialTrajectory.md` (expand to follow `doc/TEMPLATE.md`)
- CMake: `.hpp` → `target_sources`; `.cpp` → `robotics_add_coverage_sources`;
`TestPolynomialTrajectory.cpp` → the `_test` target.
- New module: create `numerical/trajectory/CMakeLists.txt` via `robotics_add_header_library(...)`,
add a `test/` subdir, register it in `numerical/CMakeLists.txt`, and add a `doc/trajectory/` folder.
- New module: create `robotics/trajectory/CMakeLists.txt` via `robotics_add_header_library(...)`,
add a `test/` subdir, register it in `robotics/CMakeLists.txt`, and add a `doc/trajectory/` folder.
- Generic pattern: see `roadmap/README.md` → "Deployment shape".
12 changes: 6 additions & 6 deletions roadmap/trajectory/SCurveProfile/implementation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# S-Curve (Jerk-Limited) Profile — Implementation Pseudocode

> Roadmap ref: #M9 (Tier 2) · Target: `numerical/trajectory` · Namespace `trajectory` · Type: `float` (templated on `T`, instantiated for `float` only)
> Roadmap ref: #M9 (Tier 2) · Target: `robotics/trajectory` · Namespace `trajectory` · Type: `float` (templated on `T`, instantiated for `float` only)

## Data structures

Expand Down Expand Up @@ -78,15 +78,15 @@ function Sample(t): # OPTIMIZE_FOR_SPEED

## Deployment

- Header: `numerical/trajectory/SCurveProfile.hpp` — `#pragma once` →
- Header: `robotics/trajectory/SCurveProfile.hpp` — `#pragma once` →
`#pragma GCC optimize("O3","fast-math")`, `OPTIMIZE_FOR_SPEED` on `Sample`, and
`extern template class SCurveProfile<float>;` under `#ifdef ROBOTICS_TOOLBOX_COVERAGE_BUILD`.
- Coverage: `numerical/trajectory/SCurveProfile.cpp` →
- Coverage: `robotics/trajectory/SCurveProfile.cpp` →
`template class SCurveProfile<float>;`
- Test: `numerical/trajectory/test/TestSCurveProfile.cpp`
- Test: `robotics/trajectory/test/TestSCurveProfile.cpp`
- Doc: `doc/trajectory/SCurveProfile.md` (expand to follow `doc/TEMPLATE.md`)
- CMake: `.hpp` → `target_sources`; `.cpp` → `robotics_add_coverage_sources`;
`TestSCurveProfile.cpp` → the `_test` target.
- New module: create `numerical/trajectory/CMakeLists.txt` via `robotics_add_header_library(...)`,
add a `test/` subdir, register it in `numerical/CMakeLists.txt`, and add a `doc/trajectory/` folder.
- New module: create `robotics/trajectory/CMakeLists.txt` via `robotics_add_header_library(...)`,
add a `test/` subdir, register it in `robotics/CMakeLists.txt`, and add a `doc/trajectory/` folder.
- Generic pattern: see `roadmap/DEPLOYMENT.md`.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Time-Optimal Path Parameterization (TOPP) — Implementation Pseudocode

> Roadmap ref: #M27 (Tier 5) · Target: `numerical/trajectory` · Namespace `trajectory` · Type: `float` (templated on `T`, instantiated for `float` only)
> Roadmap ref: #M27 (Tier 5) · Target: `robotics/trajectory` · Namespace `trajectory` · Type: `float` (templated on `T`, instantiated for `float` only)

## Data structures

Expand Down Expand Up @@ -81,15 +81,15 @@ function Sample(t): # OPTIMIZE_FOR_SPEED

## Deployment

- Header: `numerical/trajectory/TimeOptimalPathParameterization.hpp` — `#pragma once` →
- Header: `robotics/trajectory/TimeOptimalPathParameterization.hpp` — `#pragma once` →
`#pragma GCC optimize("O3","fast-math")`, `OPTIMIZE_FOR_SPEED` on `Sample`, and
`extern template class TimeOptimalPathParameterization<float, N, Grid>;` under `#ifdef ROBOTICS_TOOLBOX_COVERAGE_BUILD`.
- Coverage: `numerical/trajectory/TimeOptimalPathParameterization.cpp` →
- Coverage: `robotics/trajectory/TimeOptimalPathParameterization.cpp` →
`template class TimeOptimalPathParameterization<float, N, Grid>;`
- Test: `numerical/trajectory/test/TestTimeOptimalPathParameterization.cpp`
- Test: `robotics/trajectory/test/TestTimeOptimalPathParameterization.cpp`
- Doc: `doc/trajectory/TimeOptimalPathParameterization.md` (expand to follow `doc/TEMPLATE.md`)
- CMake: `.hpp` → `target_sources`; `.cpp` → `robotics_add_coverage_sources`;
`TestTimeOptimalPathParameterization.cpp` → the `_test` target.
- New module: create `numerical/trajectory/CMakeLists.txt` via `robotics_add_header_library(...)`,
add a `test/` subdir, register it in `numerical/CMakeLists.txt`, and add a `doc/trajectory/` folder.
- New module: create `robotics/trajectory/CMakeLists.txt` via `robotics_add_header_library(...)`,
add a `test/` subdir, register it in `robotics/CMakeLists.txt`, and add a `doc/trajectory/` folder.
- Generic pattern: see `roadmap/DEPLOYMENT.md`.
12 changes: 6 additions & 6 deletions roadmap/trajectory/TrapezoidalProfile/implementation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Trapezoidal (LSPB) Velocity Profile — Implementation Pseudocode

> Roadmap ref: #M3 (Tier 1) · Target: `numerical/trajectory` · Namespace `trajectory` · Type: `float` (templated on `T`, instantiated for `float` only)
> Roadmap ref: #M3 (Tier 1) · Target: `robotics/trajectory` · Namespace `trajectory` · Type: `float` (templated on `T`, instantiated for `float` only)

## Data structures

Expand Down Expand Up @@ -76,15 +76,15 @@ function Sample(t): # OPTIMIZE_FOR_SPEED

## Deployment

- Header: `numerical/trajectory/TrapezoidalProfile.hpp` — `#pragma once` →
- Header: `robotics/trajectory/TrapezoidalProfile.hpp` — `#pragma once` →
`#pragma GCC optimize("O3","fast-math")`, `OPTIMIZE_FOR_SPEED` on `Sample`, and
`extern template class TrapezoidalProfile<float>;` under `#ifdef ROBOTICS_TOOLBOX_COVERAGE_BUILD`.
- Coverage: `numerical/trajectory/TrapezoidalProfile.cpp` →
- Coverage: `robotics/trajectory/TrapezoidalProfile.cpp` →
`template class TrapezoidalProfile<float>;`
- Test: `numerical/trajectory/test/TestTrapezoidalProfile.cpp`
- Test: `robotics/trajectory/test/TestTrapezoidalProfile.cpp`
- Doc: `doc/trajectory/TrapezoidalProfile.md` (expand to follow `doc/TEMPLATE.md`)
- CMake: `.hpp` → `target_sources`; `.cpp` → `robotics_add_coverage_sources`;
`TestTrapezoidalProfile.cpp` → the `_test` target.
- New module: create `numerical/trajectory/CMakeLists.txt` via `robotics_add_header_library(...)`,
add a `test/` subdir, register it in `numerical/CMakeLists.txt`, and add a `doc/trajectory/` folder.
- New module: create `robotics/trajectory/CMakeLists.txt` via `robotics_add_header_library(...)`,
add a `test/` subdir, register it in `robotics/CMakeLists.txt`, and add a `doc/trajectory/` folder.
- Generic pattern: see `roadmap/README.md` → "Deployment shape".
2 changes: 1 addition & 1 deletion scripts/booklet/back-cover.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
\thispagestyle{empty}
\vspace*{\fill}
\begin{center}
{\Large\bfseries\color{RoyalBlue} Numerical Toolbox}\\[0.5em]
{\Large\bfseries\color{RoyalBlue} Robotics Toolbox}\\[0.5em]
{\itshape Embedded-first. Float-only. No heap.}\\[2em]
Generated from the project \texttt{doc/} tree with Pandoc.\\
Source, roadmap, and contribution guide at the project repository.
Expand Down
Loading
Loading