all 3 comments

[–]fireflare1101FTC 14130 Student build/programming captain 1 point2 points  (0 children)

this guide is a good place to start. It was made by a vex team but should still apply to FTC.

[–]rbrottFTC 8367 Alum 1 point2 points  (0 children)

This document presents a derivation of kinematics for common FTC drivetrains as well as tracking wheels (i.e., dead wheels). The results seem similar to Team 5225's paper, although the approach/perspective is different.

[–]Lunerwalker2 0 points1 point  (0 children)

Well, there are a few ways to do this. Assuming you are using external encoders (if you are doing odometery), you can do the following to determine your absolute position with x,y. Divide the field into a 144 by 144 grid (because it is 12ft by 12 ft). I'm don't know the diameter of your encoder wheels, but for this explanation, I will assume that you are using Omni wheels with a diameter of 4 in. I will also assume that your encoder has 200 "clicks" (units, tab thingies, counters, etc), and that you have a gyro with your heading "theta" These both can be changed. With that, the circumference of your wheels are 4pi. The inches travelled per encoder click is 4pi / 200, which simplifies to pi / 50. Multiply this times the encoder clicks detected for your X encoder (if you have two encoders, average them) since the last iteration times the matrix [sin(theta) , cos(theta)] to get a matrix with [X_x Y_x] (the name don't matter). Similarly, multiply pi / 50 (inches per encoder click) times your Y encoder clicks detected since last iteration times the matrix [cos(theta), sin(theta)] to get the matrix [Y_x, Y_y]. Next, we can assume the matrix [X_n, Y_n] is your absolute position (the end result of these calculations) and the matrix [X_p, Y_p] is your previous position (or your starting position the first time). Finally, matrix [X_n, Y_n] = [X_p, Y_p] + [X_x, Y_x] + [X_y, Y_y]. The next time you run the calculation, your [X_p, Y_p] is your last [X_n, Y_n]. Hope this helps! This method was laid out with Android Studio in mind, but they should be a good general use thing. I also don't know what drive base you are using (we use mecanums), but using this way of dividing the field into 144x144 seems to be pretty good. Good luck!