Thread: Line Following
View Single Post
  #3   Spotlight this post!  
Unread 01-04-2011, 11:46
pigpc1993 pigpc1993 is offline
Registered User
AKA: Colin Feeney
FRC #3716 (WARP)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2009
Location: Manhasset, NY
Posts: 41
pigpc1993 is an unknown quantity at this point
Re: Line Following

Quote:
Originally Posted by youxinche95 View Post
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
Thanks for the help. I don't know much about the drive. Right now we are using a kitbot so we can finish up the code so we can apply it all at the competition. I'll let you know how it goes. Thanks again.
Reply With Quote