View Single Post
  #2   Spotlight this post!  
Unread 29-01-2011, 19:43
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Rookie + errors = fail()

For more detail behind why the code was written that way, you may want to review the tutorial at http://decibel.ni.com/content/commun...#/?tagSet=1001 in the lower right. It is the one about line following.

To directly answer your questions. The lists of numbers are an array of power values. These are used to vary the speed of the robot for different parts of the line. Generally, the idea is to go pretty fast at the beginning, slow down for any curves and for the T at the end of the line. Since the default code cannot assume a distance encoder, the power array is indexed using elapsed time.

The one labeled Straight Power is used for the straight line, and the Y power is used with following either the left or right of the line with the Y fork.

The steering gain determines how much the robot steers to the left or right. Since the line sensors return a Boolean signal, the robot has four basic responses -- go left, go right, go straight, or stop. As the steering gain is made larger, the robot will steer more sharply and "bounce" from side to side, over-correcting. As the number is reduced closer to zero, the robot will steer more gently and at some point will under-correct.

My advice would be to focus on the teleop first. Use either the arcade or tank drive and think through the issues until you have forward, backward, left steer and right steer working correctly. At that point, you should be able to tune the auto. If you have more issues, post questions here.

Greg McKaskle
Reply With Quote