acmerobotics / road-runner-quickstart

FTC quickstart for https://github.com/acmerobotics/road-runner
BSD 3-Clause Clear License
168 stars 856 forks source link

lateralInPerTick is still not working #326

Open ftc19853 opened 7 months ago

ftc19853 commented 7 months ago

RR FTC Version

0.1.8

Observed Behavior

I left an issue, and it was partially resolved. Here is the second part of the question again: This still does not explain why it is ~300 ticks off. I don't think that all of that is lost from physical forces, because when calibrated it only moved around 18 inches when it was supposed to move 24. Here is the code:

public void runOpMode() {
        // Put initialization blocks here.
        MecanumDrive drive = new MecanumDrive(hardwareMap, new Pose2d(0, 0, 0));
        waitForStart();

        if (opModeIsActive()) {
          Actions.runBlocking(
              drive.actionBuilder(drive.pose)
                   .strafeTo(new Vector2d(0,24))
                   .build());
}

Tuning Files

N/A

Robot Logs

N/A

rbrott commented 7 months ago

This still does not explain why it is ~300 ticks off.

You mean that the forward and lateral ticks traveled differ by ~300 when moving the same set distance (say, ~24in)?

I don't think that all of that is lost from physical forces, because when calibrated it only moved around 18 inches when it was supposed to move 24. Here is the code:

If the lateral movement came up short, the lateralInPerTick number is too high. You need more ticks of the encoder to reach the desired position.

ftc19853 commented 7 months ago

does this mean I should not rely on the PushTest? Also, it is showing 3 in of error when running the opmode on the dashboard even though it is tuned for some reason. The error is wrong too though.

rbrott commented 7 months ago

does this mean I should not rely on the PushTest?

All of the automated tuners are guides, and you can definitely try to work around their limitations if you understand how the parameters work. The push tests are less trustworthy than the other tuners because the robot may move differently than when driving with motors.

Also, it is showing 3 in of error when running the opmode on the dashboard even though it is tuned for some reason. The error is wrong too though.

If you're using drive encoders, the commanded powers and localization are coupled. If the robot continually comes up short, you can try reducing inPerTick proportionally.

ftc19853 commented 7 months ago

I'll try re calibration and maybe try calculating it instead of the LateralPushTest. Currently we are redesigning our robot.