Line Follow in Teleop

I recently saw the video from team 1678 that shows them pressing a button, and the robot drives forward, finds the line, and drives to the T. I have been thinking about it, and am wondering how they did it. I think that you just need to take the line following code from the autonomous vi, and put it in a case structure in the teleop vi. Does this sound correct? I’m wondering if they changed anything in order to make it drive straight to the line, rather than spin in circles.
I’m not looking to steal their code and awesome work. I just think this could be of some help to our team, and would like to know how they did it.

That sounds exactly what I’d do.

Of course, if you were using the “independent” autonomous, you’d have to change it to “iterative” so that robot main keeps looping. You’d also have to figure out a way to turn it off, although a simple toggle switch for either on or off would work nicely.

And assuming that your normal autonomous doesn’t turn in circles, I don’t see why the same code in teleop would.

What do you mean by making it iterative? Also, why would i want to toggle it off? The line following code ends at the T

last year they had it so that you could use autonomous “independent” or “iterative” so I keep using those terms…

Basically, independent means it gets called once, so you have your own loops inside of it, and iterative means it has a while loop around it, just like teleop.

I was just gonna copy the line following code from the standard autonomous independent vi, and put it in a case structure attached to a button. What do you think of that?

Whatever code in autonomous works should work in teleop. Remember to raise the arm though.

So do i need to make it iterative, or can i just do what i said before? I’m sorry i keep asking, but it is confusing. I’m a labview newbie

Without seeing anything, I would think your auton code should just fine based on a button press in teleop, if you aren’t using any loops in that auton code. If you are, then you’ll need to rewrite line-tracking to take into account the while loop that encompasses all of teleop.

It would just be the line following code from the autonomous vi without any changes done. I think it is all inside one large while loop

I would keep the while loop and just have it be in a case structure that only executes it when the button is pressed and then have another button inside that while loop connected to the loop stop in case the robot happens to go off course during a match or you need to do something else, like say deploy a mini-bot, you don’t want to be stuck hanging a tube worth at most 6 points vs a minibot worth AT MINIMUM 10 do you?

I wouldn’t rely on the E-Stop to stop it since that requires a hard reset, at least in my teams experience, which is a little too over-excessive IMO.

But be aware it will only work for the middle pegs on the straight and the left halve right column and right halve left column for the Y. You will still have to manually control it for the other columns.

That is pretty much how i put it in the code. I didn’t even think of an off button though, so I should probably do that. Thanks