Skip to content
gunkslab

Reference

Scenarios

Every scenario in scenarios/: what it sets up, what it teaches and what it checks. Each runs on every merge request (08. Scenarios, section 6). Written from the scenario files by docs/gen.py, so it can’t drift from them.

Each picture is the desk from above at the start, with a 10 cm grid. The white notch is a bot’s front. A dashed line runs to the cross where it’s sent. Grey squares are boxes, which only the bots’ sensors know about. Orange diamonds are jobs, numbered, with when each comes in: which bot takes each is the dispatcher’s choice. Purple squares are movers where they set off, a hand or a toy crossing the desk; the dotted line is their path.

To watch one at real speed: scripts/broker up, then scripts/scenario watch NAME, and open the address it prints. scripts/scenario run NAME runs it faster than real time.

Scenario Name Bots Explained in
One bot, one trip one-bot 1 07. Send a bot somewhere
Crossing crossing 2 09. Keeping out of the way
Detour by the edge detour-by-the-edge 2 09. Keeping out of the way
Head-on head-on 2 09. Keeping out of the way
Parked in the way parked-in-the-way 2 09. Keeping out of the way
Side by side side-by-side 2 09. Keeping out of the way
Around two parked around-two-parked 3 09. Keeping out of the way
Between two parked between-two-parked 3 09. Keeping out of the way
Three-way three-way 3 09. Keeping out of the way
Four corners four-corners 4 09. Keeping out of the way
At the edge at-the-edge 1 10. The distance sensor
Box beside the path box-beside 1, a box 10. The distance sensor
Box in the way box-in-the-way 1, a box 10. The distance sensor
Low box beside the path low-box-beside-the-path 1, a box 10. The distance sensor
Low boxes in a row low-boxes-in-a-row 1, 2 boxes 10. The distance sensor
Round a wall round-a-wall 1, 3 boxes 10. The distance sensor
Three boxes staggered three-boxes-staggered 1, 3 boxes 10. The distance sensor
Too near the edge too-near-the-edge 1 10. The distance sensor
Turn beside a low box turn-beside-a-low-box 1, a box 10. The distance sensor
The driver goes quiet driver-goes-quiet 1
No camera, one trip no-camera 1
Someone crosses someone-crosses 1, a mover
Someone crosses the way round someone-crosses-the-way-round 1, a mover
A bot joins jobs-a-bot-joins 2, 2 jobs
A bot leaves mid-job jobs-a-bot-leaves 2, a job
A job while busy jobs-while-busy 2, 2 jobs
No camera, crossing no-camera-crossing 2
Six jobs, three bots jobs-six-for-three 3, 6 jobs

One bot, one trip

Where the bots start in one-bot

A single bot sent across the desk. The baseline. If this fails, nothing else means anything.

What it teaches. The go-to on its own. The station steers a bot by its pose, curving towards the point as it drives and slowing near the end. A point well off to one side would get a turn on the spot first. More in 07. Send a bot somewhere.

Passes when sim-1 arrives within 30 s and no bot reaches the desk’s edge.

scripts/scenario watch one-bot

Crossing

Where the bots start in crossing

One bot crossing the desk left to right, another bottom to top, timed to reach the crossing together.

What it teaches. Paths that cross rather than meet head-on. The station compares where the two are heading, so the one giving way stops before they meet, not when they’re nose to nose. More in 09. Keeping out of the way.

Passes when sim-1 and sim-2 arrive within 30 s, no two bodies touch and no bot reaches the desk’s edge.

scripts/scenario watch crossing

Detour by the edge

Where the bots start in detour-by-the-edge

sim-2’s straight line passes just on the far side of a parked bot. Going round that side is shorter, but it’s close to the desk’s edge, so sim-2 goes round the near side. First found by the stress test (seed 2, layout 93), and laid out again for gl_zero’s body.

What it teaches. Picking a side to go round. A waypoint a bot would reach facing the desk’s edge can get it stopped by its own reflex, so that side is a last resort. With the earlier, smaller bots, the stress test’s layout failed without the rule. This one, laid out for gl_zero, would pass either way, so the station’s own tests check the rule itself. More in 09. Keeping out of the way.

Passes when sim-2 arrives within 90 s, no two bodies touch and no bot reaches the desk’s edge.

scripts/scenario watch detour-by-the-edge

Head-on

Where the bots start in head-on

Two bots on the same line, sent towards each other’s start. They meet in the middle.

