View Single Post
  #1   Spotlight this post!  
Unread 28-03-2014, 18:43
alexander.h's Avatar
alexander.h alexander.h is offline
Lead Programmer, Captain, Driver
FRC #3975 (The Dragons)
Team Role: Programmer
 
Join Date: Aug 2013
Rookie Year: 2012
Location: Montreal, Quebec, Canada
Posts: 261
alexander.h has a spectacular aura aboutalexander.h has a spectacular aura aboutalexander.h has a spectacular aura about
Beginner Java Help - Question 1

Hello! I'm new to Java (we're planning to switch to it next year after passing the last three years using Labview) and I have one important question. In the "Getting Started with Java for FRC" pdf, it shows the following code for an autonomous that drives in a square pattern by driving half speed for 2 seconds, then turns 90 degrees. This is repeated 4 times :

Code:
public void autonomous() { 

     for (int i = 0; i < 4; i++) { 
          drive.drive(0.5, 0.0); // drive 50% fwd 0% turn 
          Timer.delay(2.0); // wait 2 seconds 
          drive.drive(0.0, 0.75); // drive 0% fwd, 75% turn 
       } 

     drive.drive(0.0, 0.0); // drive 0% forward, 0% turn 
}
What I don't understand is why it's a 75% turn for a 90 deg turn? Is there some way this was calculated?

Thanks!

P.S. I called this "Question 1" because I know that I will have other questions about Java in the future!
__________________



2012 - Rebound Rumble - Montreal Robotics Festival - Qualified 15th - Semifinalists thanks to 3379 and 3710 (Record : 8-8-1)
2013 - Ultimate Ascent - Montreal Robotics Festival - Qualified 33rd - Dean's List Finalist : Yazid Djenadi (Record : 4-8-0)
2014 - Aerial Assist - Montreal Robotics Festival - Qualified 9th (Record : 6-4-1)
2015 - Recycle Rush *** I predicted the game ***

Reply With Quote