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

オープン
#924 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@tandede がすでに取り組んでいます。

2026年11月5日 から。

  • #934 @tandede による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
75/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
numpy, python
領域
backend, robotics

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
C++
スター
3.6k
フォーク
650
平均マージ
14時間 6分
マージ済み PR(30日)
139

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

petercorke/robotics-toolbox-python のほかの issue

petercorke/robotics-toolbox-python の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。