|
Re: Can someone explain 2010 Rotate To Target VI
The Rotate to Target subVI is provided with the target info. If there are zero identified targets, the setpoint will be initialized to zero degrees. If the target is found, it will be the absolute gyro position where the target is located.
When not initializing, the code uses the PID to determine the motor outputs and computes the error. When the error term is small enough, the robot is pointing at the setpoint, either zero degrees or the target. It leaves the loop because presumably you would like to kick, push, flail, or some other action. If there is an additional ball, you could then move to it, and execute similar code again, possibly by putting a loop around the code already there.
This is relatively simplistic, doesn't know how to trigger a kick, and assumes that when you are supposed to kick, it is better to kick to your end of the field (zero degrees), than to wait forever.
If you have additional questions about changing it, fire away.
Greg McKaskle
|