|
Re: Auto-Aligning in Teleop
As adciv mentioned, placing things in teleop periodic is a Bad Idea. People tend to say that TeleopPeriodic and AutonomousPeriodic run at 20Hz, but they actually run whenever they get a packet from the driver station, which is *usually* approximately 20Hz. The result of this is that they have significant delays in when they're executed.
Ideally, the only things that you should do in your periodic functions is to check for new joystick values. If you're using C++ or Java, you should have a separate thread for your PID controller, so that you can easily control what frequency it runs at.
Once you have a PID controller running in a separate thread, you should see much more consistent results between auto and teleop.
If you let me know what language you're using, I can point you towards more resources for implementing a separate thread for your controller.
EDIT: This post is assuming that everything but the code that's running is the same. Jared Russell gave some good advice on figuring out if that's the case above.
__________________
Quote:
|
Originally Posted by The programming team
Define "works."
|
Last edited by wesleyac : 31-08-2016 at 12:37.
|