Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Replace VehicleTrailer/DiffSteerTrailer with an ArticulatedVehicle (or delete them)

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
22/100
Issue 类型
重构
描述清晰度
需要澄清
活跃度
活跃
技术栈
python
领域
robotics

调研方向

The classes live in src/roboticstoolbox/mobile/Vehicle.py: Trailer, DiffSteerTrailer, VehicleTrailer, and the VehicleBase they should derive from. Start by reading VehicleBase.__init__ next to VehicleTrailer.__init__ and step to see which base attributes are missing, then search the repo for imports of these classes. Done means a recorded decision (ArticulatedVehicle or deletion), with the remaining code covered by tests and docstrings.

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

描述

tech-debt

Trailer, DiffSteerTrailer and VehicleTrailer in src/roboticstoolbox/mobile/Vehicle.py were a late addition, are not used in the book, and are in poor shape. They are not exported from roboticstoolbox, have no tests and are not in the docs, so only code that imports them from roboticstoolbox.mobile.Vehicle can be affected.

Found during the type-hinting pass. They were annotated only to the extent needed for mypy to pass; their defects were recorded, not fixed.

Proposal

Investigate replacing VehicleTrailer and DiffSteerTrailer with a single ArticulatedVehicle class that is a proper VehicleBase subclass and composes a Trailer. Drop DiffSteerTrailer. This is a design question, not a patch.

Known defects (headstart)

  • VehicleTrailer does not call super().__init__, so most VehicleBase attributes (_V, _control, ...) do not exist on it; _x0 is not converted to an array; step returns None where the base returns odometry (hence # type: ignore[override]). Needs a decision: composition, or a proper subclass.

  • VehicleTrailer.plot is a copy of DiffSteerTrailer.plot and uses self._L1, self._L2, self._animation_trailer, none of which exist on VehicleTrailer. Dead code.

  • DiffSteerTrailer.deriv has a leftover print(X[2], eta, etad) and a dead if X[2] > 0.01: pass; DiffSteerTrailer.__init__ calls x0.copy(), which only works because the default is a list.

  • Trailer._animation was only set when an animation or polygon was given, but VehicleTrailer.init reads it (initialised to None in the typing PR; it crashed before).

  • DiffSteerTrailer.init called self._animation_trailer.add even when trailer=None (now guarded).

  • Trailer.__init__ has placeholder docstring text (_summary_, _description_).

  • The runblock example in the VehicleTrailer.step docstring uses VehicleTrailer and Trailer without importing them (a NameError when the docs are built)

Acceptance

  • Decide: ArticulatedVehicle or delete.
  • Whatever remains has tests, docs and a docstring, and VehicleBase attributes are all initialised.
主要语言
C++
星标
3.5k
派生
639
平均合并
1 天 8 小时
30 天内合并 PR
113

环境准备

从这里开始

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