Go to Post All labor is donated by the webmaster "Brandon". - Mike Martus [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
  #3   Spotlight this post!  
Unread 18-02-2014, 22:37
NWChen's Avatar
NWChen NWChen is offline
Alum
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: New York City
Posts: 205
NWChen is a splendid one to beholdNWChen is a splendid one to beholdNWChen is a splendid one to beholdNWChen is a splendid one to beholdNWChen is a splendid one to beholdNWChen is a splendid one to beholdNWChen is a splendid one to behold
Re: Autonomous

Quote:
Originally Posted by Dinnesy View Post
Your autonomous function should look like

Code:
 
public void autonomous() {

     while(isAutonomous()){  //Place everything in a loop.
        robotDrive.drive(0.5,0.0);//drive at 50% speed 0% turn
        Timer.delay(5.0);//wait 5 seconds
     }
You don't need to iterate in autonomous; assuming you have a sequence of statements (e.g. drive forwards, stop, shoot) they should only execute once each. Look at this example.

Try the following instead:
Code:
public void autonomous() {
        robotDrive.setSafetyEnabled(false);
        robotDrive.drive(0.5,0.0);//drive at 50% speed 0% turn
        Timer.delay(5.0);//wait 5 seconds
}
When setSafetyEnabled is true (by default it is), the robot won't drive if the code continues for too long. That's probably causing your robot to stop entirely after ~0.1 seconds.

Last edited by NWChen : 18-02-2014 at 22:40.
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:23.

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