How does the "Handoff" from autonomous to driver work?

How does the “handover” work? In the matches it says that you have an autonomous period and then a driver. It isn’t clear to me if that is at the beginning or the end. Do you have to set up the code to do that? We’ve gotten the controller to function well enough. But how does one “switch” on the fly? I have only, prior to this, worked with the older cortex models and on that you’d have to stop, hook it up to a PC, and re-download the code. So I am a bit confused.

Assuming that some kind of switch between the two has to happen, what does that look like? Is it some automatic function so the robot moves autonomously for 15 seconds and then the controller kicks in? Are teams allowed to go in and re-program the bot? It’s just not… clear.

If you look at the template code file,you will see there are separate user control and autonomous function, then a line (this is in puthon, may be different for c++) like this

comp = Competition(user_control, autonomous)

This lets the field control handle the swap over. All you hqve to do is put your driver logic in the user_control function and autonomous in the autonomous function.

1 Like

The 15 second autonomous period happens at the beginning of the match. After the autonomous period ends, all robots are disabled and there is a brief pause while the referees determine the winner of the autonomous bonus and/or autonomous win points (usually just a few seconds, but could be longer if there is a dispute or they need to look at something up close). Once the autonomous bonus and AWP have been determined, the 1:45 driver controlled period begins.

If you watch a video of some matches on YouTube (shameless plug for one of my own events) you’ll see what the match flow looks like.


When you write the program to run on your bot, you start with the “competition template”. This has a designated place to put your code for the autonomous period, and a designated place to put your code for the driver control period. When you go to the field for a match, there’s a cable at the field that plugs into your controller, and connects your robot to the field control system. This prevents your robot from being able to move before or after the match, as well as starting and stopping the autonomous and driver control code on all 4 robots at the right time.

Here’s a knowledge base article with more information:

(That article is specifically talking about programming in blocks – if you’re using python or C++, use the search bar at the top of the page to search for “competition template” and find the equivalent article for your language)

6 Likes

Holy hell thanks. This is really helpful!

1 Like