View Single Post
  #2   Spotlight this post!  
Unread 04-02-2014, 21:36
Pault's Avatar
Pault Pault is offline
Registered User
FRC #0246 (Overclocked)
Team Role: College Student
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Boston
Posts: 618
Pault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond reputePault has a reputation beyond repute
Re: How to Make the Robot Drive Forward in Autonomous

You use the same subsystem.

Add the following method:

Code:
public void driveAuton(double speed, double turnRate)
{
	drive.arcadeDrive(speed, turnRate);
}
You can then call this method in a command that you make for autonomous. Feel free to use the turning feature too, although don't expect to get much accuracy with it (actually, don't expect to get much accuracy with this method at all).

To implement timing is also pretty simple. In the init of your command, type: setTimeout(timeToRun); (replace timeToRun with the amount of time you want to drive forward. Then, in the isFinished of your command, type: return isTimedOut();
Reply With Quote