Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Rigorous testing of operational-space methods

Đang mở
#804 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@kVinsom đang làm issue này rồi.

Từ ngày 18/10/2026.

  • #837 của @kVinsom — đang mở

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
python
Lĩnh vực
testing

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
C++
Star
3.5k
Fork
639
Merge trung bình
1 ngày 13 giờ
Pull request đã merge (30 ngày)
98

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của petercorke/robotics-toolbox-python

Tất cả issue của petercorke/robotics-toolbox-python

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.