Closed madacker closed 7 months ago
Option 2) appeals to me. The teleop routine can maintain a list of ongoing actions. In each iteration, the op mode calls run()
on every action, removing the ones that return false
. This is very possible with the current actions, though I haven't mentioned the pattern anywhere.
I left drawing out of my earlier comment. This is a good place to start: https://github.com/acmerobotics/road-runner-ftc/blob/389a7c9d50915a6637a5d395e74a4948b4a37ed0/RoadRunner/src/main/java/com/acmerobotics/roadrunner/ftc/Actions.kt#L13
I wrote a short guide on this: https://rr.brott.dev/docs/v1-0/guides/teleop-actions/
Actions are great! But they might be even greater if the same Actions could be used for concurrency in TeleOp as well as Auton. (Maybe they are, but I didn't spot a way.) A couple of potential ways pop to mind: