View Full Version : Auto-aming with vision
Priyesh69
23-01-2013, 18:59
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.
Blackphantom91
23-01-2013, 19:12
You use the set output of the the camera data in terms of x and y. no sensor needed.
Priyesh69
24-01-2013, 10:46
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
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 example 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!
Fifthparallel
25-01-2013, 14:55
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.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.