# robotics-lab

A rosbag or a CAN trace goes in. Rates, latency and jitter come out. Two paper methods run in simulation.

[Robotics](https://modelshifts.com/work/) · 12 November 2026 · v1 · Python · [MIT](https://opensource.org/license/mit) · [CI](https://github.com/ModelShifts/robotics-lab/actions/workflows/ci.yml)

## The problem

Imagine a joint loop on the bench: a sensor, a controller, a plant. You want the topic rate, the end-to-end latency, the jitter, and the same measurements on the CAN traces that travel with it — and, next to those, a chance to run the paper methods you are reading, from the published equations, in simulation.

The useful result is a report you can check against the bag, plus two paper methods — discrete dynamic movement primitives and iterative LQR — that run from those equations.

## What we built

Three tools, and no language model. A rosbag2 (mcap) of a node graph is analysed for topic rates, inter-arrival jitter and end-to-end latency, matched on header.stamp. Reading the bag does not need a ROS 2 install. A CAN trace is decoded with a DBC and scored the same way. Discrete DMPs (Ijspeert et al., 2013) and iterative LQR (Li and Todorov, 2004) run in simulation. You get the report and the paper figures.

![Pipeline: a rosbag2 or a CAN trace is analysed for rate, latency and jitter; discrete DMPs and iterative LQR run in simulation from the published equations; the result is a report and plots. There is no language-model backend.](https://modelshifts.com/media/work/robotics-lab/pipeline.svg)

There is no language-model backend. Nothing in this repository calls an API or downloads a model.

![Left: the ROS bag report on the node graph — topic rates at 100 Hz, feedback stamp latency 5.000 ms. Right: iLQR on a pendulum in simulation, cost decreasing over six steps.](https://modelshifts.com/media/work/robotics-lab/before-after.webp)

Rosbag2 and iLQR on a pendulum. 24/24 checks passed. scripts/evaluate.py.

A latency number without the bag it came from is a rumour. A report matched on header.stamp, next to the same measurements on the CAN trace, is a claim you can check — and the paper figures are a chance to run the equations, not only to look at a plot from the PDF.

## Results

On the rosbag, the CAN trace, and the two paper methods in simulation, scripts/evaluate.py passed 24 of 24 checks against the generator settings: 12 ROS, 5 CAN, 4 DMP and 3 iLQR.

| Group | Passed | Highlights (measured) |
| --- | --- | --- |
| ROS bag (12) | 12/12 | Topic rates 100.007–100.009 Hz (expected 100.0 ± 0.02). Stamp latencies 0, 2.000000 and 5.000000 ms. Edges 2.000000, 3.000000 and 5.000000 ms (n=200). |
| CAN (5) | 5/5 | 600 frames, unknown 0. Bus load 0.081199 (expected about 0.081). Edges 2.000000, 3.000000 and 5.000000 ms. |
| DMP (4) | 4/4 | Reproduction RMSE 0.01072, goal error 0.000316, shape RMSE at a new goal 0.01072, time-scale ratio 2.0027. |
| iLQR (3) | 3/3 | Cost 1.382×10⁴ → 1072 in 6 steps, monotone. Pendulum goal error 1.35×10⁻⁷. Riccati relative cost gap 1.16×10⁻¹⁶ on the double integrator. |
| **All** | **24/24** |  |

**Methodology.** The thresholds are the generator settings (or a bound around them). The rosbag is a pure-Python simulation of a joint sensor, a controller and a plant; the CAN trace is decoded with the committed DBC. DMP follows Ijspeert et al., Neural Computation, 2013, on a minimum-jerk path plus a negative Gaussian bump. iLQR follows Li and Todorov, ICINCO 2004, on one pendulum. python scripts/evaluate.py, 12 November 2026. The raw table is in [docs/eval.md](https://github.com/ModelShifts/robotics-lab/blob/main/docs/eval.md). The script is [scripts/evaluate.py](https://github.com/ModelShifts/robotics-lab/blob/main/scripts/evaluate.py); the samples are in [samples/](https://github.com/ModelShifts/robotics-lab/tree/main/samples).

The full 24-row table is in docs/eval.md.

## Run it yourself

```bash
git clone https://github.com/ModelShifts/robotics-lab
cd robotics-lab && python -m venv .venv && source .venv/bin/activate
pip install -e ".[demo]" && robotics-lab serve
```

There is no language-model backend and nothing to download from Hugging Face. Python 3.11 or newer.

[View the code on GitHub](https://github.com/ModelShifts/robotics-lab)

[Work](https://modelshifts.com/work/) · [Home](https://modelshifts.com/)
