Repository navigation
Commit 66b81e6
feat: add angle utilities, tridiagonal solver, friction compensation, symplectic integrators and motion profiles (#355)
* feat(math): add angle utilities (wrap, shortest difference, unwrap)
Deploy roadmap item 54. WrapToPi maps into (−π, π] (both ±π → +π),
WrapToTwoPi into [0, 2π) with a guard so rounding never returns 2π,
AngleDifference takes the short way round and UnwrapAngle turns a
wrapped measurement into a continuous signal.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q53m7MZDmHwocmKbhhd2o5
* refactor(filters): use math::WrapToPi in ComplementaryFilter
Replace the private heading wrap with the shared angle utilities. The
result changes only at exactly ±π: the estimate is now reported in
(−π, π], so −π maps to +π, matching the library-wide convention.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q53m7MZDmHwocmKbhhd2o5
* feat(math): add tridiagonal (Thomas) solver
Deploy roadmap item 59: O(n) factor-once / solve-many solver for
tridiagonal systems. Factor stores reciprocal pivots so Solve has no
division, and reports a pivot with |p| <= eps * scale (or a size outside
[1, MaxSize]) as failure instead of dividing by it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q53m7MZDmHwocmKbhhd2o5
* feat(controllers): add friction compensation feedforward
Deploy roadmap item 57: per-axis Coulomb + viscous + Stribeck friction
model, smoothed through zero velocity with tanh(v/eps) and clamped to
maxCompensation, to be added to a torque or current command.
The spec's "torque ≈ F_s near zero velocity" check is asserted against
the model's exact value at v = 10·eps (0.788237): the Stribeck term has
already decayed by e^-0.04 there.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q53m7MZDmHwocmKbhhd2o5
* feat(solvers): add symplectic integrators for second-order systems
Deploy roadmap item 58: semi-implicit Euler and velocity Verlet
(kick-drift-kick) over a new SecondOrderSystem interface. For a
conservative plant the energy error stays bounded instead of drifting.
The second-order check compares h = 0.1 with h = 0.05 rather than the
spec's unspecified small step: at h = 0.01 float32 rounding already
dominates the truncation error and the error ratio reads ≈ 5, not 4.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q53m7MZDmHwocmKbhhd2o5
* docs: align markdown tables
Apply markdown-table-formatter's layout to the tables this tier adds
or edits, as suggested by MegaLinter.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q53m7MZDmHwocmKbhhd2o5
* feat(motion_profiles): add polynomial, trapezoidal and S-curve profiles (#356)
* feat(motion_profiles): add module with polynomial point-to-point profile
Deploy roadmap item 55 and create the motion_profiles module with the
shared TrajectoryState / MotionLimits types. PolynomialProfile solves
the closed-form cubic (position + velocity) or quintic (+ acceleration)
coefficients once and samples position, velocity, acceleration and
jerk by Horner evaluation, with time clamped to [0, tf].
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q53m7MZDmHwocmKbhhd2o5
* feat(motion_profiles): add trapezoidal (LSPB) velocity profile
Deploy roadmap item 56: minimum-time trapezoid / triangle plan from
(vMax, aMax), plus PlanWithDuration, which keeps aMax and lowers the
cruise speed so several axes can finish together. The cruise speed uses
the cancellation-free conjugate form of the smaller root, and
infeasible durations return nullopt. At and after tf the profile holds
the goal at rest; before t = 0 it holds the start.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q53m7MZDmHwocmKbhhd2o5
* feat(motion_profiles): add S-curve (jerk-limited) profile
Deploy roadmap item 60: seven-phase rest-to-rest profile planned with
the closed-form three-step method of Biagiotti & Melchiorri §3.4 (vMax
reached; else aMax reached; else neither). The boundary states are
integrated once, and each sample evaluates one constant-jerk cubic.
Add math::Cbrt (generic wrapper, no ARM override), which the step-3
branch needs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q53m7MZDmHwocmKbhhd2o5
* docs: align markdown tables
Apply markdown-table-formatter's layout to the tables this tier adds
or edits, as suggested by MegaLinter.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q53m7MZDmHwocmKbhhd2o5
* fix(build): build motion_profiles tests in the QEMU presets
The qemu-cortex-m4/m7 build presets list their test targets
explicitly, so numerical.motion_profiles_test was registered with
CTest but never built, and the QEMU jobs failed with "Could not load
kernel".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q53m7MZDmHwocmKbhhd2o5
---------
Co-authored-by: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent c181cd1 commit 66b81e6
74 files changed
Lines changed: 2445 additions & 1455 deletions
File tree
- doc
- controllers
- filters/active
- math
- motion_profiles
- solvers
- numerical
- controllers/implementations
- test
- filters/active
- math
- test
- motion_profiles
- test
- solvers
- test
- roadmap
- controllers/FrictionCompensation
- math
- AngleUtilities
- TridiagonalSolver
- motion_profiles
- PolynomialProfile
- SCurveProfile
- TrapezoidalProfile
- solvers/SymplecticIntegrators
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
| |||
164 | 165 | | |
165 | 166 | | |
166 | 167 | | |
| 168 | + | |
167 | 169 | | |
168 | 170 | | |
169 | 171 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
23 | 23 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | 29 | | |
36 | | - | |
37 | 30 | | |
38 | 31 | | |
39 | 32 | | |
| |||
58 | 51 | | |
59 | 52 | | |
60 | 53 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | 54 | | |
116 | 55 | | |
117 | 56 | | |
| |||
126 | 65 | | |
127 | 66 | | |
128 | 67 | | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | 68 | | |
137 | 69 | | |
138 | 70 | | |
| |||
0 commit comments