Go to Post You need to stay on top of your classes or you will be back as a returning freshman on next year's team. - [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
  #1   Spotlight this post!  
Unread 21-02-2012, 06:50
tinyclark tinyclark is offline
Registered User
AKA: Matt Clark
FRC #0228
 
Join Date: Jan 2012
Rookie Year: 2007
Location: Wallingford, CT
Posts: 9
tinyclark is an unknown quantity at this point
Jittery Autonomous Code {Java}

In autonomous, i try to run the following code:
Code:
try {

            encLeft.start();
            encRight.start();
            encLeft.reset();
            encRight.reset();

            while (((encLeft.getRaw() > -14797) || (encRight.getRaw() > -14797)) && (this.isAutonomous())) {
                //System.out.println("Left:" + encLeft.getRaw() + " Right:" + encRight.getRaw());
                if (encLeft.getRaw() < 14797) {
                        motor_leftFront_J.setX(.5);
                        motor_leftRear_J.setX(.5);
                } else {
                    motor_leftFront_J.setX(0);
                    motor_leftRear_J.setX(0);
                }
                if (encRight.getRaw() < 14797) {
                        motor_rightFront_J.setX(-.5);
                        motor_rightRear_J.setX(-.5);
                } else {
                    motor_rightFront_J.setX(0);
                    motor_rightRear_J.setX(0);
                }
            }
            Timer.delay(.5);
            encLeft.reset();
            encRight.reset();
}catch(Exception e){
}
The output this produces is a very jittery running of the code, as if it sends the commands, and then immediately after sends it a stop command, following which it repeats. The teleop code works fine, so i know that it is updating the output frequent enough, and it never catches any errors... Any thoughts? Thanks
~Matt Clark
 


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 20:19.

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