Go to Post You do know that totes are supposed to go through the chute right? Not humans? - themccannman [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 19-01-2008, 16:12
RyanW RyanW is offline
Registered User
FRC #0449 (Blair Robot Project)
Team Role: Programmer
 
Join Date: Feb 2007
Rookie Year: 2007
Location: MD
Posts: 40
RyanW has a spectacular aura aboutRyanW has a spectacular aura about
Using WPILib

To get our Ultrasonic sensor to work properly, our team started using WPILib. It works great, and we've also managed to successfully port our four different drive methods. However, I have some concerns about the autonomous period. So far, it looks like that method Autonomous() is only called once. First of all, is this the case, and should it be working that way? If not, is it a hardware or programming issue (we're using an old board and OI, and a not-quite-working competition switch, so it could be either)?

To resolve this problem, in our Autonomous method we're adding a loop as follows:
Code:
autonomous(void){
     while(IsAutonomous()){
          DoSomething();
     }
}
I've been reading on Chief Delphi that if a loop goes on for too long, it can time out and disable the robot. Will that happen here, or does WPILib itself take care of switching between the method and sending/receiving info? If so, anything I can do about it?

Thank you so much for your help.
  #2   Spotlight this post!  
Unread 19-01-2008, 17:15
dcbrown dcbrown is offline
Registered User
AKA: Bud
no team
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Hollis,NH
Posts: 236
dcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud of
Re: Using WPILib

The Getdata in WPILIB is done at interrupt level as part of the system clock. This prevents the master processor from shutting you down and allows the user code to loop essentially forever without having to periodically check for new rx data packets.

As part of the same system clock interrupt service routine, when autonomous period ends, then the code forces a warm reboot and this automatically kicks the code out of autonomous code and restarts the code back through main. So the autonomous routine should be able to loop forever and appear never to return on its own via a coded return path.

At least that is how I remember it when I last looked at it.
Closed Thread


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
WPILib and Eclipse Guy Davidson Programming 31 02-04-2008 16:59
WPILib Op. Control mode Dkim Programming 3 10-02-2007 09:19
WPILib Questions Kruuzr Programming 1 22-01-2007 11:46
Using WPILib on a Vex robot koenig3456 Programming 2 02-05-2006 14:56


All times are GMT -5. The time now is 23:17.

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