[Bug]: fkine_path raises ValueError for every DH robot

未关闭 适合新手
#952 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
82/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
backend

调研方向

该 issue 指出了 fkine_path 和失败的赋值语句 T[-1] *= self._tool,并给出了一个使用 rtb.models.DH.Puma560() 的最小示例。阅读该方法及其 docstring,然后运行示例以确认故障。完成标准是:返回基座姿态和每个连杆各自的姿态,且不引发 ValueError;issue 作者表示他们已有修复和测试,并愿意开一个 PR。

由索引模型根据 Issue 内容生成。

描述

RTB version

1.5.0 (spatialmath-python 1.1.19). The same line is still in main.

Python version

3.14.8

Operating system

Linux

Expected behavior

fkine_path(q) should return an SE3 with n + 1 poses, the base and then one for each link, like the docstring says.

Actual behavior

It raises ValueError: can't insert different type of object at T[-1] *= self._tool. I tried all the models in rtb.models.DH and it fails for every one of them.

self._tool is stored as a numpy array (the default is np.eye(4)), so T[-1] * self._tool gives back an ndarray, and the SE3 __setitem__ does not accept it.

Minimal reproducible example
import roboticstoolbox as rtb

robot = rtb.models.DH.Puma560()
T = robot.fkine_path(robot.qn)

I would like to work on this. I have a small fix (using the self.tool property, which is SE3) and a test for it, I can open a PR if that is ok.

主要语言
C++
星标
3.6k
派生
652
平均合并
1 天 23 小时
30 天内合并 PR
90

环境准备

从这里开始

  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 摘要。