Rigorous testing of operational-space methods
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 25/100
Línea de trabajo
Start by reading tests/test_fknm_fallback.py for the Spong 2R anchor and its sign-convention mapping, then tests/test_blocks.py and the _x methods (inertia_x, coriolis_x, gravload_x, accel_x). Create tests/test_operational_space_closed_form.py with the closed-form 2R Jacobian and its hand-derived derivative, and check F = J⁺ᵀτ against the RTB methods over several q, q̇, q̈. Done when the test passes for scalar and trajectory inputs.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
The operational-space methods (inertia_x, coriolis_x, gravload_x, accel_x) have no independent ground truth in the test suite, unlike rne, which is anchored to the closed-form Spong equation. coriolis_x carried a wrong equation and a wrong Jacobian derivative until #796, undetected.
Where the tests stand
rnehas an independent anchor:tests/test_fknm_fallback.pyhas Spong, Hutchinson and Vidyasagar eq. 7.87 for the planar 2R arm, which shares no code withrne.- The
_xmethods are tested by:- stored matrices (
Mr) produced by the code itself, which catch change but not error; - shape and finiteness checks (
test_accel_x_redundant_robot_returns_cartesian_acceleration); tests/test_blocks.py, which compares each block with the method it wraps (circular).
- stored matrices (
- The tests in #796 and #797 compare with inverse dynamics, a real independent check, but anchored to Spong only through
rne.
Derivation (to go in the test module docstring)
Joint-space dynamics M q̈ + C q̇ + g = τ, task velocity ẋ = J q̇ with J the analytical Jacobian, and τ = Jᵀ F. Then:
ẍ = J q̈ + J̇ q̇ so q̈ = J⁻¹ (ẍ − J̇ q̇)
F = J⁻ᵀ τ
= J⁻ᵀ M J⁻¹ ẍ + J⁻ᵀ (C − M J⁻¹ J̇) q̇ + J⁻ᵀ g
= Mx ẍ + [ J⁻ᵀ C J⁻¹ − Mx J̇ J⁻¹ ] ẋ + gx
with Mx = J⁻ᵀ M J⁻¹, q̇ = J⁻¹ ẋ and gx = J⁻ᵀ g. Hence
Mx = J⁻ᵀ M J⁻¹Cx = J⁻ᵀ C J⁻¹ − Mx J̇ J⁻¹gx = J⁻ᵀ gẍ = Mx⁻¹ (F − Cx ẋ − gx)
This is Khatib's operational-space form (his μ = J̄ᵀ b − Λ J̇ q̇) with the Coriolis term written as a matrix. The factorisation of Cx is not unique, only Cx ẋ is. J̇ must be the derivative of the same Jacobian that defines ẋ, so for an analytical representation it is the derivative of the analytical Jacobian, not the geometric one. For a redundant robot J⁻¹ is the pseudo-inverse, and the identity is exact only for minimum-norm motion (q̇ = J⁺ ẋ).
Proposal
A closed-form test on the planar 2R arm, tests/test_operational_space_closed_form.py:
D(q),C(q, q̇),g(q)from Spong's equations.J = [[−l1 s1 − l2 s12, −l2 s12], [l1 c1 + l2 c12, l2 c12], [0, 0], [0, 0], [0, 0], [1, 1]]forrpy/xyz, andJ̇differentiated by hand.- Check
F = J⁺ᵀ τ_spong = Mx ẍ + Cx ẋ + gxusing the RTB methods, over severalq,q̇,q̈, plus trajectory (matrix) inputs. - With two joints the Jacobian has full column rank, so
J⁺J = Iand the pseudo-inverse form is exact for anyq̇,q̈. - TwoLink's sign convention is the mirror of Spong's (
τ_rtb(q, qd, qdd) = −τ_spong(−q, −qd, −qdd), as calibrated intest_fknm_fallback.py), so apply the same mapping.
The 6-joint square path stays anchored through rne, as now; a closed-form 6R case would be possible but much heavier.
Related
- #796 (
coriolis_xequation), #797 (gravload_x) - the ets and robot groups of the typing pass
- Lenguaje dominante
- C++
- Estrellas
- 3.5k
- Forks
- 639
- Merge medio
- 1 d 8 h
- PR fusionados (30 d)
- 113
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de petercorke/robotics-toolbox-python
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
petercorke/robotics-toolbox-python#709 ·
Los mantenedores suelen responder en 1 día
-
help wanted
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
petercorke/robotics-toolbox-python#839 ·
Los mantenedores suelen responder en 1 día
-
enhancement help wanted
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
petercorke/robotics-toolbox-python#825 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
feat(ets): numerical inverse kinematics for planar ETS2Posiblemente ocupada @qwist1233-cpu la tomó hace 2 días. Abiertoenhancement help wanted
Dificultad 4/5 3-5 días Aptitud para principiantes 68/100
petercorke/robotics-toolbox-python#824 ·
Los mantenedores suelen responder en 1 día
-
tech-debt
Dificultad 5/5 Más de una semana Aptitud para principiantes 10/100
petercorke/robotics-toolbox-python#803 ·
Los mantenedores suelen responder en 1 día
Todos los issues de petercorke/robotics-toolbox-python
Issues similares
-
objdetect(mcc): CCheckerDetector leaves its chart type uninitialized 🤖🤖🤖Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
(S1 - Need confirmation)
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
CleverRaven/Cataclysm-DDA#89182 ·
Los mantenedores suelen responder en 1 día
-
ai_p2
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
ClickHouse/ClickHouse#126833 ·
Los mantenedores suelen responder en 1 día
-
clang:static analyzer
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
llvm/llvm-project#233598 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100