ROBOTC.net forums
http://www.robotc.net/forums/

Autonomous Code Fails to Run
http://www.robotc.net/forums/viewtopic.php?f=11&t=4010
Page 1 of 1

Author:  Morpheus [ Wed Jan 11, 2012 5:25 pm ]
Post subject:  Autonomous Code Fails to Run

Hi, I am trying to get my code for a competition to work. I am using a standard competition template, bu no matter what I put in the autonomous code section, it always skips ahead to user control. (Yes, I have removed the placeholder)

Competition is in two days, so any help would be great!

Author:  magicode [ Wed Jan 11, 2012 5:50 pm ]
Post subject:  Re: Autonomous Code Fails to Run

How are you starting autonomous mode? Are you using the competition switch in ROBOTC?

Author:  Morpheus [ Wed Jan 11, 2012 6:35 pm ]
Post subject:  Re: Autonomous Code Fails to Run

Competition switch? I have the competition control set to true. If you mean the little black switch they have at competitions, I don't have that. Here's the first part of my code, the rest is just driver control stuff.

#pragma platform(VEX)
#pragma competitionControl(Competition)
#pragma autonomousDuration(20)
#pragma userControlDuration(120)
#include "Vex_Competition_Includes.c"

void pre_auton(){}

task autonomous(){while(true) {motor[port2]=64; motor[port3]=64; }}

Author:  Morpheus [ Wed Jan 11, 2012 6:42 pm ]
Post subject:  Re: Autonomous Code Fails to Run

I just tried running the program with the #pragma competitionControl tag set to autonomousTest, that didnt work either.

Author:  Morpheus [ Wed Jan 11, 2012 6:52 pm ]
Post subject:  Re: Autonomous Code Fails to Run

Would not having either the competition switch or the Joystick-Computer link cable cause autonomous to not run? (I have no way to set the robot to autonomous mode, like they demonstrate at http://www.robotc.net/support/cortex/testing.pdf?) Is there any workaround without those two cables?

Author:  magicode [ Wed Jan 11, 2012 10:35 pm ]
Post subject:  Re: Autonomous Code Fails to Run

The ROBOTC competition control works just like the physical competition switch, but through software. If you do not have the USB-Serial cable to connect the joystick to the computer, and you do not want to connect the Cortex directly to the computer, this will not work. If you just want to test your autonomous, you can copy the #pragmas over to a blank page, and write out the code there. Then download that file to the robot by wire, and test it that way. When you're done, copy the code to the autonomous part of the template.

Author:  Morpheus [ Thu Jan 12, 2012 5:05 pm ]
Post subject:  Re: Autonomous Code Fails to Run

Thanks. So what you are saying is just copy the code into a separate file and run that to test the autonomous phase, and then move it to the competition template for the final program?

Author:  magicode [ Fri Jan 13, 2012 1:48 am ]
Post subject:  Re: Autonomous Code Fails to Run

Yes, the code should execute the same way. But again, make sure that your #pragmas are identical in both files, or you may have problems.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/