Go to Post Tinted safety glasses and ice cream cones allowed in the pits? What else could go wrong!?! - logank013 [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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
  #13   Spotlight this post!  
Unread 28-02-2014, 23:50
mwtidd's Avatar
mwtidd mwtidd is offline
Registered User
AKA: mike
FRC #0319 (Big Bad Bob)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 2003
Location: Boston, MA
Posts: 714
mwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond repute
Re: URGENT:Auto Problem trying to fix before tomorrow

Quote:
Originally Posted by miw14 View Post
Hmm... I think I may have figured out the problem. Would I also need to have the setSafetyEnabled method with the shooter object and the driver object?
I feel like that is the problem. When I changed the timer delays between on shooter and off shooter, it had not effect. I wonder if the setSafetyEnabled method has anything to do with that.
Ideally you wouldn't disable the safety enable. Now, given that you're at comp, i'm not going to suggest enabling it at this point. However, we can rearrange your code to ensure that the drive is updated enough.

Time is in milliseconds. Unlike other programming platforms, the crio really does not like long delays. Thus it's better for you to manage time, and adjust your motor outputs based on time.

Code:
public void autonomous() { 
        myDrive.setSafetyEnabled(false); 
        
        long startTime = System.currentTimeMillis();
        
        while(isAutonomous() && isEnabled()){
            long timePassed = System.currentTimeMillis() - startTime;
            if(timePassed < 3500){
                myDrive.drive(-.5, 0.0);
            }else if (timePassed < 5000){
                myDrive.stopMotor();
            }else if (timePassed < 8500){
                startRaisingLauncher();
            }else{
                stopMovingLauncher();
                //stopAll();
            }
            Timer.delay(0.01); 
        }
        
        stopAll();
    }
__________________
"Never let your schooling interfere with your education" -Mark Twain
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 13:03.

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