|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#2
|
|||
|
|||
|
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 ![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|