Overview
Mars-RS includes a built-in path creation tool that allows you to visually design paths for autonomous routines. You can draw paths by clicking on the field, edit existing waypoints, and save/load paths for later use.Entering Create Mode
To access the path creator:- Click the Create button in the UI (located at coordinates 3.0, 80.0)
- The interface will switch to Create mode with Draw state enabled
You cannot switch between Driver and Auton modes while in Create mode. Exit Create mode first.
Create Mode States
The path creator has four states:Draw
Add new waypoints by clicking on the field
Edit
Drag existing waypoints to modify the path
Save
Save the current path (prints to console)
Load
Load a previously saved path
Drawing Paths
Adding Waypoints
In Draw mode:- Click the New Path button to start a fresh path
- Click anywhere on the field to add waypoints
- Waypoints are automatically connected with lines
Visual Feedback
As you create a path:- Waypoints appear as red circles (4px radius normally)
- Connecting lines are drawn in black (3px width)
- Hovering near a waypoint (within 8 pixels) makes it larger (8px radius)
Editing Paths
Moving Waypoints
In Edit mode:- Click the Edit Path button
- Click and drag any waypoint to reposition it
- The waypoint follows your mouse while the button is held
Deleting Waypoints
To remove a waypoint:- Hover over the waypoint (it will turn into a larger red circle)
- Press Backspace
- The waypoint is immediately removed
Saving Paths
Save Function
To save your current path:- Click the Save Path button
- The path coordinates are printed to the console
- The mode automatically returns to Draw state
Currently, paths are saved to the console output. You can copy these coordinates to use in your autonomous code.
Loading Paths
Click the Load Path button to enter Load mode.The load functionality is defined in the UI but the implementation for loading from file is not yet complete in the current codebase.
Path Data Structure
Paths are stored as a vector of (x, y) coordinate tuples:UI Button Layout
The Create mode buttons are arranged horizontally:| Button | Position | Function |
|---|---|---|
| New Path | (130, 8) | Start a new path |
| Edit Path | (193, 8) | Edit existing waypoints |
| Save Path | (263, 8) | Save path to console |
| Load Path | (333, 8) | Load saved path |
Interaction Detection
The path editor uses distance-based detection to determine if you’re interacting with a waypoint:- Detection radius: 8 pixels
createValidprevents creating new waypoints when hovering over existing ones
Bézier Curves (Experimental)
Mars-RS includes aBezier struct for future curve-based paths:
length(): Calculate curve lengthcurvature(t: f32): Calculate curvature at parameter t
Bézier curve functionality is currently a stub and not fully implemented.
Using Paths in Autonomous
Once you’ve created a path, you can use it with autonomous functions:Best Practices
Path Spacing
Path Spacing
Space waypoints 30-50 pixels apart for smooth autonomous execution. Too close together can cause erratic movement.
Field Boundaries
Field Boundaries
Keep waypoints within the field boundaries. The field is rendered at 90% of 12 feet scaled to screen size.
Testing Paths
Testing Paths
After creating a path, test it in Autonomous mode before using it in competition.
Related
Autonomous Mode
Execute paths with movement algorithms
Field Layout
Understand the VEX field coordinate system