|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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();
}
}
Thank you so much for your help. |
|
#2
|
|||
|
|||
|
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. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| WPILib and Eclipse | Guy Davidson | Programming | 31 | 04-02-2008 04:59 PM |
| WPILib Op. Control mode | Dkim | Programming | 3 | 02-10-2007 09:19 AM |
| WPILib Questions | Kruuzr | Programming | 1 | 01-22-2007 11:46 AM |
| Using WPILib on a Vex robot | koenig3456 | Programming | 2 | 05-02-2006 02:56 PM |