I think the problem is that you don’t need to convert from ticks to meters. When you run the characterization tool, it generates values based on the wheel size relative to the number of ticks per rotation. Just use whatever unit you used for wheel size in the characterization tool.
This is correct. I’ll edit my previous posts to be accurate.
This code is automatically generated by the WPILIB Characterization tool:
double encoderConstant = (1 / ENCODER_EDGES_PER_REV) * WHEEL_DIAMETER * Math.PI;
leftEncoderPosition = ()
→ leftMaster.getSelectedSensorPosition(PIDIDX) * encoderConstant;
leftEncoderRate = ()
→ leftMaster.getSelectedSensorVelocity(PIDIDX) * encoderConstant *
10;
This is the same conversion we used in our code to get the velocity and position. I think we do need it for motion profiling. Removing it makes to robot move forward/backward rapidly. It probably thinks it moved about 200 meters in a fraction of a second.
When we measure diagonally (from the center of one wheel to the center of the diagonal wheel), We get 0.5842 meters, still a great difference to the 1.244222932233876 meter number from the tool. Could this number issue be why it doesn’t work?
I am currently looking through the troubleshooting guide. I will get back with results!
Whoops, less dramatic than I thought.
My point is that what the tool calls “track width” is a value that has to do with “how hard it is to turn”, and happens to be related to tank drive track width with standard traction wheels. I’d trust the characterizer and keep the large value.
Hah! That’s wierd!
Yeah. Looking at the troubleshooting guide, it seems like this is the right option.
The 1.2 meters figure seems suspicious to me, as well; if it is wrong, it won’t have any effect on a straight trajectory, but it would result in possibly-severe over-steering on a curved path (which the ramsete controller will then attempt to fix).
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.