VingVing Robot LogoVingVing Robot

Documentation v0.0.3

VingVing Robot Docs

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

RobotConfig.java - Pinpoint
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:

  1. Measure pod offsets from robot center
  2. Set encoder directions (test by pushing robot)
  3. Run Localization Test - push robot 24" forward
  4. If readings are wrong, flip encoder directions
  5. Verify by pushing in all directions

Three Wheel Odometry Setup

RobotConfig.java - Three Wheel
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

  1. Run Tuning OpMode → Localization → Forward Tuner
  2. Manually push robot exactly 48 inches forward using ruler/tape
  3. Read the multiplier value from telemetry
  4. Update forwardTicksToInches in your localizer constants
  5. Repeat 2-3 times and average the results

Lateral Tuner

  1. Run Tuning OpMode → Localization → Lateral Tuner
  2. Push robot exactly 48 inches to the LEFT
  3. Read multiplier and update strafeTicksToInches
  4. Average multiple trials for accuracy

Turn Tuner

  1. Run Tuning OpMode → Localization → Turn Tuner
  2. Rotate robot exactly 360 degrees (2π radians)
  3. Read multiplier and update turningTicksToRadians
  4. Use a protractor or grid for accurate rotation

Verify Localization

Run Localization Test to verify your setup:

  1. Run Tuning → Localization → Localization Test
  2. Push robot 24" forward - X should read ~24
  3. Push robot 24" left - Y should read ~24
  4. Rotate robot 90° - Heading should read ~90°
  5. If values are wrong, check encoder directions and multipliers
Next: Automatic Tuning →