Localization
Configure and tune your robot's position tracking system
Choose Your Localizer
VingVing Robot supports multiple localization methods. Choose based on your hardware:
GoBilda Pinpoint
All-in-one odometry computer. Easiest to set up with built-in processing.
✓ Recommended for beginners
• Plug-and-play setup
• Built-in IMU fusion
SparkFun OTOS
Optical tracking sensor. No dead wheels needed!
✓ No odometry wheels required
• Uses optical flow tracking
• Good for tight spaces
Three Wheel Odometry
Classic deadwheel setup with two parallel + one perpendicular encoder.
✓ Most accurate when tuned
• Requires encoder installation
• Can add IMU for heading
Two Wheel + IMU
Two odometry wheels + IMU for heading tracking.
✓ Simpler than three wheel
• IMU required for heading
• Good accuracy with tuning
GoBilda Pinpoint Setup
public static PinpointConstants localizerConstants = new PinpointConstants()
.forwardPodY(0) // Y offset from center (inches)
.strafePodX(0) // X offset from center (inches)
.distanceUnit(DistanceUnit.INCH)
.hardwareMapName("pinpoint")
.encoderResolution(
GoBildaPinpointDriver.GoBildaOdometryPods.goBILDA_4_BAR_POD
)
.forwardEncoderDirection(
GoBildaPinpointDriver.EncoderDirection.FORWARD
)
.strafeEncoderDirection(
GoBildaPinpointDriver.EncoderDirection.REVERSED
);
// In createFollower():
.pinpointLocalizer(localizerConstants)Tuning Steps:
- Measure pod offsets from robot center
- Set encoder directions (test by pushing robot)
- Run Localization Test - push robot 24" forward
- If readings are wrong, flip encoder directions
- Verify by pushing in all directions
Three Wheel Odometry Setup
public static ThreeWheelConstants localizerConstants = new ThreeWheelConstants()
.leftEncoderName("leftEncoder")
.rightEncoderName("rightEncoder")
.strafeEncoderName("strafeEncoder")
.leftEncoderDirection(Encoder.FORWARD)
.rightEncoderDirection(Encoder.REVERSE)
.strafeEncoderDirection(Encoder.FORWARD)
.leftYOffset(6.0) // Distance from center (inches)
.rightYOffset(6.0) // Distance from center (inches)
.strafeXOffset(0.0) // Distance from center (inches)
.ticksPerInch(2000.0 / (Math.PI * 1.5)); // Calculate from wheel size
// In createFollower():
.threeWheelLocalizer(localizerConstants)Tuning Ticks-to-Inches
Forward Tuner
- Run Tuning OpMode → Localization → Forward Tuner
- Manually push robot exactly 48 inches forward using ruler/tape
- Read the multiplier value from telemetry
- Update forwardTicksToInches in your localizer constants
- Repeat 2-3 times and average the results
Lateral Tuner
- Run Tuning OpMode → Localization → Lateral Tuner
- Push robot exactly 48 inches to the LEFT
- Read multiplier and update strafeTicksToInches
- Average multiple trials for accuracy
Turn Tuner
- Run Tuning OpMode → Localization → Turn Tuner
- Rotate robot exactly 360 degrees (2π radians)
- Read multiplier and update turningTicksToRadians
- Use a protractor or grid for accurate rotation
Verify Localization
Run Localization Test to verify your setup:
- Run Tuning → Localization → Localization Test
- Push robot 24" forward - X should read ~24
- Push robot 24" left - Y should read ~24
- Rotate robot 90° - Heading should read ~90°
- If values are wrong, check encoder directions and multipliers