ICIDO draws a route on the floor and speaks walking directions along it. Until build 261, the arrows and the spoken directions both read the same line: a curve rounded to look smooth on screen. That curve turned out to be a poor thing to read directions from.
Build 261 gives every route two shapes, one to draw and one to read. It went to TestFlight as part of the work on version 1.4. The version on the App Store is 1.3.
One line, two jobs
Starting a route runs A\* over the floor cells of the map, and the path it finds is then smoothed. Before build 261, that path was rounded further with two passes of Chaikin's method, and that rounded line was what both the arrows and the directions used.
Chaikin's method is a standard way to round a polyline. Each pass replaces every corner with two new points, a quarter of the way along each segment next to it. A sharp corner becomes a run of shallower ones. Two passes give a curve that looks soft and continuous.
That is right for a picture. It is wrong for an instruction. The part of the app that writes directions turns the route into steps such as "go forward 5 meters, then turn left", and it reads the line it is given, bend by bend. Give it a rounded corner and it sees several small bends where there is one turn.
What went wrong, measured
The fault was measured through the real router, the direction writer and the gate that spaces out speech, at 1 m/s on simulated corridors. Four problems showed up.
Turns in a straight corridor. On a straight 20 m corridor, a turn or "Turn around." was announced at between 24 and 46 percent of positions. The cause was tiny. Every path starts with a hop of 5 to 8 cm, a step to the middle of the patch of floor you stand on. The rounded line kept that hop, and the direction writer read it as the way to go.
One corner, several bears. Two rounding passes split a 90-degree corner into pieces of about 22.5 degrees. Each piece was read as "bear" rather than "turn", with the soft vibration instead of the strong one. Sometimes the wrong side came first: "bear right", then "bear left", for a single right turn.
A turn at the end. The same hop at the destination could produce a turn announced in the last metre, where there was no turn.
Arrows through the wall. The rounded curve cut across the inside of corners. In one L-shaped corridor, 35 sample points of the drawn route lay off the floor. In a narrow corridor, that meant through the wall.
Two shapes for one route
The fix is a new piece of code called RouteShape, and it separates the two jobs.
The shape that is read. Directions now come from the router's own path, simplified by the Douglas-Peucker algorithm at 25 cm. Douglas-Peucker is a standard line-simplification method. It finds the point furthest from the straight line joining the two ends, keeps it if it is further away than a set tolerance, and repeats on each half. Points within the tolerance are dropped. At 25 cm, the start and end hops and small shuffles between lanes are gone, and every real corner is kept. One corner is now one "turn right".
The shape that is drawn. Corners on screen are still rounded, but with a bounded curve. Each corner gets a quadratic curve no longer than 40 cm and no more than 45 percent of the leg it sits on. The curve is then checked against the map's floor. If any of it leaves the floor, the rounding is halved and checked again, down to a sharp corner if that is what it takes. The arrows bend round a corner on the floor ICIDO measured, never across it.
A small wording fix went in with it. A distance that rounds to exactly one now says "1 meter", not "1 meters".
The test that should have existed
The existing tests had fed the router's raw path straight to the direction writer. The app fed it the rounded curve. So nothing had tested what the app actually said.
New fixtures close that gap. They walk the same router, the same RouteShape and the same speech gate the app uses, at walking pace, through three simulated corridors: a straight one, an L with one right turn, and a Z with a right then a left. In the straight corridor, positions are checked every 0.25 m across three lanes, where nothing should be said about turning. Every route is also checked for arrows that leave the floor.
With the old Chaikin shape swapped back in, 6 of the new checks fail. With RouteShape, none of the places you could stand on the simulated 20 m corridor gets a wrong direction.
Why it was worth the trouble
Every spoken line in ICIDO goes through one announcer. With VoiceOver running, VoiceOver reads it in its own voice. With VoiceOver off, the system speech voice reads it, so directions are still heard with the phone in a pocket. Directions are never generated by a model. They are worked out from the route and the live position.
That makes the route the whole truth of what gets said. If the line being read contains a bend that is not on the floor, the sentence will contain it too. A direction is only useful if it is said when it is true, and said once. Build 261 is about making the line being read match the floor being walked.