Go to Post note to self: do not use robot to retrieve cars from water. - Greg Marra [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Spotlight this post!  
Unread 31-08-2016, 12:23
wesleyac's Avatar
wesleyac wesleyac is offline
Registered User
AKA: Wesley Aptekar-Cassels
FRC #1678
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Davis, CA
Posts: 42
wesleyac is just really nicewesleyac is just really nicewesleyac is just really nicewesleyac is just really nicewesleyac is just really nice
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.
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 05:26.

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