Skip to content

Commit a3ebb6f

Browse files
feat: wave 6 roadmap items (M26, M21, M20, M18, M19, P6, M23, M25, P5) (#37)
* feat(kinematics): add ContinuumKinematics (M26) Piecewise constant-curvature arcs: a singularity-free section transform (series below |theta| = 1e-2), multi-section forward kinematics by SE(3) composition and the closed-form single-section inverse. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WUWh44uw7k4JjMd6YkAwN * feat(kinematics): add AnalyticalIkOpw (M21) Closed-form OPW inverse kinematics for ortho-parallel 6R arms with a spherical wrist: all eight shoulder/elbow/wrist configurations in eight fixed slots, wrist-singular handling and closed-form forward kinematics. sin(theta5) is taken from the wrist matrix's third column so the singular branch triggers only at rounding level in single precision. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WUWh44uw7k4JjMd6YkAwN * feat(controllers): add SlotineLiAdaptiveControl (M20) Passivity-based adaptive tracking: sliding variable and reference motion, regressor feedforward with sliding-variable damping, and the -Gamma Y^T s parameter update. Adds the MockInertialRegressor test double. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WUWh44uw7k4JjMd6YkAwN * feat(controllers): add OperationalSpaceControl (M18) Task-space control through the task inertia (optionally damped near singularities), full joint-space Coriolis/gravity compensation and a dynamically consistent null-space projector for secondary torques. The roadmap canonical example now points at PurePursuit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WUWh44uw7k4JjMd6YkAwN * feat(controllers): add HybridPositionForceControl (M19) Constraint-frame selection between a motion PD and a damped force PI with element-wise anti-windup, mapped through J^T with gravity and Coriolis compensation. The selection matrix is checked to be diagonal 0/1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WUWh44uw7k4JjMd6YkAwN * feat(planning): add RrtConnect (P6) Bidirectional RRT-Connect in joint space with fixed node pools, an injected sampler and validity test, discrete edge checking and random shortcutting. Coverage instantiations match the test sizes and the function-reference callables the tests pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WUWh44uw7k4JjMd6YkAwN * feat(kinematics): add Stewart-Gough and Delta parallel kinematics (M23) StewartGoughKinematics: closed-form leg lengths, the leg Jacobian and Newton/Levenberg-Marquardt forward kinematics on SE(3) through the upstream solver. DeltaKinematics: closed-form per-arm inverse and three-sphere forward kinematics. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WUWh44uw7k4JjMd6YkAwN * feat(controllers): add CableTensionDistribution (M25) Structure matrix from cable geometry, Pott's improved closed-form tension distribution within [tMin, tMax] with worst-cable clamping, and an exact least-distance QP through the upstream active-set solver for wrenches near the workspace boundary. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WUWh44uw7k4JjMd6YkAwN * feat(planning): add ConvexCollision GJK and EPA (P5) Support-function distance between spheres, capsules, oriented boxes and convex hulls: GJK on the shape cores with radii as margins, Johnson's sub-algorithm by enumeration, and a bounded EPA with centroid-oriented faces and coplanar-visible removal for penetration depth and normal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WUWh44uw7k4JjMd6YkAwN * refactor: address SonarCloud findings on wave 6 - CableTensionDistribution: split Distribute into SolveFree and WorstViolation (cognitive complexity). - ConvexCollision: extract ToggleHorizonEdge and AppendIfIndependent; loop conditions only test their counters (complexity, nesting, loop-invariant conditions). - RrtConnect: invoke the forwarded callable directly in Shortcut. - DeltaKinematics: azimuth tables as in-class static constexpr arrays. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WUWh44uw7k4JjMd6YkAwN --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 0685e5c commit a3ebb6f

80 files changed

Lines changed: 4704 additions & 2098 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎README.md‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ project already defines those targets. Includes are namespaced by domain, e.g.
3535

3636
## Documentation
3737

38-
| Category | Description |
39-
|--------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
40-
| [Kinematics](doc/kinematics/README.md) | Forward Kinematics, Chain Pose Kinematics, Denavit-Hartenberg Parameters, Geometric Jacobian, Manipulability Index, Product of Exponentials, Redundancy Resolution, Inverse Kinematics (Damped Least Squares), Pose Inverse Kinematics |
41-
| [Dynamics](doc/dynamics/README.md) | Euler-Lagrange, Newton-Euler, Recursive Newton-Euler (RNEA), Articulated Body Algorithm (ABA), Chain Dynamics Model, Composite Rigid Body Algorithm (CRBA), Coriolis Matrix and Inertial Regressor, Dynamic Parameter Identification, Forward-Dynamics Integration, Generic Joint Link, Generalized-Momentum Observer |
42-
| [Planning](doc/planning/README.md) | Primitive Distance Queries, Artificial Potential Fields, Self-Collision Checking, Grid Search (A* and Dijkstra) |
43-
| [Trajectory](doc/trajectory/README.md) | Cubic Spline Trajectory, Cartesian Path with SLERP Orientation |
44-
| [Manipulator Control](doc/controllers/manipulator/README.md) | PD Control with Gravity Compensation, Computed-Torque Control, Impedance Control |
38+
| Category | Description |
39+
|--------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
40+
| [Kinematics](doc/kinematics/README.md) | Forward Kinematics, Chain Pose Kinematics, Denavit-Hartenberg Parameters, Geometric Jacobian, Manipulability Index, Product of Exponentials, Redundancy Resolution, Inverse Kinematics (Damped Least Squares), Pose Inverse Kinematics, Analytical Inverse Kinematics (OPW), Continuum Kinematics, Parallel Manipulator Kinematics |
41+
| [Dynamics](doc/dynamics/README.md) | Euler-Lagrange, Newton-Euler, Recursive Newton-Euler (RNEA), Articulated Body Algorithm (ABA), Chain Dynamics Model, Composite Rigid Body Algorithm (CRBA), Coriolis Matrix and Inertial Regressor, Dynamic Parameter Identification, Forward-Dynamics Integration, Generic Joint Link, Generalized-Momentum Observer |
42+
| [Planning](doc/planning/README.md) | Primitive Distance Queries, Artificial Potential Fields, Self-Collision Checking, Convex Collision (GJK and EPA), Grid Search (A* and Dijkstra), RRT-Connect |
43+
| [Trajectory](doc/trajectory/README.md) | Cubic Spline Trajectory, Cartesian Path with SLERP Orientation |
44+
| [Manipulator Control](doc/controllers/manipulator/README.md) | PD Control with Gravity Compensation, Computed-Torque Control, Impedance Control, Operational-Space Control, Hybrid Position/Force Control, Slotine–Li Adaptive Control, Cable Tension Distribution |
4545

4646
Each category page lists its algorithms with a brief description and links to the detailed
4747
documentation.

‎ROADMAP.md‎

Lines changed: 6 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -117,17 +117,10 @@ existing `dynamics/` convention.
117117

118118
### Manipulator list (by priority)
119119

120-
| # | Component | Target module | Depends on | Difficulty |
121-
|-----|-----------------------------------------------------------------|---------------------------|-------------|------------|
122-
| M18 | Operational-space (task-space) control | `controllers/manipulator` | M8, M29 | ★★★★☆ |
123-
| M19 | Hybrid position/force control | `controllers/manipulator` | M8, M29 | ★★★★☆ |
124-
| M20 | Passivity-based adaptive control (Slotine-Li) | `controllers/manipulator` | M31 | ★★★★☆ |
125-
| M21 | Analytical IK for ortho-parallel 6R arms with a spherical wrist | `kinematics` | NT53, NT54 | ★★★★☆ |
126-
| M23 | Parallel-manipulator kinematics (Stewart-Gough, Delta) | `kinematics` | NT53, NT64 | ★★★★☆ |
127-
| M24 | Mobile-manipulator / nonholonomic-base kinematics | `kinematics` | M8, M14, W1 | ★★★★☆ |
128-
| M25 | Cable-driven tension distribution | `controllers/manipulator` | NT53, NT65 | ★★★★☆ |
129-
| M26 | Continuum / soft constant-curvature kinematics | `kinematics` | NT53 | ★★★★☆ |
130-
| M27 | Time-optimal path parameterization (TOPP-RA) | `trajectory` (new) | M29 | ★★★★★ |
120+
| # | Component | Target module | Depends on | Difficulty |
121+
|-----|---------------------------------------------------|--------------------|-------------|------------|
122+
| M24 | Mobile-manipulator / nonholonomic-base kinematics | `kinematics` | M8, M14, W1 | ★★★★☆ |
123+
| M27 | Time-optimal path parameterization (TOPP-RA) | `trajectory` (new) | M29 | ★★★★★ |
131124

132125
M2 (polynomial profile), M3 (trapezoidal profile), M4 (friction compensation), M6 (SE(3)) and M9
133126
(S-curve profile) moved to numerical-toolbox as NT55, NT56, NT57, NT53 and NT60; their numbers are
@@ -139,34 +132,10 @@ retired here.
139132

140133
### Tier 4 — Advanced ★★★★☆
141134

142-
**M18. Operational-space control.** Task-space inertia `Λ = (J M⁻¹ Jᵀ)⁻¹`, `J̇q̇` compensation, full joint-space gravity/Coriolis compensation and a dynamically-consistent null space.
143-
- *Algorithm / paper:* O. Khatib, *IEEE J. Robotics and Automation*, 3(1), 1987.
144-
145-
**M19. Hybrid position/force control.** Selection matrix in a constraint frame, PI force loop with anti-windup and damping, motion PD.
146-
- *Algorithm / paper:* M. Raibert, J. Craig, 1981; An & Hollerbach, 1987.
147-
148-
**M20. Passivity-based adaptive control (Slotine-Li).** Tracks trajectories while estimating inertial parameters on-line through the regressor `Y(q,q̇,q̇r,q̈r)`.
149-
- *Algorithm / paper:* J.-J. Slotine, W. Li, *Int. J. Robotics Research*, 6(3), 1987.
150-
151-
**M21. Analytical IK for ortho-parallel 6R arms with a spherical wrist (OPW).** Closed-form, all eight solutions, covering shoulder, lateral and elbow offsets of common industrial arms.
152-
- *Algorithm / paper:* M. Brandstötter, A. Angerer, M. Hofbaur, Austrian Robotics Workshop, 2014; D. Pieper, PhD thesis, Stanford, 1968.
153-
- *Reuses / builds on:* NT53; joint wrapping from NT54.
154-
155-
**M23. Parallel-manipulator kinematics.** Stewart-Gough (leg-length IK, Newton FK) and Delta (per-arm closed-form IK, three-sphere FK).
156-
- *Algorithm / paper:* J.-P. Merlet, *Parallel Robots*, 2nd ed. (2006); R. Clavel (1990).
157-
- *Reuses / builds on:* NT53 retraction; the Stewart Newton FK runs on upstream `LevenbergMarquardt` (NT64).
158-
159135
**M24. Mobile-manipulator / nonholonomic-base kinematics.** Combined base + arm Jacobian in the world frame with differential-drive constraints.
160136
- *Algorithm / paper:* Y. Yamamoto, X. Yun, *IEEE Trans. Automatic Control*, 39(6), 1994.
161137
- *Reuses / builds on:* the W1 differential-drive model for the base.
162138

163-
**M25. Cable-driven tension distribution.** Structure matrix from cable geometry, Pott's closed-form (improved) tension distribution within `[tMin, tMax]`, and an exact QP path for the workspace boundary.
164-
- *Algorithm / paper:* Pott, Bruckmann, Mikelsons (2009); A. Pott (2014).
165-
- *Reuses / builds on:* upstream `solvers::ActiveSetQp` (NT65) for the exact path.
166-
167-
**M26. Continuum / soft constant-curvature kinematics.** Piecewise-constant-curvature FK and single-section IK.
168-
- *Algorithm / paper:* R. Webster, B. Jones, *Int. J. Robotics Research*, 29(13), 2010.
169-
170139
### Tier 5 — Hard / research-grade ★★★★★
171140

172141
**M27. Time-optimal path parameterization (TOPP-RA).** Minimum-time traversal of a fixed path under joint velocity and torque limits via reachability analysis (two-variable LPs per grid stage, solved locally by Fourier–Motzkin elimination).
@@ -375,17 +344,8 @@ Cross-family building blocks that several of the families below depend on.
375344

376345
## Motion planning and collision
377346

378-
| # | Component | Target module | Depends on | Difficulty |
379-
|----|---------------------------------------------------|---------------|------------|------------|
380-
| P5 | GJK + EPA convex distance and penetration | `planning` | — | ★★★★☆ |
381-
| P6 | RRT-Connect in joint space with a fixed node pool | `planning` | P4 | ★★★★☆ |
382-
383-
**P5. GJK + EPA.** Distance between convex shapes (sphere, capsule, box, bounded hull) from support functions, run on cores plus margins; penetration depth and normal by a bounded EPA, robust to tied supports.
384-
- *Algorithm / paper:* E. Gilbert, D. Johnson, S. Keerthi, *IEEE J. Robotics and Automation*, 4(2), 1988; G. van den Bergen, *Collision Detection in Interactive 3D Environments* (2003).
385-
386-
**P6. RRT-Connect.** Bidirectional rapidly-exploring random trees in joint space with compile-time node pools, an injected sampler and validity test, and random shortcutting.
387-
- *Algorithm / paper:* J. Kuffner, S. LaValle, *ICRA* 2000.
388-
- *Reuses / builds on:* P4 (and P1/P5) as the validity test, supplied by the caller.
347+
| # | Component | Target module | Depends on | Difficulty |
348+
|---|-----------|---------------|------------|------------|
389349

390350
## Localization and mapping
391351

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Cable Tension Distribution
2+
3+
## Overview & Motivation
4+
5+
**Cable-driven parallel robots** move a platform with several cables wound on winches: stadium cameras, large-scale 3D printers, rehabilitation devices and wind-tunnel model supports. They reach huge workspaces with tiny moving mass. The catch is that cables can only **pull**. A tension that would have to be negative means the cable goes slack and control is lost.
6+
7+
With more cables than platform degrees of freedom, infinitely many tension sets produce the same platform wrench. The controller must pick one that stays within $[t_{\min}, t_{\max}]$ (taut, but below the winch limit) at every control cycle, deterministically and quickly.
8+
This module computes the structure matrix from the cable geometry, distributes tensions with Pott's closed-form method and its improved variant, and provides an exact quadratic-programming path for the boundary of the workspace.
9+
10+
## Mathematical Theory
11+
12+
### Structure Matrix
13+
14+
For base anchors $a_i$ (world frame), platform anchors $b_i$ (platform frame) and platform pose $(R, p)$, cable $i$ pulls the platform along the unit vector
15+
16+
$$u_i = \frac{a_i - p - R\,b_i}{\|a_i - p - R\,b_i\|}$$
17+
18+
and the cables balance the required platform wrench $w$ when
19+
20+
$$A\,t = w, \qquad A = \begin{bmatrix} u_1 & \cdots & u_m \\ R b_1 \times u_1 & \cdots & R b_m \times u_m \end{bmatrix}$$
21+
22+
For point-mass platforms only the force rows are kept, and the platform anchors are ignored.
23+
24+
### Closed-Form Distribution
25+
26+
With the mid tension $t_m = (t_{\min} + t_{\max})/2$, the tension vector closest to $t_m\mathbf{1}$ that balances $w$ is
27+
28+
$$t = t_m\mathbf{1} + A^T(AA^T)^{-1}(w - A\,t_m\mathbf{1})$$
29+
30+
It keeps every cable as far from slack and from overload as the wrench allows (Pott, Bruckmann and Mikelsons, 2009). With exactly as many cables as wrench dimensions, it reduces to the unique $A^{-1}w$.
31+
32+
### Improved Closed Form
33+
34+
When some tension leaves its bounds, the worst-violating cable is clamped to its bound, its contribution moves to the wrench side, and the reduced system is solved again (Pott, 2014). This repeats at most $m - n + 1$ times. If fewer than $n$ free cables remain, the wrench is declared infeasible for this method.
35+
36+
### Exact Distribution
37+
38+
Close to the boundary of the wrench-feasible workspace, the improved closed form can fail although a solution exists. The exact path solves the strictly convex quadratic program
39+
40+
$$\min_t \tfrac12\|t - t_m\mathbf{1}\|^2 \quad \text{s.t.} \quad A\,t = w, \quad t_{\min} \le t \le t_{\max}$$
41+
42+
with a dual active-set method. No result means the wrench is truly outside the feasible set.
43+
44+
## Complexity Analysis
45+
46+
| Method | Time | Space | Notes |
47+
|----------------------|-------------------------------|---------------|---------------------------------------------------------|
48+
| Structure matrix | $O(mn)$ | $O(mn)$ | One unit vector and cross product per cable |
49+
| Improved closed form | $O((m - n + 1)(n^2 m + n^3))$ | $O(mn + n^2)$ | At most $m - n + 1$ passes, one $n \times n$ solve each |
50+
| Exact QP | $O(k \cdot m^3)$ | $O(m^2)$ | Active-set iterations $k$, bounded by the solver's cap |
51+
52+
## Step-by-Step Walkthrough
53+
54+
A planar point mass hangs from three cables anchored $120°$ apart at radius 2, with $t_{\min} = 10$ and $t_{\max} = 200$, so $t_m = 105$. The cable directions are $(0, 1)$ and $(\mp 0.866, -0.5)$.
55+
56+
1. **No wrench**: the three tensions are the pretension $(105, 105, 105)$, which already balances because the directions sum to zero.
57+
2. **Upward wrench** $(0, 60)$: $t = (145, 85, 85)$, the balancing set closest to $t_m\mathbf{1}$.
58+
3. **Upper bound** $(0, 150)$: the plain closed form asks for $205$ on the top cable. Clamping it at $200$ and re-solving the two lower cables gives $(200, 50, 50)$, which is also the exact optimum.
59+
4. **Lower bound** $(0, -150)$: the top cable would go slack at $5$. It is clamped to $10$, and the others carry $160$ each.
60+
5. **Infeasible** $(0, 300)$: even at $200$ on the top cable, the lower cables would need negative tension, so no distribution exists.
61+
6. **Spatial boundary case**: on an eight-cable crossed platform, a wrench near the workspace boundary defeats the improved closed form. The exact QP finds tensions with cable 0 at $t_{\max}$ and cable 3 at $t_{\min}$.
62+
63+
## Pitfalls & Edge Cases
64+
65+
- **Slack cables**: $t_{\min}$ must be positive. A slack cable leaves the platform under-constrained and lets it swing.
66+
- **Degenerate geometry**: collinear or coincident cables make $AA^T$ singular. The distribution then reports no solution rather than infinite tensions.
67+
- **Zero-length cables**: a platform anchor on its base anchor has no direction and is rejected.
68+
- **Wrench reference point**: the wrench is about the platform origin in the world frame. Include gravity as $-m g$ plus the dynamic wrench from the motion controller.
69+
- **Boundary behaviour**: call the exact path only when the closed form fails, since it is slower and its cost varies.
70+
- **Cable sag and elasticity**: the massless straight-line model ignores sagging long cables. Use catenary models for large installations.
71+
72+
## Variants & Generalizations
73+
74+
- **Puncture and barycentric methods**: alternative closed-form choices inside the feasible polytope.
75+
- **Linear-programming distributions**: minimum-norm or minimum-maximum tensions for energy or safety criteria.
76+
- **Stiffness-optimal tensions**: tension choices that maximize platform stiffness.
77+
- **Dynamic workspace analysis**: wrench-feasible workspace computation from the same structure matrix.
78+
79+
## Applications
80+
81+
- Large-volume camera systems and robotic cranes.
82+
- Cable-driven rehabilitation and haptic devices.
83+
- Large 3D printers, façade cleaning and warehouse automation.
84+
85+
## Connections to Other Algorithms
86+
87+
- [Parallel Manipulator Kinematics](../../kinematics/ParallelManipulatorKinematics.md): the rigid-leg counterparts, whose leg Jacobian plays the role of the structure matrix.
88+
- [Hybrid Position/Force Control](HybridPositionForceControl.md): another controller that splits a wrench between constraints.
89+
- The linear solver and the dual active-set QP come from [numerical-toolbox-cpp](https://github.com/embedded-pro/numerical-toolbox-cpp).
90+
91+
## References & Further Reading
92+
93+
- Pott, A., Bruckmann, T. and Mikelsons, L. (2009). "Closed-form force distribution for parallel wire robots." *Computational Kinematics*, Springer, 25–34.
94+
- Pott, A. (2014). "An improved force distribution algorithm for over-constrained cable-driven parallel robots." *Computational Kinematics*, Springer, 139–146.
95+
- Goldfarb, D. and Idnani, A. (1983). "A numerically stable dual method for solving strictly convex quadratic programs." *Mathematical Programming*, 27, 1–33.
96+
- Pott, A. (2018). *Cable-Driven Parallel Robots: Theory and Application*. Springer.

0 commit comments

Comments
 (0)