What it teaches. Two go-tos meeting nose to nose. Neither can get by on the line, so one gives way and the other goes round it. More in 09. Keeping out of the way.

Passes when sim-1 and sim-2 arrive within 30 s, no two bodies touch and no bot reaches the desk’s edge.

scripts/scenario watch head-on

Parked in the way

Where the bots start in parked-in-the-way

A bot sitting still in the middle of another’s path. The moving one has to go round it.

What it teaches. Going round something that isn’t moving. The station plans a path round the parked bot on a 2 cm grid, and the moving one heads for a waypoint along it. More in 09. Keeping out of the way.

Passes when sim-1 arrives within 30 s, no two bodies touch and no bot reaches the desk’s edge.

scripts/scenario watch parked-in-the-way

Side by side

Where the bots start in side-by-side

Two bots in lanes 22 cm apart, both crossing the desk. They never meet, so this should pass today.

What it teaches. Why bots on their way somewhere count as circles round their corners, 18.3 cm across: they may turn any way. Lanes 22 cm apart leave room for that and the margin, so neither bot waits or goes round. More in 09. Keeping out of the way.

Passes when sim-1 and sim-2 arrive within 30 s, no two bodies touch and no bot reaches the desk’s edge.

scripts/scenario watch side-by-side

Around two parked

Where the bots start in around-two-parked

sim-3 is sent straight between two parked bots too close together to pass between. It has to go round the outside of them. First found by the stress test (seed 1, layout 17), and laid out again for gl_zero’s body.

What it teaches. Planning round more than one bot. Two too close together to pass between are passed on the outside, not squeezed between. A failure the stress test found, kept once it was fixed. More in 09. Keeping out of the way.

Passes when sim-3 arrives within 90 s, no two bodies touch and no bot reaches the desk’s edge.

scripts/scenario watch around-two-parked

Between two parked

Where the bots start in between-two-parked

sim-3 is sent between two bots parked 32 cm apart, both facing the way it’s going. It fits between them, with room to spare, if it goes straight through.

What it teaches. Bots kept apart by their real outlines. Circles round their corners would need the two parked bots 46.6 cm apart before a third could pass between, and at 32 cm there’d be no way round the outside either. A rectangle facing the way it drives needs much less. More in 09. Keeping out of the way.

Passes when sim-3 arrives within 30 s, no two bodies touch and no bot reaches the desk’s edge.

scripts/scenario watch between-two-parked

Three-way

Where the bots start in three-way

Three bots sent through the middle of the desk from three sides, one a moment after the others.

What it teaches. Avoidance with more than two bots, one of them sent later than the others. The rules tested on a case they weren’t written for. More in 09. Keeping out of the way.

Passes when sim-1, sim-2 and sim-3 arrive within 30 s, no two bodies touch and no bot reaches the desk’s edge.

scripts/scenario watch three-way

Four corners

Where the bots start in four-corners

Four bots swap corners diagonally, all at once. Every path crosses the middle.

What it teaches. The busiest case in the set. Four paths through the middle at once, so the bots take turns. The corners are 20 cm in from the edges. A bot facing an edge stops about 20 cm from it, but these are reached at a slant. More in 09. Keeping out of the way.

Passes when sim-1, sim-2, sim-3 and sim-4 arrive within 45 s, no two bodies touch and no bot reaches the desk’s edge.

scripts/scenario watch four-corners

At the edge

Where the bots start in at-the-edge

A bot sent to a point 12 cm from the desk’s edge, facing it. Head on, its sensor would see the desk end first and stop it short, so the station lines it up and it comes in at a slant.

What it teaches. The edge reflex, and working with it. A bot facing the desk’s edge stops with its middle about 20 cm from it. So for a point nearer an edge than that, the station first sends the bot to a point well in from the edges, lined up with the goal, and it drives in at a slant or along the edge with its sensor still on the desk. More in 10. The distance sensor.

Passes when sim-1 arrives within 30 s and no bot reaches the desk’s edge.

scripts/scenario watch at-the-edge

Box beside the path

Where the bots start in box-beside

A box just clear of a bot’s path. The sensor mustn’t take it for an obstacle.

What it teaches. The other side of box-in-the-way. A box just clear of the path mustn’t stop the bot. A reflex that stops for too much is a fault too. More in 10. The distance sensor.

Passes when sim-1 arrives within 30 s, no bot touches another bot or a box and no bot reaches the desk’s edge.

scripts/scenario watch box-beside

Box in the way

Where the bots start in box-in-the-way

