Finding correct motor speeds to follow a path

Im trying to make a new limelight auto drive. I need to figure out the math behind setting the correct motor speed for each side of the robot to follow a path. Can anyone help?

How do i calculate the speed for each side of the robot?

I would take advantage of the plethora of new trajectory generation and following utilities built in to WPILib. From a generated trajectory, via inverse kinematics, it can tell you velocities for the left and right sides of your drive train.

However, the harder question I think is how to know the position of the target, relative to the robot, via the Limelight. You could take advantage of the solvePnP built into the Limelight but I’m not sure how accurate that is. Also what exactly do you need the robot to do? Do you need it to drive such that it drives all the way to the target and is perpendicular with it, or do you simply need to rotate to face the target (e.g if you’re shooting something at the target)? You would probably want the former if this is an inner port shot for this year’s game.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.