X-Drive directional drive control code release (kind of)

I’ll keep this condensed into different dropdowns for different questions.

units

This is correct. There are no real units like voltage or RPM, the range of -1 to 1 was used because you could just multiply the value by the max rpm, percentage voltage, or whatever you feel like using. You may have missed what I said in my last post, which I do not blame you for as it was rather long.

interpolation

This is correct. Instead of facing towards your target and then moving, you start moving towards it and rotating to your target rotation at the same time, similar to moves showcased here: (although with an x-drive and not mecanums ofc)
https://www.youtube.com/watch?v=S9eCk-3m7do&feature=youtu.be&t=31

turning ratios

There are plenty of ways to go about this. You could face the target point until close enough and then face your target rotation. This “golden ratio” so to speak ratio would look nice, but it it is not necessarily the fastest. (What if it is facing diagonally relative to the point and ends up driving there with just two motors?)

pid

Glad you got it! Probably should have made the importance of Smore clear, in hindsight. Even odometry and all this fancy directional trig will be useless without well-tuned PID. (At least for precise movements.)

P1, P2 , and s

P1 and P2 are the values calculated for just movement. P1 is for front right and back left wheels, P2 is for the front left and back right wheels. These serve as the “V1” values when interpolating from movement to rotation.
s is set to the larger of the two values P1 and P2 so that both can be divided by s later. This ensures that the largest P value is equal to 1 (or to the global var S, since s gets divided by S)

Your final conclusion is correct. :+1::+1::+1::+1:



The only things I can think of would be 5225A’s position tracking document, which I’m sure you’ve already read, or the YouTube channels 3Blue1Brown and Numberphile.