SwerveLocalizer
constructor(hardwareMap: HardwareMap, cpr: Int, inPerTick: Double, imu: IMU, kinematics: SwerveKinematics, driveNames: List<String> = listOf("lfDrive", "frDrive", "blDrive", "brDrive"), steeringNames: List<String> = listOf("lfSteering", "rfSteering", "lbSteering", "rbSteering"), driveDirections: List<DcMotorSimple.Direction> = driveNames.map { DcMotorSimple.Direction.FORWARD }, steeringDirections: List<DcMotorSimple.Direction> = steeringNames.map { DcMotorSimple.Direction.FORWARD }, initialPose: Pose2d = Pose2d.zero)
Creates a new localizer.
Parameters
hardwareMap
hardware map
cpr
counts per revolution of the steering encoders
inPerTick
inches per tick of the drive encoders
imu
IMU
kinematics
swerve kinematics
driveNames
names of the drive motors
steeringNames
names of the steering motors
driveDirections
directions of the drive motors
steeringDirections
directions of the steering motors
initialPose
initial pose
constructor(hardwareMap: HardwareMap, cpr: Int, inPerTick: Double, imu: IMU, kinematics: SwerveKinematics, driveEncoders: List<Encoder>, steeringEncoders: List<Encoder>, initialPose: Pose2d = Pose2d.zero)
Parameters
hardwareMap
hardware map
cpr
counts per revolution of the steering encoders
inPerTick
inches per tick of the drive encoders
imu
IMU
kinematics
swerve kinematics
driveEncoders
drive encoders
steeringEncoders
steering encoders
initialPose
initial pose