How would I calculate the current velocity of the robot using encoders in inches/second?
Essentially, you take the encoder count per second, and divide by the number of encoder counts per revolution* and multiply by the diameter of the wheel. In practice, the simplest solution depends on whether you’re using the RIO or a motor controller (SRX or Jaguar) to keep track of the encoder, and what language you’re using.
- Edit - This is revolutions of the wheel; divide by the gearbox ratio if your encoder is on the motor shaft rather than the gearbox output shaft.
I am using a rio and java.
How do you find the encoder count per second and per revolution? Sorry I am a bit of a noob.
Use Encoder.getRate(), assuming you’re using java.
How about encoder count per revolution?
You need to get the encoder counts per revolution from the documentation for your encoder.