Understanding the Autonomous.vi

So I’m looking at the Autonomous.vi, and I simply do not understand how to wire everything on the robot, to it’s specifications, or how it works. I’d like to know how the sensor are supposed to be mounted on the bot such that it will work. In addition to that i need to know where in the code you would put controls other than for the line senseing portion.

Any help for a terrible programmer would be greatly appreciated.

Have you read the NI Tutorials, especially the “Line Following Tutorial” and the “Timed Movement VIs for Autonomous Mode Tutorial” or watched the videos at frcmastery.com especially “Step 5 - Turn on Autonomous Mode” and “Exploring the default autonomous code”?

No I had not, thank you very kindly for directing me at them. I’ll post something more if I still manage to have questions.

I’d definitely suggest erasing what they have and using it as a refrence to how to wire things. The way to do it is to write what exactly you want each motor to do when each combination of light sensors are pressed. From there, it’s quite easy to wire up a few case structures to make it happen.

Note: Instead of stacking a bunch of case structures for all the different sensor values, it’s much easier to put all the outputs of the digital IO into a build array function. Then put a boolean array to number on that, and wire the number into a single case structure. Then use binary to decimal conversion to figure out which number means which set of sensors – for example, if the number is a 6, the second and third sensors are pressed (second and third in the array, that is).

However, if you want to use the default, that’s fine, but I find that they added a bunch of really confusing things to it, like having options to follow either the left or right lines (who cares?)

You’ve given this advice several times, and I’m not sure that it is as helpful as you think it is. A number of the techniques you are telling others to program are demonstrated by the default code. If you want to give advice on how to improve or simplify auto code, I think that would seem far more helpful.

Congratulations if you are capable of writing the code from scratch, but not all teams are. Keep that in mind when giving advice.

Greg McKaskle

I completely agree with Greg. You keep giving the same advice as if each team is capable of carrying it out word for word. Some teams don’t even know how to deploy a project, let alone re-write a whole vi.

on topic - I would suggest watching the frcmastery video and then reading the paper. The frcmastery really helps A LOT when understanding what the heck is going on in that code. We got ours sort of working, just have to tweak it now ;).