Auton

The Auton tab is where you write an autonomous routine (an auton) and draw the paths it drives.

The Routines sub-tab: the routine's steps, the palette and its problems.
The Routines sub-tab: the routine's steps, the palette and its problems.

The tab

The left panel picks the start position and the routine, with New, Delete, Duplicate and Browse…. Right-click a routine for Duplicate, Rename, Copy to and linking (see Link red and blue autons). The arrow at the top collapses the panel. The alliance positions are the field's starts: Left and Right for each alliance, and every start position placed on the field, whose autons are named for it (blue's "Start 2" names blueStart2_…).

Two sub-tabs work on the selected auton:

Sub-tabWhat it shows
RoutinesThe auton's steps as a tree, the palette, and its problems. Edit steps as on the Scripts tab: drag from the palette, select, cut, copy, paste, drag, and Make Script from Steps…. A linked routine takes no script that drives (see Link red and blue autons). Each step that drives shows its move number, as the Paths field draws it on that move.
PathsThe paths the auton drives (its <auton>_*.json files in AutonPaths, and those of the scripts it runs with RunScript), in driving order, and the routine on the field, its drive-to steps included. The selected path is in full colour. Play drives the robot through the whole routine.

A routine that a TeleOp runs (see TeleOp) is not an auton: the list leaves it out, and Mirror and On robot don't show for it. It is edited on the TeleOp tab, with these same two sub-tabs.

Paths of the scripts a routine runs

The Paths list shows the paths of every script the routine runs with RunScript, to any depth, after the routine's own. Each is labelled with the script's name, such as odometry_drive · leg1, and is numbered in the order the routine drives it. Drag its points, change its settings, and join, separate or set the speed where two meet, as for any path: the edit is saved to that path's file in AutonPaths. To add, delete, rename or duplicate such a path, change the script that drives it on the Scripts tab; those commands say so.

Undo: Cmd+Z (Ctrl+Z) undoes the last edit on either sub-tab; Shift+Cmd+Z (Ctrl+Y) redoes. Picking another auton clears the history. An undo that would overwrite a file changed outside Robot Designer (by hand or by a git pull) is refused.

Duplicate copies the selected auton and every path it owns on the same start position, as <name>Copy (then <name>Copy2 and so on, skipping a name whose paths are already in AutonPaths), and selects the copy. The copy's steps drive the copy's own paths, so editing one never changes the other. A copy is never linked to a red or blue partner. To put a copy on another start position, use Copy to.

Rename refuses a new name that differs from the old one only in capital letters (park to Park): Windows, macOS and git usually treat those as the same name. Pick a different name.

Edit paths on the field

The Paths sub-tab: the routine's moves numbered on the field.
The Paths sub-tab: the routine's moves numbered on the field.
ToDo
Select a pointClick it. Click a faded path to select that path.
Move a pointDrag it. Or click the field and use the arrow keys: 1 cm (Shift: 10 cm, Option/Alt: 2 mm).
Add a waypointDouble-click on the selected path.
Set the robot's facing at the start or endDrag the knob on the point's heading handle.
Bend the pathTravel direction, under the lists.
Set which way the front pointsFacing at start / Facing at end.
Change speeds and accelerationMore: turn speed, start and end speed, acceleration.
Copy a pathRight-click it in the Paths list → Duplicate Path. The copy is stand-alone and stopped at both ends, and no step drives it until you add one.

If a path file changed outside Robot Designer, your edit isn't saved. The page reloads the files and tells you. Make the edit again.

The field itself

The Paths field is the same field as on the Live Robot and Simulate Robot tabs, and works the same way:

  • It turns so the routine's drive team is at the bottom of the screen (drive_teams in field.json, as on Live Robot). The arrow keys move things the way they point on the screen.
  • Game elements, AprilTags, forbidden areas, field positions and the alliances' start markers are picked, moved, added and removed here too: with the + Add menu (Element, AprilTag, Area, Position, Start), by dragging, and from the right-click menu. What you change is saved and shown on the other field tabs.
  • A press on a path's point, a drive-to step, another path or a joint goes to the routine; anywhere else it goes to the field. A field position is the field's even under a drive-to step, so you can drag the position a step drives to; click the step's line away from it to change the step. The right-click menu starts with the routine's entries (Add a path at the end, or how a path starting there starts), then the field's.
  • Arrow keys move whatever on the field is selected; with nothing selected there, they move the selected point of the path.
  • Cmd+Z (Ctrl+Z) takes back the last change, whether it was to the routine or to the field.
  • Find in the field's corner opens the list of what is on the field, between the settings and the field, to find an item by name and select it (see Find something on the field). Opened, it takes its width from the field; drag the divider between them to share it differently. Here it starts with the routine's moves under Route, numbered as on the field: point at one to pick it out, and select it to select it in the Paths list.

