Autonomous Steering Demos

The live in /demos, but can be run from anywhere.


avoid.py: OBSTACLEAVOID versus OBSTACLESKIM steering demo.

  • Green Boid uses Reynolds-style OBSTACLEAVOID.

  • Yellow Boid steers so that its bounding circle is tangent to that of the obstacle.


corridor.py: Corridor/lane traversal using WALLAVOID.

The boid uses WALLAVOID with whiskers 90-degrees left/right to steer between inward-facing walls.


lanechange.py: Corridor/lane traversal using SIDESLIP.

The boid uses SIDESLIP (essentially logistic growth between parallel paths) to control lane change. Walls are visual aids only; WALLAVOID isn’t used here.


seek_arrive.py: SEEK and ARRIVE steering demo.

  • Green: Reynolds’ SEEK. Notice how this overshoots the target point and creates jitter.

  • Yellow: Reynolds’ ARRIVE with default hesitance (small).

  • Red: Reynolds’ ARRIVE with larger hesitance.


sheep.py: Flocking demo with random wandering and obstacle avoidance.

All boids use:

  • Random WANDER.

  • OBSTACLEAVOID.

  • WALLAVOID (walls on screen border with inward normals).

Green “sheep”:

  • Flocking (ALIGN, COHESION, and SEPARATION), peroidically active/inactive.

  • When flocking is active, lines indicate neighbors (other sheep only).

  • EVADE the yellow “sheepdog”

Yellow “sheepdog”:

  • Used SEPARATE and ALIGN (with all “sheep”), but no COHESION.

  • Somewhat convincing, but won’t win any sheepdog trials.


stalk.py: Improved TAKECOVER/STALKING steering demo.

All boids avoid walls and obstacles. Additionally:

  • Green: Random WANDER only.

  • Yellow: TAKECOVER from Green (hide behind the most readily-available obstacle).

  • Purple: TAKECOVER from Green with stalking: sneak up behind, but hide if seen).


waypoints.py: Improved Waypoint steering demo.

Green: WAYPATHVISIT will SEEK directly towards each waypoint in turn, traversing the path once and ARRIVING at last waypoint (and stopping).

Yellow: WAYPATHRESUME attempts to “stay on the path” between the last and next waypoint as much as possible. If an obstacle forces the boid off of the path, it will not directly SEEK the next waypoint, but stike a balance between returning to the path and making foward progress. Uses a cyclic path, repeating forever.

Obstacles ensure that the boids will need to divert from the shortest path. All waypoints and obstacles are random.