Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Rigorous testing of operational-space methods

Abierto
#804 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@kVinsom ya está trabajando en esto.

Desde el 18/10/2026.

  • #837 de @kVinsom — abierto

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
25/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python
Área
testing

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

tech-debt Tests needed

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

  • rne has an independent anchor: tests/test_fknm_fallback.py has Spong, Hutchinson and Vidyasagar eq. 7.87 for the planar 2R arm, which shares no code with rne.
  • The _x methods 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).
  • 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]] for rpy/xyz, and J̇ differentiated by hand.
  • Check F = J⁺ᵀ τ_spong = Mx ẍ + Cx ẋ + gx using the RTB methods, over several q, q̇, q̈, plus trajectory (matrix) inputs.
  • With two joints the Jacobian has full column rank, so J⁺J = I and the pseudo-inverse form is exact for any q̇, q̈.
  • TwoLink's sign convention is the mirror of Spong's (τ_rtb(q, qd, qdd) = −τ_spong(−q, −qd, −qdd), as calibrated in test_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_x equation), #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

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de petercorke/robotics-toolbox-python

Todos los issues de petercorke/robotics-toolbox-python

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.