Quote:
Originally Posted by Charlie
Ok so now that the season is over would any of you that programmed in labview be willing to send me the code for tracking? i could never figure out how to track properly.
|
We were in C++, but our general idea could be adapted to Labview:
You need a gyro and the camera
1) Set up a PID controller to maintain your robot's heading at some set target (sensor input: gyro. setpoint input: some variable, let's call it targetHeading. PID output: a virtual joystick's x axis).
2) Whenever the camera detects a target, set targetHeading to (your current heading + angle offset that the camera sees the target). The robot will point itself at the target.
Having a PID heading controller is also useful if you want to run along the side of the field against the wall to pick up balls. With human control, robots tend to spin off because of the higher-grip carpet. With a heading controller, it automatically adjusts your motor's power levels to maintain its orientation relative to the wall, allowing for long runs of picking up the balls that gather on the outside of the field.