Read wheel slip from a single source - #340
Open
Sycatle wants to merge 1 commit into
Open
Conversation
The averages that steer the car and pick its gear were built by reading the wheels' network variables, so a physics decision travelled through the presentation layer. Reading state directly is not equivalent, because the network value is forced to zero while a wheel is asleep or airborne while state keeps its last value. The wheel now stores what it actually reports, and both the network variables and the vehicle read that. Behaviour is identical and the zeroing rule stays written once.
This was referenced Aug 3, 2026
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.
Addresses 339 — see #339.
Behaviour is identical by construction, since the value written to the network and the value read by the physics become the same variable.
The change
The branch in
glide_wheel/init.luathat already decides what the wheel reports now stores its result before sending it:base_glide_car/init.luathen accumulates fromstateinstead of the network getters.I went this way rather than the obvious one because reading
state.lastSideSlipdirectly is not equivalent: the network value is forced to zero while a wheel is asleep or off the ground, andstatekeeps its last value, so a naive substitution would feed stale slip from airborne wheels into the steering. Mirroring the condition at the consumer would have worked too, but would encode the same rule in two places.What it buys
The averages that steer the car and shift its gears no longer travel through the presentation layer, so the wheels' network traffic can be tuned — quantised, written on change only, sent less often — without touching how the vehicle drives.
It also removes eight network variable reads per vehicle per tick, though that is incidental.
Known issues
Touches the same file as #336, so the two will conflict textually if both are taken; they are independent in substance.