A box the station knows nothing about, square in a bot’s path. The bot’s own sensor finds it, and the station goes round.

What it teaches. What the station learns from a bot’s sensor. The station can’t see the box. The bot’s reflex stops it short, the station remembers what the sensor found, and the go-to goes round it and arrives. More in 10. The distance sensor.

Passes when sim-1 arrives within 30 s, no bot touches another bot or a box and no bot reaches the desk’s edge.

scripts/scenario watch box-in-the-way

Low box beside the path

Where the bots start in low-box-beside-the-path

A 2 cm box whose corner reaches about 1 cm into a bot’s path, at the flares.

What it teaches. What gl_zero’s sensor can’t see. Its view is 27 degrees wide, so it’s only as wide as the bot about 22 cm ahead of the lens, and out there it looks level, 33 mm up: too high for a 2 cm box. Nearer, the box is outside the view. The bot drives into it. More in 10. The distance sensor.

Passes when sim-1 arrives within 30 s, no bot touches another bot or a box and no bot reaches the desk’s edge.

Expected to fail, for now: the sensor can’t see a low box at the side of the bot’s path: a hardware limit

scripts/scenario watch low-box-beside-the-path

Low boxes in a row

Where the bots start in low-boxes-in-a-row

Two 2 cm boxes side by side. A bot goes round the first and passes close by the second, which it sees only at the edge of its view.

What it teaches. Forgetting what was found needs a region that could see down to how tall the thing is. Nearly that low isn’t enough: the corner of a low box at the edge of a region’s view can go unread, and the station was forgetting the second box, then driving into it. More in 10. The distance sensor.

Passes when sim-1 arrives within 30 s, no bot touches another bot or a box and no bot reaches the desk’s edge.

scripts/scenario watch low-boxes-in-a-row

Round a wall

Where the bots start in round-a-wall

Three boxes side by side across a bot’s way, 30 cm of wall the station knows nothing about, ending 35 cm short of the desk’s near edge: room for gl_zero to go round.

What it teaches. Going round what a bot’s sensor finds when it’s more than one box. Each region reports the nearest thing anywhere in its view, so the station’s picture of the wall runs past its ends at first. Finding no way round, the bot looks round before giving up, its regions see past the ends, and the go-to goes round. More in 10. The distance sensor.

Passes when sim-1 arrives within 30 s, no bot touches another bot or a box and no bot reaches the desk’s edge.

scripts/scenario watch round-a-wall

Three boxes staggered

Where the bots start in three-boxes-staggered

A bot sent diagonally across the desk, past two boxes stacked in its way and a third further on.

What it teaches. Going round boxes means turning beside them. Readings taken while turning have to be placed where the bot was facing then: placed where it faced after, the bot hit the first box. Today it ends blocked rather than finding its way through: what the sensor finds is remembered wider than it is, and the gaps between the boxes close. More in 10. The distance sensor.

Passes when sim-1’s go-to ends blocked within 30 s, no bot touches another bot or a box and no bot reaches the desk’s edge.

scripts/scenario watch three-boxes-staggered

Too near the edge

Where the bots start in too-near-the-edge

A bot sent to a point 6 cm from the desk’s edge. Its body won’t fit there, so the station refuses at once.

What it teaches. Where a go-to can’t end. Nearer an edge than the circle round the bot’s corners, or deep in a corner where no slant keeps its sensor on the desk, the station refuses with edge before the bot moves. The page shades those places. More in 10. The distance sensor.

Passes when sim-1’s go-to ends edge within 30 s and no bot reaches the desk’s edge.

scripts/scenario watch too-near-the-edge

Turn beside a low box

Where the bots start in turn-beside-a-low-box

A bot starts with a 2 cm box just ahead and to its left, and has to turn to go round it.

What it teaches. What a bot’s sensor reads while it turns on the spot was read a moment before: a sixth of a second is 10 degrees. The station places each reading where the bot was facing when it was taken (ranges_age_ms). Placed at the heading it has now, the box’s face was lost, and the bot drove into it. More in 10. The distance sensor.

Passes when sim-1 arrives within 30 s, no bot touches another bot or a box and no bot reaches the desk’s edge.

scripts/scenario watch turn-beside-a-low-box

The driver goes quiet

Where the bots start in driver-goes-quiet

A bot driven by hand for a second, then nothing more: the page shut, the laptop asleep, its Wi-Fi gone.

What it teaches. How long a command lives. A client driving by hand sends at least every 250 ms; quiet for 500 ms, the station stops the bot itself. Behind that, the bot stops 500 ms after the last command the station sent. Neither waits for anyone to press a stop.

