By coincidence that’s the part of the code I had decided to work on today. I really need to explore what other teams are doing.
I took an online course on self driving cars recently, and in the strategy section, they basically said the most common approach is just a finite state machine. Based on input, it decides if the car should be driving straight, stopping, turning, changing lanes, etc, and there were driving patterns associated with each “strategy”. So, I’m taking that approach for translating the field state into an “optimal” driving strategy.
I put “optimal” into quotes because it isn’t so much optimized, as much as just working.
For Rapid React, I have just a few things a robot might be doing. It might be looking for a ball where it is, going someplace else to find a ball, moving to pick up a ball, picking up a ball, moving to a shooting location, or shooting.
There’s a whole lot that is conspicuous by its absence in the above. Most notably, there’s no reference to other robots. I tried to come up with realistic ideas for reacting to other robots, and it was much too complicated. I decided that for version 1.0, robots were just obstacles. They might block the view of a ball, or pick one up, which would just cause the autonomous robot to look for another. If they actually played defense against the autonomous robot, the poor autonomous robot would just get confused, and keep looking for balls, constantly trying to adjust its state information to reflect the fact that it hadn’t moved.
Within each of those strategies, things still aren’t easy m but they are solveable and relatively well understood. There’s still path planning and localization. If your “state” in the state machine is “moving to shooting location”, you have to know where you are and then plan a path to where would be a good place to shoot, and update that path and check constantly to see if you ought to change state to “shooting”.
The above doesn’t worry about two ball pickups, or climbing, but for version 1, it won’t. It won’t be a competitive robot when running autonomously.