ThreeWheelIMULocalizer

public class ThreeWheelIMULocalizer extends Localizer

This is the ThreeWheelIMULocalizer class. This class extends the Localizer superclass and is a localizer that uses the three wheel odometry set up with the IMU to have more accurate heading readings. The diagram below, which is modified from Road Runner, shows a typical set up. The view is from the top of the robot looking downwards. left on robot is the y positive direction forward on robot is the x positive direction forward (x positive) △ | | /--------------\ | | | | | || || | left (y positive) <--- | || || | | ____ | | ---- | \--------------/

Author

Logan Nash

Anyi Lin - 10158 Scott's Bots

Constructors

Link copied to clipboard
public void ThreeWheelIMULocalizer(HardwareMap map)
This creates a new ThreeWheelIMULocalizer from a HardwareMap, with a starting Pose at (0,0) facing 0 heading.
public void ThreeWheelIMULocalizer(HardwareMap map, Pose setStartPose)
This creates a new ThreeWheelIMULocalizer from a HardwareMap and a Pose, with the Pose specifying the starting pose of the localizer.

Properties

Link copied to clipboard
public static double FORWARD_TICKS_TO_INCHES
Link copied to clipboard
public final IMU imu
Link copied to clipboard
public static double STRAFE_TICKS_TO_INCHES
Link copied to clipboard
public double totalHeading
Link copied to clipboard
public static double TURN_TICKS_TO_RADIANS
Link copied to clipboard
public static boolean useIMU

Functions

Link copied to clipboard
public double getForwardMultiplier()
This returns the multiplier applied to forward movement measurement to convert from encoder ticks to inches.
Link copied to clipboard
public IMU getIMU()
This is returns the IMU.
Link copied to clipboard
public double getLateralMultiplier()
This returns the multiplier applied to lateral/strafe movement measurement to convert from encoder ticks to inches.
Link copied to clipboard
public Pose getPose()
This returns the current pose estimate.
Link copied to clipboard
This calculates the change in position from the perspective of the robot using information from the Encoders.
Link copied to clipboard
public double getTotalHeading()
This returns how far the robot has turned in radians, in a number not clamped between 0 and 2 * pi radians.
Link copied to clipboard
public double getTurningMultiplier()
This returns the multiplier applied to turning movement measurement to convert from encoder ticks to radians.
Link copied to clipboard
public Pose getVelocity()
This returns the current velocity estimate.
Link copied to clipboard
This returns the current velocity estimate.
Link copied to clipboard
public boolean isNAN()
This returns whether if any component of robot's position is NaN.
Link copied to clipboard
public void resetEncoders()
This resets the Encoders.
Link copied to clipboard
public void resetIMU()
This resets the IMU.
Link copied to clipboard
public void setPose(Pose setPose)
This sets the current pose estimate.
Link copied to clipboard
public void setPrevRotationMatrix(double heading)
This sets the Matrix that contains the previous pose's heading rotation.
Link copied to clipboard
public void setStartPose(Pose setStart)
This sets the start pose.
Link copied to clipboard
public void update()
This updates the elapsed time timer that keeps track of time between updates, as well as the change position of the Encoders.
Link copied to clipboard
public void updateEncoders()
This updates the Encoders.