DeepBlueRobotics / RobotCode2024

Other
4 stars 1 forks source link

Wrong distance units for TOF game peice detection #33

Closed FriedLongJohns closed 8 months ago

FriedLongJohns commented 8 months ago

In ImplementedOuttake:

    private double getGamePieceDistanceIntake() {
        return Units.metersToInches((intakeDistanceSensor.getRange() - DS_DEPTH_INCHES) / 1000);
    }

    private double getGamePieceDistanceOutake() {
        return Units.metersToInches((OutakeDistanceSensor.getRange() - DS_DEPTH_INCHES) / 1000);
    }

So we're getting the inches, dividing by a thousand, and then converting it by the meter-to-inch factor?

Iunno about you but I don't think mili-inch inch-meter is a useful unit to be using.

Juliaaaahhhh commented 8 months ago

CHANGES: get Range is in milimeters so * 1000 for meters and then subtract DS depth but changed to meters as well 954db7a0a8ad7222647e0f516690b9a2377e8593