We finally got the vision traking working. We are getting the distance and other info of the top rectangle. Now we want a motor to ajust the angle of the shooter from the distance that we are. I know the output of the motor is going to be link to pid and we never used one of those so what do we do. Do we need any sensor for an auto-aim system. Some would be nice for getting through the next step.
You use the set output of the the camera data in terms of x and y. no sensor needed.
since the x and y data is changing it’s not a constant so with what i link the output of the motor. A small exemple would help
Here, this is how I’d attack that piece of code, minus the WPI stuff. I don’t now exactly great the angle adjustment would work, but the distance-RPM adjustment is proven.
Though I would put the bang-bang controller in an explicitly timed loop in periodic tasks, and run globals (for the target RPM) to it from autonomous and teleop. If you do that ABSOLUTELY do not forget to send a 0 to it while in disabled mode or you’ll wonder why your shooter wheel never stops.
Hope this helps, and good luck!
Using Vision Data Example.vi (14.8 KB)
Using Vision Data Example.vi (14.8 KB)
As far as making sure your turret is actually in the correct place, we will be using a Complementary filter with the ADXL345 accelerometer and gyro with encoders for the turret to actually handle the angle measurement. Hope this helps.