VEX EDR V3 Robot C Programming Help

We are a new team and have no experience in Robotics. Our teams desperately need help in programming using Robot C(Text software not theGraphic). We have designed our robots. One of them is a stacker (working) while our claw is still a work in progress. We need help in coding our first program and understand how to code for autonomous and manual for the competition. We found out the competition template and we need to know how it needs to be used in the real competition. There is task autonomous( ) method and there is task usercontrol( ) method. We plan to finish some basic motion code for the robot in the autonomous( ) method. Then in User control method we plan to use the joystick sample program to control the wheels of motors just to move the robot back and forward. After this basic programming is done then please help as to how we can simulate the competition as a practice at home.

Once we start the robot that uses the competition template program will the robot execute the instructions under autonomous methods automatically. How do we simulate the 15 seconds autonomous mode that we have for this years competition. Do we put a timer in the autonomous section ? Or will the judges (or we stop the robot which will be in autonomous mode) after 15 seconds. Also how to make the robot automatically switch to user control mode? Do we have to program for it. If yes where do we put these instruction. Also in autonomous mode the joy stick controller is not allowed so please help use understand how to us how to use the Competition template in the actual competition.

There is lot in this request, So please bear with us as we navigate through this initial experience with VEX Robotics programming…

The judges control the when the autonomous is being run. Your bot will automatically switch to usercontrol, you don’t have to write any code for this. There is a Vex competition switch you have to connect your controller to: https://www.vexrobotics.com/276-2335.html that you can toggle manually if you want to try this at your location. Additionally, you can just set a button on your controller to run your autonomous code inside user control if you don’t have the competition switch.

For your autonomous period the controller cannot be used (I think the competition template blocks any signals from the controller) so you would have to either using timing or if you want to be precise, use sensors like the quad-encoders coupled with pid control to control your robot.

Hope this helps. Good Luck!

3 Likes

Thank you so much Aryan for the quick response. So basically while testing at school you just test the Robot autonomous instructions as a specific joystick button and trigger it in the user control mode. Perfect. So my understanding is for the real competition you just code the autonomous code in the task autonomous( ) and manual user mode in the task usercontrol( ) method. So when the judges gives signal to start competition we just have to powerup the robots and it will automatically execute the autonomous instructions as you said. And when the 15 seconds autonomous round is finished then the judges brings everyones robots our of autonomous mode and then everyone starts manually using their robots. Is that a correct understanding…

You can use ROBOTC to emulate a competition switch. In ROBOTC HELP tab search for AUTON. You should find an entry that is titled “Competition Control”. Oh, I guess I can just copy it here…

Competition Control

In ROBOTC you can directly simulate a VEXNET match from the ROBOTC debugger. The VEXNET transmitter needs to be connected via the orange programming cable to your PC for the debugger to function.

The ROBOTC IDE has a debugger window that allows you to put your robot into any one of the three competition states. In order to access it, you will need to go into the Robot Menu, select “Competition (VEXNet)” from the “VEX Cortex Communication Mode” submenu. Once you do, “Competition Control” should appear as an available debugger window in the “Debugger Windows” submenu. Click it to open up the Competition Control debugger window.

image file:///C:/Program%20Files%20(x86)/Robomatter%20Inc/ROBOTC%20Development%20Environment%204.X/HelpSystem/ROBOTC_VEXHelp_4x/Content/Resources/images/VEXNET_Competition_Control.png

Simply clicking on any of the three buttons will put your robot into the appropriate state.

NOTE: There is no duration timing when in this mode. To transition from AUTONOMOUS to USER CONTROL you need to click the “User Control” button. The VEXNET firmware will not perform timing and automatically invoke the transition.

2 Likes

Yes that is the correct understanding

Thanks RPM. I think we now have the basic understanding of how to program for Autonomous and how to program for User control. My questions were specifically to understand how to test these 2 options (autonomous Vs User control) at home/school and also what to expect in the tournament. So our school has decided to buy the competition switch. Hopefully it works with older versions of EDR (will find out anyways when it arrives). So we plan to Use the Competition Template for testing at school. We will code the autonomous section of the Template with its code and Manual control code in it’s own section and then use the competition switch to test the Competition template at school. That way we don’t have unexpected surprise for the functioning of the Robot. As AryanG told us once we take the Robot to the competition and use the Competition Template then we believe that after powering the Robot will automatically go into the Autonomous mode and execute our programmed instructions code in the autonomous section.

Quick questions:

  1. Do we put a timer for the Autonomous code or the Judge has a way to make all the Robots stop after the 15 seconds round.
  2. Do we then pick up the Robots and bring them to our base as the judges are doing the scores for the autonomous round?
  3. Once the user control round starts do we use the Competition switch to bring the Robot out of the autonomous mode and switch it to the User control mode or does the judge do that? Please help us understand how that works 'Cos we have never been to any competition and next month we will be going to our first competition.
  1. When you go up to the field you plug your controller in to the control tower. This gives the judges the ability to turn off your robot after 15 seconds and at the end of the round.
  2. NO! robots stay where they lie. The referees will score autonomous and then announce when they are giving you driver control of your robot. You just start wherever your bot left off from autonomous.
  1. The judges do it from the control tower.
2 Likes

Yes, the competition switch is compatible with the Cortex controller.


These answers are correct, except that “judges” have no involvement in starting the autonomous period, or anything else that happens on the field - judges interview teams in the pits, read notebooks, and determine which teams receive judged awards.

The people in charge of enforcing rules on the field are called referees, and the person who presses a button to start autonomous is called the TM Operator (sometimes also called the scorekeeper).

2 Likes

Why are you guys using v3?

No budget for the school. We will use the kits that were bought for an in school curriculum program which was last fall. This year we have a VEX club through which we will participate in the competitions but use existing old kits. Next year we will use whatever is the latest. So we may not win the competition with our slow or less power motors but we want to get an experience.