Read the route

The routine's moves are numbered on the field in the order the robot makes them, paths and drive-to steps together:

  • Each move has its number half-way along it and an arrow the way the robot goes. Two moves over the same stretch in opposite directions have their numbers on opposite sides of the line.
  • A place the robot comes back to has a dark chip listing the moves that arrive there, such as 1 · 3 · 5 at a shooting spot visited every cycle.
  • Rest the pointer on a move to pick it out: the others fade, and its tooltip says its number and when it runs, such as "Move 3 of 7 · 4.20–6.10 s".

Position names are placed so they don't run over one another, the marks or the route's numbers. A name with no room beside its mark sits a little further out, with a thin line back to it. On Paths, Show ▸ Names of Unused Positions hides the names of the positions this routine doesn't start at or drive to; those positions stay as faint marks, named when you rest the pointer on one.

Play the routine

Play, under the field, drives the robot through the whole routine: every path and drive-to step in order. The robot stays still for each WaitCommand and stops at the end; Play again starts over. Drag the slider to see any moment. Beside it is the time, such as "8.97 s / 12.37 s", and under it the move under way, such as "3 of 4: DriveToFieldPositionCommand → Shoot2". Selecting a path in the list puts the robot where the routine starts driving it.

  • A path takes as long as its own animation. Its Max acceleration holds sideways too: the robot slows through a tight curve, as it does on the robot, so a bend can take longer than its top speed suggests. A drive-to step with a motion profile takes the time the robot plans for it, plus its SettleSeconds.
  • A drive-to step with no motion profile is timed as fast as the drive allows. That is an estimate: the robot's own controller decides how fast it goes.
  • A WaitUntil, and a step that shoots or intakes, take no time here, since how long they take is decided on the robot. A RepeatUntil plays once.
  • The robot runs one branch of an If, chosen as it starts. Play follows its Then, and the If takes as long as that does; the Else is still drawn, from the same place.
  • The steps of a parallel group start together. The group ends with its last step, a race with the first of its steps that takes time, and a deadline group with its first step. A path or drive still under way when a race or deadline group ends stops there: it is cut short at the group's end, and what follows starts from where the robot had got to.
  • A drive to what the camera sees, or to a position that can't be worked out, doesn't move the robot here.

Drive-to steps in the Paths list

The Paths, in routine order list has a row for each drive-to step too, among the paths, numbered as on the field: "4 Drive to Shoot2", with its command, distance and time below. Select one, in the list or by clicking it on the field:

  • The field picks it out, and the robot is put where it starts.
  • Points lists its Start, where the step before leaves the robot, and its End.
  • With End selected, the drive's target is in the form: Position, X, Y, and the way the robot faces there under at end. Choose another position, or Custom and type numbers, to change where it drives. The step in the script is changed, and Cmd+Z (Ctrl+Z) takes it back. The path settings are greyed out: they belong to paths.
  • Under More, Start speed is the speed the drive starts at: what the drive before hands on when it keeps its speed, otherwise 0; an estimate when the drive before has no motion profile, as its tooltip says. End speed chooses 0 (stop here) or Previous path (keep its speed), the drive's EndSpeed, as its right-click menu does.
  • A start can't be changed here: change the step before it. Only a DriveToFieldPositionCommand of this routine is changed here; others are shown, and changed in Routines.

See and change drive-to steps on the field

