Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#773 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
22/100
Tipo di issue
Refactoring
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
python
Ambito
robotics

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
C++
Stelle
3.5k
Fork
639
Merge medio
1g 16h
PR unite (30g)
88

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di petercorke/robotics-toolbox-python

Tutte le issue di petercorke/robotics-toolbox-python

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.