Closed-loop HIL test system: simulator gateway, test runner, and scenario test folders#18
Open
toprakcelikel wants to merge 7 commits into
Open
Closed-loop HIL test system: simulator gateway, test runner, and scenario test folders#18toprakcelikel wants to merge 7 commits into
toprakcelikel wants to merge 7 commits into
Conversation
Steering (01-10), throttle (11-18), brake (19-25), and combined driving (26-30) test scripts with embedded # assert lines for tools/test_runner.py.
The closed-loop simulated speed (speed_mmPs, published on 0x4F0) was computed but never logged, so throttle/brake tests asserting on sim_speed_cmPs errored with NameError. Emit it as cm/s to match cmd_speed_cmPs units.
…port - test_runner.py: drive to a known baseline (centered + stopped + DBW alive) before each CSV's clock starts, so tests are independent regardless of order. - 28_serpentine.csv: move the full-reversal assertions to the physically-required slew time (a 400-tenth reversal needs ~2000ms). - New corner-case tests 31-38: steep-turn min-time, edge-case break (found the brake bug), negative speed, whipsaw tracking, turn-under-braking, overflow speed, throttle+brake conflict, sub-deadband hold. - run_all_tests.py batch runner; DBW_corner_case_test_report.md summary.
… corner cases Adds 16 corner-case CSVs (39-54): - comms-loss watchdog + watchdog recovery - malformed-frame and wrong-CAN-ID rejection - boot safe state, soak/stability, command-flood stress - throttle step response, brake release/re-accelerate - speed-burst reversal/rapid-toggle, steering step response - mode-gating checks (49-51) documenting that the 0x350 mode byte is informational (DBW arbitrates its own auto-mode)
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.
Summary
Adds a hardware-in-the-loop (HIL) test harness for the DBW: CAN command
sequences are replayed against a simulated trike and checked with timed
assertions, so control-loop behavior can be regression-tested off-vehicle.
What's included
Non_grapic_simulator) - models the trike(steering slew, throttle ramp, braking, heading/position) and bridges CAN
commands <-> DBW. Emits
sim_speed_cmPsin the LOG line so throttle/braketests can assert on simulated speed.
tools/) - replays a CSV of timed CAN commands, resets toa known baseline before each test, evaluates timed assertions against the
LOG stream, and reports pass/fail. Includes a batch runner.
tests/) - each pairs a test CSV with the runlogs captured from the HIL runs:
WireTest_*,MotorTurn,MoveMotor).Test CSV format
time_ms, CANID, nbytes, speed_cmPs, brake, mode, angle_tenths, with# assert t=<ms>: <condition>lines; the runner checks LOG fields such asactual_angle_tenthsandsim_speed_cmPs.Notes
.txt) documenting theobserved pass/fail behavior.
(brake-over-throttle, wider steering deadband, USB-loop-freeze fix).