Integer control callbacks lose fractional vehicle limits and stop motion

未关闭
#936 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@Elon-Jiang 已经在做这个了。

开始于 2026年11月10日。

  • #937 来自 @Elon-Jiang —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
20/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
python
领域
backend

调研方向

Read the three u_limited methods in Vehicle.py and trace how integer control inputs determine the result dtype. Reproduce the reported difference between integer and floating callback commands with the public step example, then add regression coverage for the limit methods and callback path. The issue reports an open linked pull request (#937), so the work is already under way.

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

描述

RTB version

1.5.0, current main 879fb363580840e19ee70b6b175e8cd3543e2b38 (normal editable install with compiled extensions).

Python version and OS

Python 3.12.13, macOS arm64.

Expected behaviour

An integer-valued control callback should produce the same limited motion as the equivalent floating-valued callback. The documented ArrayLike inputs include integer lists/arrays.

Actual behaviour

u_limited in Bicycle, Unicycle and DiffSteer allocates an integer result for integer inputs, then truncates fractional speed, acceleration or steering limits on assignment. For example, a desired speed of 1 limited to 0.5 becomes 0. This also reaches the public simulator through a control callback:

import roboticstoolbox as rtb

for command in ([1, 0], [1.0, 0.0]):
    vehicle = rtb.Bicycle(speed_max=0.5, dt=0.1)
    vehicle.step(lambda vehicle, t, x: command, animate=False)
    print(command, vehicle.x)

Current main prints [0., 0., 0.] for the integer callback and [0.05, 0., 0.] for the floating callback. Unicycle and DiffSteer reproduce the same lost motion. Direct constant step([1, 0]) is a passing control, since eval_control already converts that route to floating point. No rendering or robot hardware is involved.

I checked all 24 open PR file lists, full history for Vehicle.py, and complete searches for u_limited, limits_va, integer velocity and acceleration. #929 changes the sign of reverse odometry; it does not change control limiting.

I plan a focused floating-output correction in these three limit methods and regression coverage through both u_limited and the public step callback path. Prepared with assistance from OpenAI Codex (GPT-6).

主要语言
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 摘要。