Log in

View Full Version : line sensing code


jackdawg
17-02-2011, 18:54
i have been looking at the default line sensor code and i cant seem to make heads or tails of it. has anyone written it from scratch? is it difficult to figure out??

also what do people think about it? is it like the vision tracking of previous years (not very helpful and a pain to get to work)?

my thought is that a much simpler autonomous would be easier. (ex. go forward, deploy arm, place tube on rack)

thanks in advance

-Wyatt C FIRST Team 1307

GunfighterJ
17-02-2011, 19:49
It's quite easy. If you know how to wire it up to the digital side car then you can just open 3 digital inputs and get teh value of them in boolean format. After that you can use case structures or use "boolean to (0,1)" to tell the drive motors to go left, right, or stop.

Alan Anderson
17-02-2011, 23:13
i have been looking at the default line sensor code and i cant seem to make heads or tails of it. has anyone written it from scratch? is it difficult to figure out??

National Instruments provides a very helpful Line Following Tutorial (http://decibel.ni.com/content/docs/DOC-14730) that explains its operation.

kinganu123
17-02-2011, 23:26
i have been looking at the default line sensor code and i cant seem to make heads or tails of it. has anyone written it from scratch? is it difficult to figure out??

The default line sensor code essentially determines how to run the bot every some amount of seconds. That is either by goin forward full force, or turning and goin sideways
I'd suggest using a truth table, as the guide on NI suggest
Only problem is tat it makes the bot zigzag a lot over the line

Triapod
18-02-2011, 09:42
Go to FRC Mastery. There is a breakdown of the code.