Passes when sim-1 stops within 0.6 s of its driver’s last command and no bot reaches the desk’s edge.

scripts/scenario watch driver-goes-quiet

No camera, one trip

Where the bots start in no-camera

The baseline trip on a desk with no overhead camera: the bot is placed by hand where it starts, with the simulator’s imperfect wheels and gyro.

What it teaches. Steering by an estimate. With no pose from a camera the station steers by the bot’s own dead reckoning, from where a person said they put it down. It’s only as sure as that and the wheels and gyro since: every room it keeps round the bot grows by how far off it may be, and the page’s fleet row says by how much.

Passes when sim-1 arrives within 30 s and no bot reaches the desk’s edge.

scripts/scenario watch no-camera

Someone crosses

Where the bots start in someone-crosses

A bot sent across the desk while a hand, 8 cm square and 20 cm tall, moves across its path from the near side to the far side.

What it teaches. Something that moves. The station can’t see the hand; the bot’s sensor finds it and the reflex stops the bot short. The station goes round what was found, on the side the hand is moving away from, and the bot arrives.

Passes when sim-1 arrives within 30 s, no bot touches another bot or a mover and no bot reaches the desk’s edge.

scripts/scenario watch someone-crosses

Someone crosses the way round

Where the bots start in someone-crosses-the-way-round

As Someone crosses, but the hand moves the other way, from the far side to the near side: towards the side the station goes round on.

What it teaches. What the station doesn’t know about moving things. It plans round what a sensor found as if it stood still, so it turns the bot to go round on the near side, the way the hand is heading, and the bot’s corner clips the hand as it turns.

Passes when sim-1 arrives within 30 s, no bot touches another bot or a mover and no bot reaches the desk’s edge.

Expected to fail, for now: the station treats what a sensor finds as standing still: it goes round the hand on the side the hand is moving to

scripts/scenario watch someone-crosses-the-way-round

A bot joins

Where the bots start in jobs-a-bot-joins

One bot and two jobs, the second coming in a second after the first. 3 seconds in, a second bot is put on the desk.

What it teaches. A fleet gaining a bot. The second job waits while the only bot is busy; the bot put on the desk connects, is free, and takes it.

Passes when every job is done within 30 s, no two bodies touch and no bot reaches the desk’s edge.

scripts/scenario watch jobs-a-bot-joins

A bot leaves mid-job

Where the bots start in jobs-a-bot-leaves

Two bots, one job. sim-1, the nearer, takes it, and is taken off the desk 3 seconds in, before it gets there.

What it teaches. A fleet losing a bot. When a bot’s link drops, the station ends its trip offline and the job goes back to waiting; the next free bot, sim-2, takes it and does it.

Passes when job-1 is done within 30 s, no two bodies touch and no bot reaches the desk’s edge.

scripts/scenario watch jobs-a-bot-leaves

A job while busy

Where the bots start in jobs-while-busy

Two bots and two jobs. The first job comes in nearest sim-2; the second comes in a second later, nearer sim-2’s start than sim-1, while sim-2 is on its way to the first.

What it teaches. Jobs go to free bots. The plain rule gives the oldest job waiting to the nearest bot with nothing to do, so the second job goes to sim-1, the farther bot, rather than waiting for sim-2.

Passes when every job is done within 30 s, no two bodies touch and no bot reaches the desk’s edge.

scripts/scenario watch jobs-while-busy

No camera, crossing

Where the bots start in no-camera-crossing

Crossing, on a desk with no overhead camera: both bots placed by hand where they start, with the simulator’s imperfect wheels and gyro.

What it teaches. Giving way when neither bot’s place is sure. Each is steered by its own estimate, and the room kept between them is what it would be with a camera, and as much again as each may be off.

Passes when sim-1 and sim-2 arrive within 30 s, no two bodies touch and no bot reaches the desk’s edge.

scripts/scenario watch no-camera-crossing

Six jobs, three bots

Where the bots start in jobs-six-for-three

Three bots parked along one side of a bigger desk, and six jobs coming in over 15 seconds, spread across it.

What it teaches. A fleet working through a queue. Jobs come in faster than one bot could do them; the plain rule gives each to the nearest free bot, and the score shows how long jobs waited for one and how far the bots drove between them.

Passes when every job is done within 90 s, no two bodies touch and no bot reaches the desk’s edge.

scripts/scenario watch jobs-six-for-three