Run Configurations

A run configuration is a named bundle of raccoon run flags and environment variables stored in your project. It works like a PyCharm run configuration: pick a name and get a fixed set of options.

During development you constantly switch between very different modes:

  • Competition: full calibration, wait-for-light start, all checkpoints active. Correct for the competition, but painful when iterating, because every run needs a calibration drive and a light trigger.
  • Dev: button start, stored calibration, checkpoint waiting skipped. Fast feedback, but you must not forget to switch back before the competition.

Without run configurations you type --dev --no-calibrate --no-checkpoints every time and risk forgetting a flag. With them you name the mode once in YAML and call it by name:

raccoon run              # same as raccoon run default
raccoon run dev
raccoon run competition  # a configuration you defined

The names are case-insensitive (raccoon run Dev works). The configurations are shared with the WebIDE: one you create there is available in the terminal, and the other way around. See Run Configurations in the WebIDE for the dialog.

Builtin presets

Three presets exist in every project, even without a run_configurations: section:

NameEquivalent flagsPurpose
default(none)Standard run: codegen, calibrate, checkpoints. Uses the robot if one is connected
dev--dev --no-calibrate --no-checkpointsFast iteration: button start, skip calibration, skip checkpoint waiting
simulatedtarget: simulatedRun the project under the libstp simulator. Only the WebIDE uses this. raccoon run simulated does not start the simulator; it runs like auto

Defining your own

Add a run_configurations: block to raccoon.project.yml:

run_configurations:
  competition:
    description: "Competition: full run with all systems active"
    target: remote
    record_localization: true
    record_hz: 30

  dev-fast:
    description: "Dev: button start, skip calibration and checkpoints"
    dev: true
    no_calibrate: true
    no_checkpoints: true

  tune:
    description: "Long tuning session on the robot"
    target: remote
    no_checkpoints: true
    env:
      RACCOON_SHUTDOWN_IN: "900"

An entry with the name of a builtin replaces that builtin. Real bots keep the block in its own file and include it from the root config:

# raccoon.project.yml
run_configurations: !include config/run-configurations.yml

Fields

FieldTypeDefaultDescription
descriptionstring""Shown when the configuration activates, and as the tooltip in the WebIDE
targetstringautoWhere to run, see below
devboolfalseDev mode: a button press instead of wait-for-light starts a mission
no_calibrateboolfalseSkip calibration steps; use stored values
no_checkpointsboolfalseSkip time-checkpoint waiting (wait_for_checkpoint steps return immediately)
debugboolfalseDebug mode: breakpoint() steps pause and wait for a button press
no_codegenboolfalseSkip code generation
no_syncboolfalseSkip the sync to the robot before a remote run
record_localizationboolfalseRecord the particle filter state for replay
record_hzfloatnullSample rate of that recording (20 Hz if empty)
profilebooltrueStep profiling. Set false to switch it off for this configuration
argslist of strings[]Extra arguments, put in front of the ones you type on the command line
envmapping{}Environment variables for the program

Unknown keys are ignored, and a wrong target or a non-list args is an error.

Target values

ValueMeaning
autoUse the robot if one is connected, otherwise run locally
localAlways run locally
remoteAlways run on the connected robot
simulatedWebIDE only: run under the simulator

Command line flags and configurations

A configuration is the starting point, and the flags you type are added on top:

raccoon run dev --no-m030    # the dev flags, plus skip mission M030
  • Flags add, they do not subtract. dev, no_calibrate and the other switches are combined with your flags. You cannot turn a switch off from the command line. Use another configuration for that.
  • target: local and target: remote win over --local. raccoon run competition --local still runs remotely if competition has target: remote.
  • record_hz: a --record-hz on the command line beats the value of the configuration.
  • --no-mXXX only works on the command line. Writing it into args does not skip a mission, because raccoon run reads these flags before it merges the configuration. See raccoon run .

Environment variables as feature flags

env: is a good place for feature flags. A competition bot switches between real and fake camera without touching the mission code:

run_configurations:
  dev:
    description: "Fast iteration"
    dev: true
    no_checkpoints: true

  dev-fake:
    description: "Fast iteration with the fake camera service"
    dev: true
    no_checkpoints: true
    env:
      DRUMBOT_FAKE_CAMERA: "1"
import os

if os.getenv("DRUMBOT_FAKE_CAMERA") == "1":
    install_fake_color_service(robot)

raccoon run dev-fake swaps the whole camera subsystem, with no code change.

Hiding builtin presets

If a builtin does not apply to your project (you never use the simulator, for example), hide it:

hidden_run_configurations:
  - simulated

It disappears from the CLI and from the WebIDE dropdown. To restore it, remove the name from the list, or add an entry with the same name under run_configurations:. Removing a builtin in the WebIDE writes this list for you.

Tips

  • Set record_localization: true on your competition configuration so every real run records a replay file.
  • Add no_codegen: true to a configuration when you know the code has not changed.
  • Each developer on a team can add their own configurations without conflicts, because they are just keys under run_configurations:.