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

未关闭
#924 1 条评论 0 个 reaction 已指派 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 分钟
30 天内合并 PR
139

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

petercorke/robotics-toolbox-python 的其他 Issue

查看 petercorke/robotics-toolbox-python 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。