you can now reset the IMU!
This commit is contained in:
@ -989,4 +989,11 @@ public class Follower {
|
||||
public DashboardPoseTracker getDashboardPoseTracker() {
|
||||
return dashboardPoseTracker;
|
||||
}
|
||||
|
||||
/**
|
||||
* This resets the IMU, if applicable.
|
||||
*/
|
||||
public void resetIMU() {
|
||||
poseUpdater.resetIMU();
|
||||
}
|
||||
}
|
||||
|
@ -86,4 +86,9 @@ public abstract class Localizer {
|
||||
* @return returns the turning ticks to radians multiplier
|
||||
*/
|
||||
public abstract double getTurningMultiplier();
|
||||
|
||||
/**
|
||||
* This resets the IMU of the localizer, if applicable.
|
||||
*/
|
||||
public abstract void resetIMU();
|
||||
}
|
||||
|
@ -5,7 +5,9 @@ import com.qualcomm.robotcore.hardware.HardwareMap;
|
||||
import com.qualcomm.robotcore.hardware.IMU;
|
||||
|
||||
import org.firstinspires.ftc.robotcore.external.navigation.AngleUnit;
|
||||
import org.firstinspires.ftc.teamcode.pedroPathing.localization.localizers.ThreeWheelIMULocalizer;
|
||||
import org.firstinspires.ftc.teamcode.pedroPathing.localization.localizers.ThreeWheelLocalizer;
|
||||
import org.firstinspires.ftc.teamcode.pedroPathing.localization.localizers.TwoWheelLocalizer;
|
||||
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.MathFunctions;
|
||||
import org.firstinspires.ftc.teamcode.pedroPathing.pathGeneration.Vector;
|
||||
|
||||
@ -336,4 +338,11 @@ public class PoseUpdater {
|
||||
public Localizer getLocalizer() {
|
||||
return localizer;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public void resetIMU() {
|
||||
localizer.resetIMU();
|
||||
}
|
||||
}
|
||||
|
@ -263,4 +263,10 @@ public class DriveEncoderLocalizer extends Localizer {
|
||||
public double getTurningMultiplier() {
|
||||
return TURN_TICKS_TO_RADIANS;
|
||||
}
|
||||
|
||||
/**
|
||||
* This does nothing since this localizer does not use the IMU.
|
||||
*/
|
||||
public void resetIMU() {
|
||||
}
|
||||
}
|
||||
|
@ -209,4 +209,10 @@ public class OTOSLocalizer extends Localizer {
|
||||
public double getTurningMultiplier() {
|
||||
return otos.getAngularScalar();
|
||||
}
|
||||
|
||||
/**
|
||||
* This does nothing since this localizer does not use the IMU.
|
||||
*/
|
||||
public void resetIMU() {
|
||||
}
|
||||
}
|
@ -306,4 +306,11 @@ public class ThreeWheelIMULocalizer extends Localizer {
|
||||
public double getTurningMultiplier() {
|
||||
return TURN_TICKS_TO_RADIANS;
|
||||
}
|
||||
|
||||
/**
|
||||
* This resets the IMU.
|
||||
*/
|
||||
public void resetIMU() {
|
||||
imu.resetYaw();
|
||||
}
|
||||
}
|
@ -283,4 +283,10 @@ public class ThreeWheelLocalizer extends Localizer {
|
||||
public double getTurningMultiplier() {
|
||||
return TURN_TICKS_TO_RADIANS;
|
||||
}
|
||||
|
||||
/**
|
||||
* This does nothing since this localizer does not use the IMU.
|
||||
*/
|
||||
public void resetIMU() {
|
||||
}
|
||||
}
|
||||
|
@ -289,4 +289,11 @@ public class TwoWheelLocalizer extends Localizer { // todo: make two wheel odo w
|
||||
public double getTurningMultiplier() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* This resets the IMU.
|
||||
*/
|
||||
public void resetIMU() {
|
||||
imu.resetYaw();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user