Wheel speeds from joystick positions
- Easier than it looks
- Sum and difference, min and max
- -1 <= x <= +1; -1 <= y <= +1
- left = y+x, normalize to -1..+1 range
- right = y-x, normalize to -1..+1 range
- Examples:
- Stick centered: x = 0, y = 0 gives
left = 0, right = 0, dead stop
- Stick fully forward: x = 0, y = 1 gives
left = 1, right = 1, full speed forward
- Stick fully down: x = 0, y = -1 gives
left = -1, right = -1, full speed backward
- Stick full right: x = 1, y = 0 gives
left = 1, right = -1, hard clockwise spin
- Stick slightly right of full foward: x = 0.1, y = 1
gives left = 1, right = 0.9, slight right drift
- Continuous functions
- Easy to calculate with 8-bit integers
- In fact, I boil it down to four-bit integers
- Mapped through curves
- Broken down into 8-bit speed and "backwards" bit
This page works best with Lynx.
mail me
or go home.