View unanswered posts | View active topics It is currently Tue Jul 22, 2014 4:19 am






Reply to topic  [ 6 posts ] 
Autonomous Code 
Author Message
Rookie

Joined: Wed Feb 09, 2011 7:28 pm
Posts: 14
Post Autonomous Code
Hello,
Our team recently went to a practice tournament and found a perplexing problem regarding our autonomous program. We put the program in the autonomous template. Then, when we tested it from the computer, (downloading via bluetooth) everything worked fine. However, when we hooked it up to the field control system, the robot would skip the waitForStart() function. The robot would wait about four seconds, then skip the function and carry on with the program. The same thing happened when the robot was not connected at all. We're currently running RobotC 3.00.

Here's some of the code:
Code:

void initializeRobot()
{
  // Place code here to sinitialize servos to starting positions.
  // Sensors are automatically configured and setup by ROBOTC. They may need a brief time to stabilize.

  return;
}


task main()
{


  //HTGYROstartCal(S2);
  waitForStart();
  //StartTask(displayDiagnostics);
  //initializeRobot();
  eraseDisplay();
  nxtDisplayString(2,"It has started.");
  StartTask(monitorGyro);
  int startTime = nPgmTime;//, i;
  //StopTask(displayDiagnostics);
  while(/*i < 700)*/ (nPgmTime - 7000) < startTime)
  {
    //i++;
    drive(-2,50);
    spin(angle,0);
    applyPower();

    /*
    eraseDisplay();
    nxtDisplayString(2,"%i",angle);
    wait10Msec(1);
    */
  }
  StopTask(monitorGyro);
  stop();

  while (true)
  {}
}


Any help would be greatly appreciated.


Last edited by ThePaperplaneologist on Sat Oct 29, 2011 12:33 pm, edited 1 time in total.



Thu Oct 27, 2011 4:18 pm
Profile
Expert

Joined: Mon Oct 27, 2008 9:59 pm
Posts: 137
Post Re: Autonomous Code
Best guess I can muster at the moment is that you were running an older version of your autonomous code which did not use the template? Can you double check that the version of the code you were running on the NXT matches up with the one on your computer which uses the template?


Fri Oct 28, 2011 9:42 am
Profile
Rookie

Joined: Wed Feb 09, 2011 7:28 pm
Posts: 14
Post Re: Autonomous Code
Well, as I was trying to figure out what it was, I downloaded it several times. And, yeah, it still doesn't work. :breakcomputer:


Fri Oct 28, 2011 2:11 pm
Profile
Expert

Joined: Mon Oct 27, 2008 9:59 pm
Posts: 137
Post Re: Autonomous Code
I have heard of others reporting issues with some of ROBOTC's incremental download feature not actually downloading the latest version of their program. I've never had issues with it, but to rule it you could make a large (noticeable) change to the program, re-download it, and do a sanity check that you see the change.

I don't have a good reason to believe this is your issue; I simply don't have any better alternative ones. :oops:


Fri Oct 28, 2011 3:05 pm
Profile
Rookie

Joined: Wed Jul 21, 2010 11:23 pm
Posts: 39
Post Re: Autonomous Code
I seem to recall that the initial release of RobotC V3 (i.e. V3.00) came out a couple of weeks before the FTC game was revealed, and that there was a note somewhere that I read saying that V3.00 wasn't fully compatible with the FCS.

I believe that V3.01 was released the same day as the FTC challenge, and that version was what teams needed to be using. Of course now it'd be V3.04 you'd want, but I'd definitely suggest moving up from V3.00 to see if that fixes the waitforStart problem.


Mon Oct 31, 2011 3:24 pm
Profile
Rookie

Joined: Wed Feb 09, 2011 7:28 pm
Posts: 14
Post Re: Autonomous Code
Thanks for the suggestion, we updated to 3.04 and it works now. :)


Tue Nov 01, 2011 3:05 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


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

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.