Thread: Line Following
View Single Post
  #2   Spotlight this post!  
Unread 31-03-2011, 22:25
youxinche95 youxinche95 is offline
Registered User
AKA: Eugene Che
FRC #0649 (MSET)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Saratoga, CA
Posts: 18
youxinche95 is an unknown quantity at this point
Re: Line Following

do you have a method that you can supply the cartesian x and y. I looked at your Drive method, and there is an arcadeDrive() that accepts an x and and y and a boolean... not sure what the boolean does, but oh well, it seems to be all set to false. I assume the line trackers are assembled in a linear fashion as in

FRONT
|
1 2 3
|
CENTER

Anyways, It looks as though you have a mecanum drive so you can strafe...

Anyways, try this pseudocode out.

double myX = 0;
double myY = 0.5; //some constant forward velocity
if(l1.get()) { //if a boolean returns true, ie the get(), go into if
myX -= 0.5; //0.5 is just some horizontal feed for motors.
if(13.get()) { //no need for == true
myX += 0.5;
if(l2.get()) {
myX /= 2; // close to lining up to line, so slow down
if(l1.get() && l2.get() && l3.get()) {
myY = 0;

arcadeDrive(myY, myX, false);

This was really quickly made, so I'm not sure if it will work... anyways, good luck
Reply With Quote