DEV Community

Cover image for Kinewright Wheels: stop, go around, admit the stall
Dimon
Dimon

Posted on Originally published at dimonb19a.hashnode.dev

Kinewright Wheels: stop, go around, admit the stall

The second Kinewright engine now stops before what it sees and goes around what it can pass, knowing the scene only through the sensor models of the previous stage. It also gets stuck, says so, and this article shows that too: the normal drive, the stall when the goal is out of reach, and why.

What this stage adds

  • The steering moves as a declared motion. Two declarations stand beside the shell's profile, a hobby servo's and a car's steering rack's, every rate estimated from its class and attributed to no part. The steer angle rises and falls on an S-ramp under its own rate, with a cap that falls with speed: from rest, lock to straight takes 0.1 s under the servo and 1.46 s under the rack. Every plan takes the same law; the drawn paths of the earlier stages still end on their poses, slower under the rack.
  • A local map from the shell's own sensors: cells of 0.02 m, remembered for 2 s within 3 m. The scan, the 8 × 8 grid, the ultrasonic beam and the bumpers mark it; the single-zone cone and the radar do not, because their returns carry no direction fine enough, and an arc placed conservatively would close every opening of the scene. Every return lands where its surface could be nearest, so the map errs toward the shell, never away from it.
  • Candidates predicted by the shell's own runtime over 1.5 s: three speeds, nine curvatures each plus the goal's own, and rest. A candidate is admissible when the shell, holding it for its reaction time and then asking for rest, meets no cell before it stops. A decision every 0.1 s holds for 0.2 s and carries one reason: clear, slow, around, stop, goal reached, or map unknown.
  • Two skills. Stop-before drives toward its goal or straight ahead and rests before what it sees; it never steers around anything. Go-around reaches its goal round what it can pass, rests before what it cannot, and reports stalled when its distance to the goal has not fallen by 0.05 m over 30 decisions.
  • A manual guard, off by default: on the keys only, it brakes where the same test fails and never steers.
  • Every decision and observation is a recorded input; a drive replays byte for byte two ways in separate processes, with the same records on two machines of different architectures.

How it decides

  • A return's tolerance is three standard deviations of its sensor's noise at that range, half its rounding step and half a cell's diagonal; a corridor keeps 0.05 m beside the body's outline beyond it. An opening is passable when it is wider than the body plus twice the clearance and the scan's tolerance at 2 m: 0.46 m. The fixtures' 0.60 m gap is passable and their 0.30 m gap is not.
  • The stop zone at cruise, 0.5 m/s, is 0.31 m before the tolerance of the cell that meets it: the reaction time of 0.44 s, the runtime's own braking distance and the clearance. The slow zone adds one second of travel. The horizon sees every candidate's whole stop zone.
  • Among the admissible candidates the engine takes the one that ends nearest the goal, rewarding margin up to 0.30 m; ties go to the curvature nearest the goal's, then to the greater speed.

Numbers from this stage

  • On the fixture scenes, 48 runs under both declarations and on both shells: no run overlaps an obstacle on any tick; the least true clearance is 0.11 m against a bar of 0.02 m; stop-before rests 0.14 to 0.21 m before its obstacle.
  • Go-around reaches its goal past a post, past the low box that only the beam hears, through the wide gap and round the angled wall; both skills report blocked at the wall and at the narrow gap.
  • In the drive shown through the opening: cruise from 0.6 s, the first "around" at 4.9 s, the goal reached at 9.2 s after 89 decisions, with 1 428 cells on the map at the goal.
  • The stall, under the rack: with the goal behind the second inner wall, go-around passes the first opening, meets the wall at 9.5 s, edges along it into the corner, stops at 13.7 s and reports stalled at 14.7 s, 1.3 m from its goal, after 144 decisions. It does not leave its trap by driving away from its goal, because nothing in this stage knows the whole room. Under the servo the same goal ends at 12.6 s as blocked, 0.22 m before the wall.

What it does not claim, and why

What you see or might expect Why Changes at
The shell stalls with the goal behind a wall A reactive skill chooses among paths it can see over 1.5 s; it holds no map of the whole drive and plans no route, so a local minimum traps it, and it says so The route stage: a map of the whole drive, a route with replanning, exploration of the unknown, an honest unreachable
It forgets what it passed The map keeps a cell for 2 s after its last return, within 3 m The route stage
The cone and the radar see the box but the map ignores them Their returns carry no direction fine enough; a conservative arc would close the openings The hardware stage, against measured sensors
The beam marks a wider arc than the face Its echo is specular; the map marks the 15° across which the face may lie The hardware stage
The shell knows exactly where it is The pose is the engine's own frame, not an estimate The hardware stage: localisation
A stop here is safe The zones and the guard are engineering rules of the simulation; no stop is called safe and no decision is what a real vehicle would do Never claimed
Nothing moves in the room Only static obstacles; the radar's target speeds wait for the moving-objects stage After the route stage
The steering rates are real Estimated from the two classes; nothing is measured A measured sensor and a real vehicle, much later

Two assumptions sit under everything here, as before: the honesty bound of the kinematic model and the tip threshold, both announced when crossed and never simulated. This stage adds no third one, and obstacles never move the shell: the motion stays kinematic.

Top comments (0)