The routine's drive-to steps (DriveToFieldPositionCommand, DriveToAprilTagsCommand, DriveToDetectionCommand, ScanAndDriveToDetectionCommand) are drawn on the Paths field too: a straight line from where the robot is when the step starts to where it ends, with the robot's outline at each end.

  • Where a step starts is where the step before leaves the robot: SetInitialPoseCommand, the end of a path, or the end of the drive-to step before.
  • With a motion profile, white marks show where speeding up ends and slowing down starts, and amber marks show where turning starts and ends. The timing uses the robot design's drivetrain top speed.
  • Rest the pointer on a step to see what it is, how far and how long it drives, and, on its line, how fast the robot is going there and when.
  • Click a step to select it in the Paths list (see below). Double-click it to change it: its parameters open beside its motion profile's chart, as on the Live Robot tab's f(x) dialog. OK saves it to the routine; Cmd+Z (Ctrl+Z) undoes it.
  • A step inside a script that RunScript runs is drawn, but you change it in that script, on Scripts. The paths such a script drives are edited here (see Paths of the scripts a routine runs).

Add or take out a position on a drive. Right-click a DriveToFieldPositionCommand's line or the robot at its end. The menu starts with a submenu named after the step:

  • Add a Position Here… asks for a name, then adds a field position at that spot on the line. It faces the way the robot would face there. A new DriveToFieldPositionCommand to it goes in just before the drive, with the drive's own tolerances, timeout and motion profile. The robot now stops at the new position before going on, unless you set its End Speed to Previous path (below). One Cmd+Z (Ctrl+Z) takes back both the position and the step.
  • Take … Out of the Drive (on the robot at the end) removes that step, so the robot drives from the step before straight to the one after. The field position stays on the field; delete it from the field's own menu if no routine needs it.
  • End Speed chooses what the robot does at the step's position:
    • 0 (stop here), the default: it slows down and stops there, as any drive-to step does.
    • Previous path (keep its speed): the position is a waypoint on a longer drive. The robot reaches it at the drive's cruise speed, with no slow-down, and goes straight on. The next DriveToFieldPositionCommand starts at that speed, with no speed-up from rest, if it starts within 0.1 s: steps that take no time between, such as one that turns the intake on, don't stop it, nor does starting a parallel group; a wait of 0.1 s or more, a path or another kind of drive-to step does. Give a step passing through a motion profile: without one the robot aims at the position itself and brakes into it, so it gets there almost stopped. Routines warns about one with no profile. It hands on the speed the robot is measured going there, which Robot Designer can only estimate (as the drive's top speed). The next step needs a motion profile only to change to a speed of its own. The step ends as soon as the robot is close to the position or has gone past it, whatever way it faces.
    • The same choice is the step's EndSpeed parameter, a dropdown in Routines and in the step's parameters.
    • On the field, a step passing through has no slow-down mark, and resting the pointer on the next step shows the speed it starts at.
  • Change… opens the step's parameters, as double-clicking it does.

Some ends are only known on the robot:

StepDrawn
DriveToAprilTagsCommand with a TagId and an ApproachDeg (left out means 0)In front of the tag's cluster, from the AprilTag file.
DriveToAprilTagsCommand with no TagId, a blank ApproachDeg, or a tag on an element that tipsA dashed ring where it starts: it drives to the tags it sees.
DriveToDetectionCommand, ScanAndDriveToDetectionCommandA dashed ring where it starts: it drives to what the camera sees.
A step after one of thoseIts robot outline at the end, dashed: where it starts isn't known.

A target inside a forbidden area is drawn where the robot actually goes. With Respect forbidden areas on in the drive's settings (Design tab, drive.json), that is the nearest place it fits; with it off, as it is by default, the robot drives to the target as given.

Start or end a path at a named position

Select a path's start or end, then pick a Position: a named field position (see Named positions on the field).

  • The point moves there and the robot faces the way the position does.
  • Move the position and the path follows.
  • While at a position, the point's X, Y and facing are locked.
  • Custom (X, Y, facing) frees the point again, where it is.
  • The path keeps its own Travel direction and End speed, so it can pass through the position still moving.
  • A joined start can't have a position; it follows the path before it.
  • On a linked red routine the position is mirrored. A name the field doesn't have is an error.

Avoid forbidden areas

The field's forbidden areas (see Forbidden areas on the field) are shaded in their alliance's colour. Hover one for its name. Areas for the other alliance are faint and dashed.

Robot Designer drives each path as the robot would and checks the robot's outline against the areas. The outline is the size of the robot design on the Design tab (0.35113 m × 0.28 m without one).

  • A path that enters an area shows a warning in its row, such as "⚠ enters Blue goal at 1.4 s" (seconds from the path's start). Hover the row for details.
  • On the field, the stretch inside the area is a thick orange band, with a dashed robot outline where it first enters.
  • Touching an area's edge is fine.
  • On the robot, a drive never enters an area: it slides along the edge. So a warned path still runs, but not along the line you drew.

A path is checked against the areas for both alliances, its own alliance (from its name: blueLeft_… is blue), and the alliance of every routine that drives it.

The Routines problems also flag:

  • a SetInitialPoseCommand inside an area or off the field (an error; it says where the nearest clear start is);
  • a DriveToFieldPositionCommand whose target is inside an area (a warning; it names where the robot will go instead).

Join paths

A joined path starts where the path before it ends, so the two make one drive. Otherwise it starts on its own.

  • Add path adds a path joined to the end of the last one (or to the start pose), and adds its step to the routine.
  • Each row in the Paths list says how the path starts, such as "continues from leg1 · stops there" or "starts on its own · 27 cm from leg1's end".
  • Select a joined path to choose Stop or Keep moving (at a speed no higher than either path's max), or Separate. Keep moving needs its step to run right after the one before.
  • Select an unjoined path and click Join. It asks first if this moves the start more than 1 cm.
  • On the field, a joint is one handle: a square where the robot stops, an arrow where it keeps moving. Drag it to move both paths' ends together. Unjoined paths in a row show a thin dashed line.
  • Right-click a path's start (or a path in the list) for Join to the end of …, Separate from …, and Stop or Keep moving. On the field, Insert a path here adds a path between two joined ones.
  • Delete path on a middle path asks whether to join the gap.
  • Moving the start of a path joined to the start pose moves the routine's start pose (its last SetInitialPoseCommand before that path). If the start pose is a named position, move the position instead.

The Routines problems list joined paths that don't meet, a joined path whose step was moved away from the path it continues, and a keep-moving path with a step between it and the next.

A join is saved as the path file's "ChainFrom" key (the path it continues from, or "@InitialPose"). The robot ignores it; the robot project's tests check that joined paths meet.

Choose a follower

Each TrajectoryFollowCommand step has a Follower:

FollowerHow it drives
WPILib (default)On a clock, as the Paths sub-tab animates it. A robot held up falls behind, then cuts across to catch up.
Pedro (Pedro Pathing)Follows the same curve from wherever the robot is, braking to stop at the end. Timing differs from the animation.
  • Keep a run of joined, keep-moving paths on one follower.
  • Pedro's settings are the robot's pedro.json. Edit them on the Design tab: select the drivetrain's heading and open Pedro Pathing. Type the numbers Pedro's AutoTune reports (inches, seconds, radians). Blank keeps Pedro's default, which is not a substitute for tuning.
  • The robot code needs the library's PedroDrive on its drive. See pedro.md.

Shape a move with a motion profile

Without a profile, a drive-to step (DriveToFieldPositionCommand, DriveToAprilTagsCommand, DriveToDetectionCommand, ScanAndDriveToDetectionCommand) goes as fast as the drive allows. A MotionProfile sets how it speeds up, cruises, slows down and turns.

Which commands take a profile is set in the robot's config.json MotionProfileCommands. A mechanism command (an arm to an angle, a lift to a height) can take one too, with its own units and no turn. The library's scripts.md, "Motion profiles", says how to write one.

Add a profile

  1. Right-click the step → Add Motion Profile…. A chart opens.
  2. Speed (top): drag the left corner to where speeding up ends, the right corner to where slowing down starts, and either one up or down to set the cruise speed. Further in is gentler.
  3. Turn (optional): tick Set when it turns, then drag its two handles to where turning starts and ends. Unticked, the robot turns towards the target heading from the start. Only drive commands turn.
  4. Or type the numbers in the fields under the chart.
  5. Click OK.

The profile appears as a MotionProfile row under the step. Click its f(x) button (or double-click the row) to edit it, or right-click → Remove Motion Profile. The Live Robot tab's f(x) dialog has the same chart, under Use a motion profile.

  • The profile is in percentages of the distance, so it fits a drive of any length.
  • A drive with EndSpeed: Previous path keeps its speed to the end, so its chart has no slow-down side, and Slow down from is greyed out. Opened from the Paths field, the chart of the drive after it starts at the speed it is handed, not from 0; a line under the chart says both.
  • The robot never goes faster or accelerates harder than it can, so a short drive may not reach cruise speed.
  • A drive to something the camera sees stretches its plan as the camera re-measures the target.
  • A slow profile takes longer: DriveToDetectionCommand gives up after 2 s unless TimeoutSeconds says otherwise.
  • An out-of-range number, a slow-down before the speed-up ends, or a turn ending before it starts is an error. A profile on a command not in MotionProfileCommands is a warning; the robot ignores it.

A linked routine has a mirror on the other alliance, with the same name on the partner start position (such as blueLeft_cycle and redLeft_cycle). The red one is always the exact mirror of the blue one: edit either and the other is rewritten. To make them differ, unlink them.

  • New can make the linked mirror too.
  • The Auton list marks a linked routine with a link sign and its partner, such as "RL".
  • The panel's Mirror section shows the link and whether the two match, with:
    • Open <partner>, Unlink;
    • Make <partner> mirror… or Link with <partner> "<name>"… (you choose which side to keep);
    • Show mirror on field, which draws the partner as dashed lines.
  • The Auton list's right-click menu has the same, plus Link with another <partner> routine… for a different name.
  • If one side was changed outside Robot Designer, a bar above the editor says so. Nothing is overwritten until you choose: copy one side's changes to the other, remake a missing side, re-mirror after the field's symmetry changed, keep one side, or Unlink.
  • Copy to copies to another position of the same colour as is, or to the mirror position mirrored. A copy is never linked.

Links are recorded in autons/auton_links.json. It isn't copied to the robot, which only sees two ordinary routines. If the file can't be read, the Mirror section shows the error and linking is off until it's fixed.

Set how the field mirrors

File > Set Up Field…, or on a field with no picture Set up field… (on the field itself, and in the note along its bottom), opens a dialog with Choose picture…, Rotation, each drive team's side and Mirroring, and writes field.json for you; the rest of the file is left as it is. Mirroring set there is the "alliances" symmetry below, and Not set turns it off, taking partners with it. Changing a start's partner, or a project that needs more than the dialog offers, is a hand edit.

Linking needs "alliances" in <TeamCode>/field_designs/field.json:

{
  "field_image": "field.png",
  "alliances": {
    "symmetry": "rotate_180",
    "partners": { "blueLeft": "redLeft", "blueRight": "redRight" }
  }
}

symmetry uses field coordinates (origin at the centre, +X right, +Y up):

rotate_180              mirror_across_y_axis     mirror_across_x_axis
(x, y) -> (-x, -y)      (x, y) -> (-x, y)        (x, y) -> (x, -y)
angle  -> angle + 180   angle  -> 180 - angle    angle  -> -angle

+-----------+           +-----+-----+            +-----------+
|         R |           | B   |   R |            |    R      |
|     +     |           |     |     |            |-----------|
| B         |           |     |     |            |    B      |
+-----------+           +-----+-----+            +-----------+
  • partners (optional) pairs blue start positions with their red mirrors, by id: any blue start with any red one, each at most once ({"blueStart2": "redStart2"}). Without it, rotate_180 pairs Left with Left, and both mirrors pair Left with Right. A start that partners leaves out, placed at a position of its own in field_positions.json, pairs with the other alliance's start within 5 cm and 5° of where the symmetry puts it. A start with no partner has no mirror: its routines can't be linked or copied to the other alliance.
  • Without "alliances", linking is off and Copy to offers only positions of the same colour: the project has to say how its field mirrors before a routine can be copied to the other alliance.

A mirror moves every path point, direction and heading, and SetInitialPoseCommand. Speeds and limits stay the same. Other commands with field coordinates are listed in config.json's FieldFrameParams, each parameter an x, y, angle, or position (a field position name):

"FieldFrameParams": {
  "YourCommand": { "TargetX": "x", "TargetY": "y" }
}

Scripts aren't mirrored, so a linked routine can't run a script that drives a path or sets a position: the palette greys those scripts out, a paste or drop of one is refused, and Make Script from Steps… won't make a script of steps that drive. Scripts that only run mechanisms, such as shooting or intake, are fine.