TankLocalizer
class TankLocalizer @JvmOverloads constructor(val hardwareMap: HardwareMap, var inPerTick: Double, val kinematics: TankKinematics, val leftEncoders: List<Encoder>, val rightEncoders: List<Encoder>, val initialPose: Pose2d = Pose2d.zero) : Localizer
Localizer based on tank drive encoders. This localizer is not recommended for use with dead wheels.
Parameters
hardwareMap
hardware map
inPerTick
inches per tick
kinematics
tank kinematics
leftEncoders
left encoders
rightEncoders
right encoders
initialPose
initial pose
Constructors
Link copied to clipboard
constructor(hardwareMap: HardwareMap, kinematics: TankKinematics, inPerTick: Double, leftNames: List<String> = listOf("leftFront", "leftBack"), rightNames: List<String> = listOf("rightFront", "rightBack"), leftDirections: List<DcMotorSimple.Direction> = listOf(DcMotorSimple.Direction.FORWARD, DcMotorSimple.Direction.FORWARD), rightDirections: List<DcMotorSimple.Direction> = listOf(DcMotorSimple.Direction.FORWARD, DcMotorSimple.Direction.FORWARD), initialPose: Pose2d = Pose2d.zero)
Creates a new localizer.
Properties
Functions
Link copied to clipboard
Returns a new localizer with the given motors.
Link copied to clipboard
Updates the localizer and returns the new velocity.
Link copied to clipboard
fun withDirections(leftDirections: List<DcMotorSimple.Direction>, rightDirections: List<DcMotorSimple.Direction>): TankLocalizer
Returns a new localizer with the given motor directions.
Link copied to clipboard
Returns a new localizer with the given initial pose.