Skip to content

feat(trajectory): add TimeOptimalPathParameterization (M27) - #42

Merged
gabrielfrasantos merged 1 commit into
mainfrom
claude/determined-einstein-bznlpi
Nov 6, 2026
Merged

gabrielfrasantos merged 1 commit into
mainfrom
claude/determined-einstein-bznlpi

Conversation

@gabrielfrasantos

Copy link
Copy Markdown
Contributor

Implements roadmap item M27 from roadmap/trajectory/TimeOptimalPathParameterization: TOPP-RA (Pham and Pham, IEEE T-RO 34(3), 2018). This was the last roadmap spec, so roadmap/ now holds no pending specs.

What

robotics/trajectory/TimeOptimalPathParameterization.hpp contains:

  • PathGeometry<T, Dof>: an interface for the fixed path q(s), q'(s) and q''(s) on s ∈ [0, 1].
  • PathCoefficients, JointBounds and PathConstraints<T, Dof>: the interface for the torque coefficients τ = a·s̈ + b·ṡ² + c and the joint bounds.
  • InverseDynamicsPathConstraints<T, Dof>: the production adapter. It builds a, b and c from any dynamics::InverseDynamicsModel (M29) with three passes per point.
  • TimeOptimalPathParameterization<T, Dof, Grid>:
    • Parameterize(): a backward pass builds the controllable sets with exact Fourier–Motzkin projections of each stage polygon, with no iterative LP. A greedy forward pass then takes the largest control that stays inside them. It returns false if a set is empty, if 0 ∉ K₀, or if the profile cannot leave rest.
    • Sample(t): binary search over the stage start times, then the constant-s̈ stage kinematics mapped through the path. It returns std::nullopt until Parameterize() succeeds.
    • TotalTime().

There is no heap, no recursion, no exceptions, and every buffer has a compile-time size.

New test doubles in robotics/trajectory/test_doubles (robotics.trajectory_test_doubles): MockPathGeometry and MockPathConstraints. robotics.trajectory now links robotics.dynamics.

Deviations from the spec

  • Interface name: the spec's JointLimits interface is called PathConstraints, and its adapter InverseDynamicsPathConstraints. This keeps them distinct from M1's dynamics::JointLimits<T>.
  • Two extra tests: the spec's cases miss two failure branches.
    • stationary_joint_overload_empties_controllable_set covers an empty controllable set.
    • zero_velocity_bound_stalls_at_rest covers a profile that cannot leave rest.
  • Extra assertion: the adapter test also reads Bounds().
  • Stage-start times in the continuity test: the planner keeps them private, so the test finds each interior one by bisecting on the sampled position.
  • Tolerance ε: a fixed 64·numeric_limits<T>::epsilon() instead of a per-row relative scale.
  • Roadmap: the manipulator table and the roadmap/README.md index now say every item has shipped. The canonical-example sentence points to the shipped doc, and its spec stays in the git history.

Verification

  • host-single-Debug and coverage builds: ctest 7/7, 12/12 TOPP tests.
  • 100% merged line coverage on the header (126/126).
  • The spec's reference values reproduce in float:
    • Bang-bang totals: 2.000064 and 4.000128.
    • Velocity-limited total: 2.063492.
    • Coupled two-joint total: 2.256496, with a 0.0178 torque excursion between gridpoints.
  • Clang -Wall -Wextra -Werror -Wshadow with -DROBOTICS_TOOLBOX_COVERAGE_BUILD.
  • clang-format --dry-run --Werror and the forbidden-pattern check.
  • scripts/validate-docs.py passes, and no doc line exceeds 400 characters.
  • Not run locally: MSVC, cppcheck, SonarCloud.

Generated by Claude Code

TOPP-RA: minimum-time timing law along a fixed joint path under torque
and velocity limits. Path coefficients come from an inverse-dynamics
adapter (three passes per gridpoint); a backward pass builds the
controllable sets with exact Fourier-Motzkin projections of each stage
polygon, and a greedy forward pass picks the largest admissible control
inside them. Stage times are exact for constant path acceleration, and
Sample streams the joint state by binary search over stage start times.

The spec's JointLimits interface is named PathConstraints to stay
distinct from dynamics::JointLimits<T>. This was the last roadmap spec.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014WUWh44uw7k4JjMd6YkAwN
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

✅⚠️MegaLinter analysis: Success with warnings

Descriptor Linter Files Fixed Errors Max errors Warnings Elapsed time
✅ ACTION actionlint 7 0 0 0.69s
✅ CPP clang-format 212 0 0 0 2.36s
✅ CPP cppcheck 212 0 0 4.56s
✅ DOCKERFILE hadolint 1 0 0 0.64s
✅ JSON jsonlint 8 0 0 0.08s
✅ JSON prettier 8 2 0 0 0.39s
✅ MARKDOWN markdownlint 84 0 0 0 2.33s
✅ MARKDOWN markdown-table-formatter 84 0 0 0 0.26s
⚠️ SPELL lychee 132 2 0 2.26s
✅ YAML prettier 12 0 0 0 0.54s
✅ YAML yamllint 12 0 0 0.56s

Detailed Issues

⚠️ SPELL / lychee - 2 errors
[ERROR] failed to verify TLS certificate: invalid peer certificate: UnknownIssuer
📝 Summary
---------------------
🔍 Total..........379
🔗 Unique.........129
✅ Successful.....367
⏳ Timeouts.........0
🔀 Redirected.......5
👻 Excluded.........9
❓ Unknown..........0
🚫 Errors...........2
⛔ Unsupported......2

Errors in .github/workflows/static-analysis.yml
[403] https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$ (at 37:21) | Rejected status code: 403 Forbidden

Errors in doc/kinematics/InverseKinematics.md
[ERROR] https://mathweb.ucsd.edu/~sbuss/ResearchWeb/ikmethods/iksurvey.pdf (at 125:169) | SSL certificate not trusted. Use --insecure if site is trusted

Hint: Followed 5 redirects. You might want to consider replacing redirecting URLs with the resolved URLs. Use verbose mode (`-v`/`-vv`) to see redirection details.
Hint: You can configure accepted/rejected response codes with `-a` or `--accept`

Notices

⚠️ Your configuration references items that have been removed from MegaLinter and are ignored: REPOSITORY_GITLEAKS, REPOSITORY_KICS. See Removed linters to find their replacements.

See detailed reports in MegaLinter artifacts

Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)

  • Documentation: Custom Flavors
  • Command: npx mega-linter-runner@10.1.0 --custom-flavor-setup --custom-flavor-linters ACTION_ACTIONLINT,CPP_CPPCHECK,CPP_CLANG_FORMAT,DOCKERFILE_HADOLINT,JSON_JSONLINT,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,SPELL_LYCHEE,YAML_PRETTIER,YAML_YAMLLINT

MegaLinter is provided by OX Security
Show us your support by starring ⭐ the repository

@sonarqubecloud

sonarqubecloud Bot commented Nov 6, 2026

Copy link
Copy Markdown

@gabrielfrasantos
gabrielfrasantos merged commit 6161423 into main Nov 6, 2026
12 of 14 checks passed
@gabrielfrasantos
gabrielfrasantos deleted the claude/determined-einstein-bznlpi branch November 6, 2026 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants