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

Abierto Apto para principiantes
#943 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
76/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
numpy, python
Área
backend, robotics

Línea de trabajo

Encuentra el método de manipulabilidad del wrapper del robot e inspecciona cómo pasa start y end a self.ets; el issue identifica los argumentos invertidos. Añade controles específicos para un end predeterminado explícito, solo end, solo start y subcadenas con dos extremos, usando los ejemplos de Panda y los valores esperados del informe. Se considera terminado cuando los resultados de la cadena seleccionada coinciden con jacob0 y la llamada predeterminada explícita coincide con la implícita.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
Lenguaje dominante
C++
Estrellas
3.6k
Forks
652
Merge medio
1 d 23 h
PR fusionados (30 d)
92

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.