Do you have to use competition template? If so, where do you find it?
I believe so, if you want your code to run in competition. what language are you using?
Yes if you wish to compete in VEX Robotics Competition events.
which platform V5 or Legacy Cortex ?
In my experience, only if you want to use an autonomous. (Which is highly suggested!!!) I’ve had sister teams go without an autonomous and they ran fine without the template. But this was on Cortex.
Technically no, but you must then implement your own competition state management code if you wish to be able to do autonomous.
Technically, robot must pass the field control test at inspection:
o Robot successfully completes the “Field Control Check” Procedure. See Inspection Guide.
R22
o Robot enters Autonomous mode when prompted with no driver control for duration of Autonomous.
R21
o The Hand-held Controller(s) ONLY control the robot when robot is in Driver mode.
So, the robot must be under field control during matches. How you go about it is up to you, but if you are asking in this forum, then more than likely you will use a competition template approach.
We have the cortex and it is robot C natural language.
I have one v5 robot but we have only used the example code moving forward. We have not moved to anything else.
Thank all of you for your responses.
I can get you the robotC competition template code.
#pragma platform(VEX)
#pragma competitionControl(Competition)
#pragma autonomousDuration(15)
#pragma userControlDuration(145)
#include "Vex_Competition_Includes.c"
task autonomous()
{
//auton code here
}
task usercontrol()
{
//User control code here
}
this should work, test it with a competition switch to be sure.
And it will… Disablement is implemented at a firmware level, no competition template required. The competition template is only necessary for properly stopping motors and tasks, and for triggering autonomous. Driver control can be done without a compeition template perfectly fine (AFAIK, autonomous mode disables controller input).
Thank you. This helps a lot
no problem!
Same question, sort of…so if we have a competition template and have a program under the autonomous section and nothing in the driver led section - will it still work?
Also, we have 2 different autonomous programs depending on where we are placed on the field, how do we choose that program? Are we allowed to touch our V5 brain? Or do we just put in one program and pray the other team will agree? We don’t have a competition switch to test it beforehand and our first competition is this Saturday.
You may not touch the robot once the match started and only in very limited situations.
One way you can select which autonomous program you are going run is to select it before the match starts on the V5 Robot Brain. It allows for eight different programs to be loaded into slots, three which are visible from the main screen, the rest accessible from the Programs selection.
Later when you want to have one program that behaves differently depending on different factors (which start tile, alliance color, choice of shooting preload, parking or not…) you can use our example autonomous program. It requires some computational thinking and programming experience:
https://vexforum.com/t/walshbots-autonomous-feature-selector/51534/1
Thank you lacsap! So if we don’t have anything written in the driver control template portion of the competition template, will the robot still run or not at all? We basically have a V5 clawbot and want to use our controller as we usually do. We are just learning as much as we can, as we got our V5 stuff about 2 months ago. Thanks again everyone for your help!
you will need to put in the code for moving the robot around. you can see this in our example code.
Its not required, but it’s highly recommended to use it.
Okay if you don’t have time to test your program before the competition here is what you should do. Write both autonomous in your program as their own function and then have your autonomous call 1 of them. Example below
void auton1(){
//code
}
void auton2(){
//code
}
void autonomous(){
//auton1();
auton2();
}
Then before your matches talk with your alliance partner and figure out which autonomous you need to run, edit the program to call that autonomous and then redownload your program. You should really get in the habit of talking with your alliance partner well before you match anyway.
Do not try to make a selection system without the ability to test, you will make a mistake and be worse off for it.
Lastly you definitely need to have code in the usercontrol portion of the template or you will not be able to drive your robot. That should be the same as whatever program you are using now not inside the template.