The most important thing first
Every loop it checks from the top, so a safety rule takes over immediately instead of waiting for the current action to finish.
Many times a second, TickTree asks what an FTC robot should be doing right now, and changes course the moment the answer changes.
Most FTC robots run their autonomous routine as a fixed list of steps, which breaks the moment something unexpected happens: a blocked path, a dropped game piece, a weak battery.
TickTree is an open-source decision engine for FTC robots. Many times a second it asks what the robot should be doing right now, and switches straight away when the answer changes.
Change the world state and watch the tree re-evaluate from the root. The highlighted leaf is the behaviour that owns this tick.
Every loop it checks from the top, so a safety rule takes over immediately instead of waiting for the current action to finish.
Checking that often only helps if it never causes a pause, so the main loop uses no new memory and gives the robot no reason to hiccup.
The core is plain Java with no robot hardware attached, so it can be tested on a laptop, and it plugs into the FTC libraries teams already use.
The question is not what happens next. It is what should be happening right now. Changing the question made the robot much better at changing its mind.
A decision engine that re-checks 50 times a second is only an improvement if it never causes a pause, so I wrote it with how it runs in mind, not just what it decides.