View Single Post
  #4   Spotlight this post!  
Unread 10-02-2011, 09:20
MaxMax161's Avatar
MaxMax161 MaxMax161 is offline
Allegedly Useful
AKA: Max Llewellyn
FRC #2791 (Shaker Robotics), FRC #1676 (Pascack π-oneers)
Team Role: Mentor
 
Join Date: Nov 2009
Rookie Year: 2008
Location: Montvale NJ\Troy NY
Posts: 174
MaxMax161 has a reputation beyond reputeMaxMax161 has a reputation beyond reputeMaxMax161 has a reputation beyond reputeMaxMax161 has a reputation beyond reputeMaxMax161 has a reputation beyond reputeMaxMax161 has a reputation beyond reputeMaxMax161 has a reputation beyond reputeMaxMax161 has a reputation beyond reputeMaxMax161 has a reputation beyond reputeMaxMax161 has a reputation beyond reputeMaxMax161 has a reputation beyond repute
Re: Line Following Help

If you're a new programmer, or at least new to LabVIEW, I would recommend totally ignoring the default autonomous code. Our programing team looked at it and then decided, this doesn't make any sense, lets write our own.

We mounted our sensors in a triangle that we placed in the front of the robot, so that one was about 2.5'' more forward then the rest. The code was actually very simple. We had a loop feeding 0.5 for both joystick values into our drive.vi until "left sensor" OR "right sensor" OR "middle sensor" was tripped.

Then it moved in to another loop that feed 0.8 for both joystick values in to our drive.vi; however when the left sensor was tripped the left value dropped to 0.5, and visa versa. We did this by arraying the boolens we got from the sensors, turning then in to a number, and then feeding the number in to a case statement that contained the constants we feed in to the drive.vi as the joystick values. This loop would stop when any combination of sensors that wasn't just the left or just the right was tripped.

This followed the line GREAT and stopped when it got to the end. It's simple (don't worry it's much easier to see then to say), easy to debug, and above all works really well.
__________________
2791 Shaker Robotics (2013-present)
--Control Systems Mentor 2013-present
--Drive coach 2015-present

1676 The Pascack π-oneers (2010-2013)
--Drive coach 2011-2013
--Lead Programmer 2011-2013
Reply With Quote