|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Autonomous Inconsistencies
We're coding an Autonomous mode in preparation for our next regional, and we're running into a very odd issue. We have our code set up so that it calls methods into the autonomous code (i.e. drive() would make it drive forward a set number of encoder rotations).
The issue that we're having is that when we enable the robot to run Auto, it acts unpredictably. Say, one time it would do it perfectly, but the next it would turn for a different number of degrees, or drive for a different distance, while running on identical code. We have tried resetting the code and the roboRio, as well as checking the encoder values in Teleop. At least in Teleop, the encoders seem to be working fine. Has anyone encountered this problem before, or has a solution for it? Thanks |
|
#2
|
|||
|
|||
|
Re: Autonomous Inconsistencies
Quote:
|
|
#3
|
||||
|
||||
|
Re: Autonomous Inconsistencies
What kind of Drivetrain do you have?
How are you driving? Are you using a PID loop or just driving until the encoders read a large enough value or what? |
|
#4
|
|||||
|
|||||
|
Re: Autonomous Inconsistencies
I would try printing the encoder count to the smart dashboard on a heartbeat (perhaps 0.1 or 0.5 sec, depending on how fast you're going) and compare the results of the trials that work vs the ones that don't. There should be some sort of clue there.
Also, presuming that you are driving this on some variant of tank, you need to ensure that the counts of the two sides increase together. If one is getting ahead of the other, slow that side down a notch. Otherwise, you'll wind up curving off course, though the robot should straighten out to the correct orientation at the end if it hasn't hit anything. |
|
#5
|
||||
|
||||
|
Re: Autonomous Inconsistencies
Check how you're treating the encoder during TeleopInit and TeleopPeriodic, are you reseting it in teleopinit and not autonomous init?
|
|
#6
|
||||
|
||||
|
Re: Autonomous Inconsistencies
Post your code?
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|