Go to Post This is real. This is hard. This, is FIRST. - sanddrag [more]
Home
Go Back   Chief Delphi > Other > FIRST Tech Challenge
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 30-11-2011, 18:43
gotrobot?'s Avatar
gotrobot? gotrobot? is offline
Head Coach
FTC #5037 (got robot?)
Team Role: Coach
 
Join Date: Sep 2011
Rookie Year: 2008
Location: Elgin, IL
Posts: 30
gotrobot? is a name known to allgotrobot? is a name known to allgotrobot? is a name known to allgotrobot? is a name known to allgotrobot? is a name known to allgotrobot? is a name known to all
[FTC]: FIXED: Random false starts in Autonomous

For RobotC:

Prior to our regional competition we were experiencing random false starts in our Autonomous program. It simply bypassed the built-in waitForStart(); command for no apparent reason. Eventually we narrowed it down to a combination of the LEGO color sensor and the HiTechnic motor controllers. With both of these enabled the program would randomly bypass the waitForStart(); function. With either one removed it waited for the FCS to issue the start.

Via the RobotC forums we were pointed in the direction of a modification that others had made to the pre-existing code within the joystick.c library. For them, the modification had fixed similar (but not identical) odd behavior related to the joystick packets. Adding the hogCPU/releaseCPU worked for us. No more false starts. If you experience anything similar to this we'd suggest adding this code to joystick.c before spending a long time trying other solutions. The two additional lines are the ones with the comments....


if (nNoMessageCounter > nNoMessageCounterLimit)
{
hogCPU(); //**************************************** take exclusive control
if (!bOverrideJoystickDisabling)
{
bTempUserMode = joystickCopy.UserMode;
bTempStopPgm = joystickCopy.StopPgm;

memset(joystickCopy, 0, sizeof(joystickCopy));

joystickCopy.UserMode = bTempUserMode;
joystickCopy.StopPgm = bTempStopPgm;
joystickCopy.joy1_TopHat = -1;
joystickCopy.joy2_TopHat = -1;
}
bDisconnected = true;
releaseCPU(); //************************** copying is done, relinquish control
}

Hope this helpful to someone.
__________________
2014-15 Cascade Effect: World Championship Inspire Finalist

www.facebook.com/gotrobot
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 18:54.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi