Go to Post You can build bridges, or you can burn them. The choice is yours. - dlavery [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 26-03-2012, 22:30
SuperBK's Avatar
SuperBK SuperBK is offline
Registered User
AKA: BrianK
FRC #1225 (Amperage Robotics)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Henersonville, NC
Posts: 357
SuperBK is just really niceSuperBK is just really niceSuperBK is just really niceSuperBK is just really nice
Motors stop running in autonomous

We ran into a little issue with running motors in autonomous at the Palmetto regional. We know about the watchdog for the robot and the motor safetly timers. We disabled the watchdog and set the expiration timeout for the motors, but still sometimes the motors would shut off before the time was up. It seems to happen more on the fields than in the pits, but it did happen in the pit when tethered as well. Our code is similiar to this. I don't have access to it, the laptop is locked up at the school.

My question is if we set the expiration, can't the code delay that long before updating the drive setting? That is before the "drive isn't updated often enough" message?

This didn't always run the full 2 seconds:
Code:
myRobot.SetExpiration(6); // set MotorSafety expiration
myRobot.Drive(0.6, 0.0); 
Wait(2.0); // wait 2 seconds while driving
myRobot.Drive(0.0, 0.0);
To get around this we implemented a loop that keept calling myRobot.Drive() for the time required. Something like:
Quote:
Timer timer;
timer.Reset();
timer.Start();
while (timer.Get() < 2.0)
{
myRobot.Drive(0.6, 0.0);
}
myRobot.Drive(0.0, 0.0);
__________________
Brian K
Team 1225 Robotics Mentor
Reply With Quote
 


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 17:36.

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