Robot setup
Choose a localizer, configure the pods and set the initial field pose.
Choose a localization backend
Open Robot setup on the robot dashboard before initializing an OpMode. Choose PINPOINT, TWO_WHEEL_IMU or THREE_WHEEL. Changing backend inserts example offsets: replace them with measurements from your robot.
Pinpoint uses two perpendicular pods and its internal IMU. Software two-wheel localization needs a configured REV Hub IMU. Three-wheel localization needs two parallel wheels and a perpendicular wheel with independent geometry.
goBILDA and custom pods
The goBILDA 4-Bar preset uses a 32 mm wheel and 2,000 decoded counts per revolution. The Swingarm preset uses a 48 mm wheel and 2,000 counts. Confirm the preset matches your hardware revision.
Custom pods need wheel diameter, decoded counts per encoder revolution and encoder revolutions per wheel revolution. Do not confuse vendor PPR with decoded counts. Software localizers allow a separate scale for each pod; this Pinpoint adapter requires matching scales.
import dev.cubiclib.odometry.PodSpec;
PodSpec custom = new PodSpec(35.0, 8192.0, 1.0);
double mmPerCount = custom.mmPerCount();
// π × diameter / (decoded counts × encoder revs per wheel rev)Hardware names and mounting offsets
For each wheel, set its hardware name, direction, xMm, yMm and angleRadians. Robot-relative x points forward and y points left. Angle 0 measures forward motion; π/2 measures leftward motion.
For Pinpoint, wheel 0 must be forward and wheel 1 left. Its x offset is the forward pod’s y position; its y offset is the left pod’s x position. Set pinpointName to the device name from the robot configuration.
For TWO_WHEEL_IMU, set imuName, imuLogoFacing and imuUsbFacing to match the actual Hub orientation. Encoder readings include SDK motor direction; keep dedicated encoder channel directions stable.
Set the start pose
Use Start pose X (mm), Y (mm) and Heading (degrees). The field origin is bottom-left in the dashboard: +X right, +Y up; 0° faces right and 90° faces up. The JSON representation uses radians.
Heading is robot orientation, not direction of travel. A mecanum robot can strafe with an unchanged heading. Save while stopped; the configuration is applied on the next Init. Pose fields and setup JSON remain synchronized.
import dev.cubiclib.odometry.Pose2;
// Only reset when you know the actual robot pose.
resetPose(new Pose2(500, 600, Math.toRadians(90)));Verify before recording
Keep the robot stationary during Pinpoint IMU calibration. Push it a measured distance forward and left, then rotate it in place. Check scale, signs, heading and unwanted translation during rotation.
Set actual robot length, width and clearance. Keep field geometry confirmation off until the nominal map matches your practice-field assumptions. Never use default offsets as measured calibration.