robot.yml Reference

config/robot.yml describes the drivetrain, the motion control and the physical size of the robot. It maps to the generated Robot class in src/hardware/robot.py. You set it up once for a robot. Most values in motion_pid and drive.vel_config are then filled in by calibration and auto-tuning . The other config files are explained on Config Structure .

shutdown_in

AttributeValue
Typeinteger
Default120
RequiredYes

Number of seconds after program start after which GenericRobot will automatically shut down the running mission sequence. Prevents the robot from running indefinitely if something goes wrong. Set to 0 to disable.


drive

Container for the drive subsystem. All motion steps read their kinematics and velocity control from here.

drive.kinematics

Specifies the kinematic model that maps chassis velocities to per-wheel commands.

KeyTypeDefaultDescription
typestring—Required. Kinematic model. Supported values: differential, mecanum.
wheel_radiusfloat—Required. Wheel radius in metres. Used to convert angular wheel velocity (rad/s) to linear velocity (m/s).
wheelbasefloat—Required for differential and mecanum. Distance between the left and right wheel contact patches in metres. For mecanum this is the front-to-back axle distance.
track_widthfloat—Required for mecanum only. Left-to-right distance between wheel contact patches in metres.
left_motorstring—Required for differential. Name of the left drive motor as it appears in definitions. Translated to defs.<name> in generated code.
right_motorstring—Required for differential. Name of the right drive motor as it appears in definitions.
front_left_motorstring—Required for mecanum. Name of the front-left motor in definitions.
front_right_motorstring—Required for mecanum. Name of the front-right motor in definitions.
back_left_motorstring—Required for mecanum. Name of the back-left motor in definitions.
back_right_motorstring—Required for mecanum. Name of the back-right motor in definitions.

The type value is case-insensitive. DifferentialKinematics is instantiated as DifferentialKinematics(left_motor, right_motor, wheelbase, wheel_radius) and MecanumKinematics as MecanumKinematics(front_left_motor, front_right_motor, back_left_motor, back_right_motor, wheelbase, track_width, wheel_radius).

Example — differential drive:

drive:
  kinematics:
    type: differential
    wheel_radius: 0.03
    wheelbase: 0.16
    left_motor: left_motor
    right_motor: right_motor

drive.vel_config

Per-axis chassis velocity control configuration. Each axis has a PID controller and a feedforward term that together compute the motor command voltage.

The three axes are:

  • vx — forward/backward linear velocity (m/s)
  • vy — lateral (strafe) velocity (m/s); only relevant for mecanum
  • wz — angular (yaw) velocity (rad/s)

Each axis block has the same structure:

vel_config:
  vx:
    pid:
      kp: 0.0
      ki: 0.0
      kd: 0.0
    ff:
      kS: 0.0
      kV: 1.0
      kA: 0.0
  vy:
    pid: { kp: 0.0, ki: 0.0, kd: 0.0 }
    ff:  { kS: 0.0, kV: 1.0, kA: 0.0 }
  wz:
    pid: { kp: 0.0, ki: 0.0, kd: 0.0 }
    ff:  { kS: 0.0, kV: 1.0, kA: 0.0 }

pid sub-keys (maps to PidGains):

KeyTypeDefaultDescription
kpfloat0.0Proportional gain.
kifloat0.0Integral gain.
kdfloat0.0Derivative gain.

ff sub-keys (maps to Feedforward):

KeyTypeDefaultDescription
kSfloat0.0Static friction compensation. Added as a constant offset whenever the commanded velocity is non-zero.
kVfloat1.0Velocity feedforward coefficient. Scales the commanded velocity to produce the open-loop motor command. 1.0 means the motor command equals the setpoint directly when no error exists.
kAfloat0.0Acceleration feedforward coefficient.

The vel_config is translated into a ChassisVelocityControlConfig struct at code-generation time.


motion_pid

Unified configuration for the position/heading PID controllers used by all drive-based motion steps (Drive, Turn, DriveAngle, etc.). Required.

This entire block maps to the UnifiedMotionPidConfig C++ struct.

Distance PID (motion_pid.distance)

Controls convergence toward a position target (linear or 2-D).

KeyTypeDefaultDescription
kpfloat2.0Proportional gain (velocity per metre of error).
kifloat0.0Integral gain.
kdfloat0.0Derivative gain.
integral_maxfloat10.0Maximum accumulated integral value (anti-windup).
integral_deadbandfloat0.01Error magnitude below which the integrator stops accumulating.
derivative_lpf_alphafloat0.1Low-pass filter coefficient for the derivative term. 0.1 = heavy filtering; 1.0 = no filtering.
output_minfloat-10.0Minimum PID output (velocity command, m/s or rad/s).
output_maxfloat10.0Maximum PID output.

Heading PID (motion_pid.heading)

Controls convergence toward an angular target.

Same sub-keys as distance (kp, ki, kd, integral_max, integral_deadband, derivative_lpf_alpha, output_min, output_max).

Scaffold defaults: kp: 3.0, all others matching the distance block.

Velocity feedforward

KeyTypeDefaultDescription
velocity_fffloat1.0Scalar multiplied by the profiled velocity target and added directly to the PID output as open-loop feedforward. 1.0 means full feedforward.

Convergence tolerances

KeyTypeDefaultDescription
distance_tolerance_mfloat0.01Position error below which the robot is considered to have reached its linear target (metres).
angle_tolerance_radfloat0.02Heading error below which the robot is considered to have reached its angular target (radians).

Linear saturation handling

When the drive command saturates the actuators, the controller de-rates its output to prevent integral windup.

KeyTypeDefaultDescription
saturation_derating_factorfloat0.85Multiplier applied to the output scale when saturation is detected. Values below 1.0 cause the controller to back off.
saturation_min_scalefloat0.1Minimum scale the de-rating is allowed to reach. Prevents the controller from going completely silent.
saturation_recovery_ratefloat0.02Per-cycle increment to the output scale during recovery from saturation.
saturation_hold_cyclesinteger5Number of consecutive unsaturated cycles required before recovery begins.
saturation_recovery_thresholdfloat0.95Output scale at which the robot is considered to have fully recovered from saturation.

Heading-specific saturation handling

KeyTypeDefaultDescription
heading_saturation_derating_factorfloat0.85Same as saturation_derating_factor but applied to heading-axis saturation only.
heading_min_scalefloat0.25Minimum heading output scale. Higher than the linear minimum because heading corrections are always needed.
heading_recovery_ratefloat0.05Per-cycle recovery rate for heading saturation.
heading_saturation_error_radfloat0.01Heading error below which saturation de-rating engages for the heading axis.
heading_recovery_error_radfloat0.005Heading error threshold for considering heading saturation fully recovered.

Motion profile constraints

These three sub-blocks are populated automatically by raccoon calibrate step-response and should not be edited manually. They are commented out in the scaffold until characterization is run.

motion_pid:
  linear:
    max_velocity: 0.0   # m/s
    acceleration: 0.0   # m/s²
    deceleration: 0.0   # m/s²
  lateral:
    max_velocity: 0.0
    acceleration: 0.0
    deceleration: 0.0
  angular:
    max_velocity: 0.0   # rad/s
    acceleration: 0.0   # rad/s²
    deceleration: 0.0   # rad/s²

Each sub-block maps to AxisConstraints:

KeyTypeDescription
max_velocityfloatPhysical speed ceiling for the axis. The motion profiler will not request more than this.
accelerationfloatMaximum acceleration rate used to ramp up from rest.
decelerationfloatMaximum deceleration rate used to ramp down to the target.

When all three values in a block are 0.0 the profiler for that axis is disabled and the PID controller drives directly without trapezoidal profiling.


physical

Geometric description of the robot body. Used to compute sensor positions relative to the robot center and to populate _wheel_positions in the generated Robot class for collision and pose reasoning.

KeyTypeDefaultDescription
width_cmfloat15.0Robot body width in centimetres (left-to-right).
length_cmfloat15.0Robot body length in centimetres (front-to-back).
rotation_center.x_cmfloatwidth_cm / 2X position of the point the robot rotates around, measured from the left edge in centimetres.
rotation_center.y_cmfloatlength_cm / 2Y position of the rotation centre, measured from the rear edge in centimetres.
start_pose.x_cmfloat30.0Starting X position on the game field in centimetres. Used for absolute pose tracking when a field map is available.
start_pose.y_cmfloat20.0Starting Y position on the game field in centimetres.
start_pose.theta_degfloat0.0Starting heading in degrees. 0 = facing right (+X), 90 = facing up (+Y). The scaffold template ships with 90.0 as a preset value, but the code default when start_pose is absent is 0.0.
table_mapmapping—Optional. Path to a .ftmap file used for on-robot localization. When present, the code generator emits a table_map class attribute on the generated Robot class (accessible as Robot.table_map), allowing steps to query field-relative coordinates.
sensorslist[]List of sensor placement descriptors. Each entry has name, x_cm, y_cm, and optionally clearance_cm. The name must match a key in definitions.

Sensor entry sub-keys:

KeyTypeDescription
namestringMust match a sensor key in definitions.
x_cmfloatSensor X position from the robot’s left edge in centimetres.
y_cmfloatSensor Y position from the robot’s rear edge in centimetres.
clearance_cmfloatVertical distance the sensor sits above the floor (default 0). Used for line-detection geometry compensation.

start_pose — initial localization estimate

start_pose sets where the robot thinks it is at the start of the run. This is the initial odometry estimate, not a physical constraint — the robot does not drive to this position. It tells the localization system where on the field to begin tracking.

When table_map is also specified, start_pose initialises the field-relative pose for absolute coordinate queries. Without table_map, start_pose only affects the initial pose returned by robot.odometry.get_pose().

physical:
  width_cm: 23.5
  length_cm: 29.6
  rotation_center:
    x_cm: 11.75    # geometric center left-to-right
    y_cm: 14.8     # offset front-to-back
  start_pose:
    x_cm: 30.0     # 30 cm from left edge of field
    y_cm: 20.0     # 20 cm from bottom edge
    theta_deg: 90.0  # facing toward +Y (up the field)
  table_map:
    path: config/2026-game-table.ftmap
  sensors:
    - name: front_left_ir_sensor
      x_cm: 7.8
      y_cm: 29.6   # front edge of robot
    - name: front_right_ir_sensor
      x_cm: 15.7
      y_cm: 29.6
    - name: rear_left_ir_sensor
      x_cm: 7.8
      y_cm: 0.0    # rear edge

start_pose.theta_deg convention: 0.0 faces the +X direction (right), 90.0 faces +Y (up in the standard field coordinate system). The scaffold ships with 90.0 because most robots start facing up the field.

Complete mecanum example

A real mecanum competition robot’s robot.yml (adapted from the clawbot) showing start_pose, sensor positions, and motion PID for two surfaces:

# config/robot.yml — mecanum four-wheel competition robot
shutdown_in: 120

drive:
  kinematics:
    type: mecanum
    wheel_radius: 0.024      # metres
    wheelbase: 0.161         # front-to-back axle distance, metres
    track_width: 0.192       # left-to-right wheel distance, metres
    front_left_motor: front_left_motor
    front_right_motor: front_right_motor
    back_left_motor: back_left_motor
    back_right_motor: back_right_motor
  vel_config:
    vx:
      pid: { kp: 0.0, ki: 0.0, kd: 0.0 }
      ff:  { kS: 0.0, kV: 1.0, kA: 0.0 }
    vy:
      pid: { kp: 0.0, ki: 0.0, kd: 0.0 }
      ff:  { kS: 0.0, kV: 1.0, kA: 0.0 }
    wz:
      pid: { kp: 0.0, ki: 0.0, kd: 0.0 }
      ff:  { kS: 0.0, kV: 1.0, kA: 0.0 }

motion_pid:
  distance:
    kp: 2.5
    kd: 0.1
  heading:
    kp: 3.0
    kd: 0.05
  velocity_ff: 1.0
  distance_tolerance_m: 0.012
  angle_tolerance_rad: 0.025
  linear:
    max_velocity: 0.55   # m/s — measured by autotune
    acceleration: 1.2
    deceleration: 1.4
  lateral:
    max_velocity: 0.40
    acceleration: 1.0
    deceleration: 1.2
  angular:
    max_velocity: 4.2    # rad/s
    acceleration: 8.0
    deceleration: 8.0

physical:
  width_cm: 23.5
  length_cm: 29.6
  rotation_center:
    x_cm: 11.75
    y_cm: 14.8
  start_pose:
    x_cm: 30.0            # initial localization estimate — where on the field
    y_cm: 20.0
    theta_deg: 90.0       # facing up the field (+Y direction)
  table_map:
    path: config/2026-game-table.ftmap
  sensors:
    - name: front_left_light_sensor
      x_cm: 7.8
      y_cm: 29.6          # front edge of robot body
    - name: front_right_light_sensor
      x_cm: 15.7
      y_cm: 29.6
    - name: rear_left_light_sensor
      x_cm: 7.8
      y_cm: 0.0           # rear edge