Hi. I found a code on github, that uses odometry, and has an auto-aim ability. I am wondering how I can implement this into my own code. I already have a working odom, but I am struggling with the auto aim part. I took the part from the github code, but I want to understand it and make it work before I redo it, because I do not copy code for competitions. I will attach a photo that will have the code. All I am trying to figure out is if I make it work like any other function, with it working with pressed(), and I also am trying to figure out what aac is and what I have to do with it. Thank you for the help!
I’m assuming you have an understanding of trig if you have odometry. The angle to the goal will be given by the equation tan^-1of difference in X/difference in Y. If you want to code it I recommend using atan2 as it takes into account quadrants.
Quick question, how accurate is your odometry? I’ve been working with some odom and it still gains ~0.2ft error after driving around the whole field.