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!

Wed Jan 11, 2012 5:25 pm

magicode

Moderator

Joined: Tue Sep 14, 2010 9:19 pmPosts: 496

Re: Autonomous Code Fails to Run

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

_________________sudo rm -rf /

Wed Jan 11, 2012 5:50 pm

Morpheus

Rookie

Joined: Wed Jan 11, 2012 5:22 pmPosts: 5

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.

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

Wed Jan 11, 2012 6:42 pm

Morpheus

Rookie

Joined: Wed Jan 11, 2012 5:22 pmPosts: 5

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?

Wed Jan 11, 2012 6:52 pm

magicode

Moderator

Joined: Tue Sep 14, 2010 9:19 pmPosts: 496

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.

_________________sudo rm -rf /

Wed Jan 11, 2012 10:35 pm

Morpheus

Rookie

Joined: Wed Jan 11, 2012 5:22 pmPosts: 5

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?

Thu Jan 12, 2012 5:05 pm

magicode

Moderator

Joined: Tue Sep 14, 2010 9:19 pmPosts: 496

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.

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum