I would look into this, specifically wpilib’s chassisspeeds.discretize(). I can give you help with implementation too if you need.