Repository navigation
Conversation
Reset the previous-distance sentinel with the waypoint and random generator so a prior short run cannot discard the first waypoint after initialisation. Add repeated-run trajectory regressions for three seeds. Co-Authored-By: ChatGPT (GPT-6 Astra Pro) <noreply@openai.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1005.
Summary
A seeded RandomPath restarts its random generator and waypoint in init(), but retains the previous waypoint distance. After a one-step run, the restarted vehicle is back at its initial pose and the first waypoint has exactly that stale distance. The no-progress check discards the waypoint, so a fresh and a restarted simulation use different paths despite identical initial conditions and seeds.
For seed 2, a 0.1 s run followed by a 5 s run differs from a fresh 5 s run by up to 2.9019800497003274 in the trajectory array; their first headings are 0.07891548644582533 and 0.02136939104648566.
Reset _d_prev to its initial infinite value alongside _goal. This restores the documented repeatable waypoint sequence across Vehicle.run() resets. The path-following rule within a run and fresh-run results are unchanged; restarted runs affected by the stale distance now reproduce the fresh trajectory.
Add six regression cases covering three seeds and both a one-step and a longer prior run. Each checks two subsequent runs against the complete fresh trajectory.
@Afloat16 is the primary author and responsible owner. Prepared with assistance from ChatGPT (GPT-6 Astra Pro).
Related issue
Fixes #1005; the issue was claimed before implementation.
Validation
Python 3.12.14, NumPy 2.2.6, spatialmath-python 1.1.19, Linux x86-64, Matplotlib Agg. The repository was installed in its supported pure-Python mode (RTB_PURE_WHEEL=1).
The complete suite was attempted with the repository's 50 s timeout and stopped in the unrelated tests/test_ik_joint_order.py::test_solution_reproduces_the_pose while evaluating Python inverse kinematics. It did not produce a complete-suite verdict. Native extensions and the documentation build were not validated here.
Whole-package mypy reports the same 24 pre-existing errors on the base and the change. Ruff reports the same eight pre-existing diagnostics in tests/test_mobile.py; the changed production file is clean. No unrelated lint or typing changes are included.
Checklist