[Bug]: manipulability reverses start and end when selecting a robot subchain

Đang mở Phù hợp với người mới
#943 1 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

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
76/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
numpy, python
Lĩnh vực
backend, robotics

Hướng nghiên cứu

Tìm phương thức manipulability của robot wrapper và kiểm tra cách nó chuyển start và end đến self.ets; issue xác định các đối số bị đảo ngược. Thêm các kiểm tra tập trung cho end mặc định được chỉ định tường minh, chỉ end, chỉ start và các chuỗi con có hai đầu mút, dùng các ví dụ Panda và giá trị mong đợi trong báo cáo. Hoàn thành khi kết quả của chuỗi được chọn khớp với jacob0 và lời gọi mặc định tường minh khớp với lời gọi ngầm định.

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

Mô tả

bug
RTB version

1.5.0, source main cee0023535988e4ae9490c81d639a46f2311b8fd; spatialmath-python 1.1.19; NumPy 2.5.5; native _fknm_c available

Python version

3.12.14

Operating system

Linux

Expected behavior

Selecting start and end should use the same kinematic chain as jacob0 with the same arguments. Supplying the default end explicitly should also agree with leaving it implicit. For the configuration below, the inverse-condition measure for panda_hand should be approximately 0.09476812042044401. For the subchain from panda_link2 to panda_link6, the minimum singular value should be approximately 0.175997031437505.

Actual behavior

Explicit end="panda_hand" raises ValueError: cond is not defined on empty arrays, whereas the default-end call and the measure computed from the selected Jacobian agree. Selecting panda_link2 to panda_link6 returns approximately 0.27532097160945784 instead of 0.175997031437505.

The robot wrapper builds its sequence with self.ets(end, start), but the sequence API takes start first and end second. This chooses a different chain (or a joint-free chain for an explicitly selected default end). The default call with both arguments omitted is unaffected. This was reproduced with the compiled backend on the source revision above. A focused fix would correct argument forwarding and add controls for explicit defaults, end-only, start-only, and two-ended subchains, without changing the manipulability formulas or public API.

Minimal reproducible example
import numpy as np
import roboticstoolbox as rtb

panda = rtb.models.Panda()
q = np.array([0.3, -0.5, 0.2, -1.8, -0.4, 1.4, 0.6])

selection = dict(start="panda_link2", end="panda_link6")
J = panda.jacob0(q, **selection)
print(panda.manipulability(J=J, method="minsingular"))
print(panda.manipulability(q, method="minsingular", **selection))
# Expected both: 0.175997031437505
# Actual second: 0.27532097160945784

print(panda.manipulability(q, method="invcondition"))
# 0.09476812042044401
print(panda.manipulability(q, end="panda_hand", method="invcondition"))
# ValueError: cond is not defined on empty arrays
Ngôn ngữ chính
C++
Star
3.6k
Fork
652
Merge trung bình
1 ngày 23 giờ
Pull request đã merge (30 ngày)
92

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.