trapezoidal accepts the zero-blend velocity boundary but returns NaN at the initial sample

Abierto
#924 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@tandede ya está trabajando en esto.

Desde el 5/11/2026.

  • #934 de @tandede — abierto

Evaluación

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

Línea de trabajo

Start by reading TrapezoidalProfile.__init__ and the evaluation logic used by trapezoidal, then run the reproduction with V=1.0 and the stated sample times. Check how the zero-duration blend boundary is represented and how the initial sample is evaluated. Done means the accepted boundary produces finite trajectory arrays, or is explicitly rejected, with tests covering both move directions.

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

Descripción

Reproduction

import numpy as np
from roboticstoolbox import trapezoidal

trajectory = trapezoidal(0.0, 1.0, np.array([0.0, 0.5, 1.0]), V=1.0)
print(trajectory.q)
print(trajectory.qd)
print(trajectory.qdd)

On current main 879fb363580840e19ee70b6b175e8cd3543e2b38 this prints:

[nan 0.5 1. ]
[nan 1.  1. ]
[inf 0.  0. ]

The accepted lower boundary abs(V) == abs(qf-q0)/T gives tb == 0; TrapezoidalProfile.__init__ divides by tb, and evaluating the initial blend multiplies that infinite acceleration by zero. Reversing the move reproduces the same non-finite initial sample. Controls at V=1.5 and V=2.0 return finite arrays.

Expected: handle the accepted boundary with a defined finite profile, or reject it explicitly if zero-duration blends are unsupported, rather than returning NaN/inf.

Reproduced with the normal source-package import on Linux, Python 3.12.14, NumPy 2.3.5 and SciPy 1.17.0. No robot hardware was used. This is separate from the empty-phase plotting fix in #910; filed following the request there. Searches for trapezoidal with blend and NaN found no existing issue.

Lenguaje dominante
C++
Estrellas
3.6k
Forks
650
Merge medio
14 h 6 min
PR fusionados (30 d)
139

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.