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

Offen
#924 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@tandede arbeitet bereits daran.

Seit 05.11.2026.

  • #934 von @tandede — offen

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
75/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
numpy, python
Bereich
backend, robotics

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
C++
Sterne
3.6k
Forks
650
Ø Merge
14 Std. 6 Min.
Gemergte PRs (30 T.)
139

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus petercorke/robotics-toolbox-python

Alle Issues in petercorke/robotics-toolbox-python

Ähnliche Issues

Weitere Issues zu C++

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.