feat: add skidpad track builder with symmetric centerline - #1
Closed
rafaelborges5 wants to merge 8 commits into
Closed
rafaelborges5 wants to merge 8 commits into
rafaelborges5 wants to merge 8 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds end-to-end support for a partially-timed Formula Student skidpad maneuver by introducing a dedicated skidpad track generator (handles self-overlap), extending the pipeline/configuration to run a skidpad mode, and adding export/visualization for timed-lap scoring.
Changes:
- Introduces a skidpad track builder that generates a discretized centerline with widths plus
timed_mask/geometry metadata. - Extends the pipeline + OCP construction to support
mode="skidpad"with per-node time weighting and an optional terminal-speed constraint. - Adds skidpad-specific plotting and exports a
timedcolumn in the reference trajectory CSV.
Reviewed changes
Copilot reviewed 11 out of 13 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/visualization/skidpad_plots.py | New skidpad diagnostics plotter (timed laps, corridor, forces/inputs). |
| src/vehicle_models/four_wheel.py | Swaps default lf/lr values used by the four-wheel model. |
| src/tracks/skidpad.py | New skidpad track generator producing analytic centerline + widths + timed mask. |
| src/pipeline.py | Adds skidpad config fields and a dedicated skidpad pipeline path; passes time weights/terminal speed into the OCP. |
| src/optimization/global_ocp.py | Adds optional time_weights objective shaping and optional terminal_speed constraint; records skidpad timing metadata. |
| src/export/trajectory.py | Adds timed column to exported controller-reference CSV (from solution timed_mask). |
| src/config.py | Adds skidpad-specific run configuration fields and updates vehicle lf/lr. |
| data/tracks/skidpad/skidpad_map.csv | Adds a skidpad cone map dataset. |
| configs/trackdrive.yaml | Updates vehicle geometry (lf/lr) and tire D_* parameters. |
| configs/skidpad.yaml | New skidpad run configuration (vehicle + pipeline mode/inputs). |
| configs/autox.yaml | Updates vehicle geometry (lf/lr). |
| .gitignore | Ignores generated discretized tracks, solutions, exports, and plot outputs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+675
to
+678
| # Skidpad uses a dedicated builder (overlapping path can't go through the | ||
| # generic spline/bounds machinery); the OCP/export/plot steps are reused. | ||
| if config.mode == "skidpad" or config.track_type == "skidpad": | ||
| return _run_skidpad_pipeline(config, end_at) |
Comment on lines
+238
to
+242
| R_c = geo["R_c"] | ||
| w_out = geo["R_out"] - R_c | ||
| w_in = R_c - geo["R_in"] | ||
| entry_exit_halfwidth = w_out | ||
|
|
| "c_second": c_second, | ||
| "sign_first": sign_first, | ||
| "gate": gate, | ||
| "axis": normal, |
Comment on lines
+199
to
+200
| def _linear_blend(s: np.ndarray, s_node: float, kappa_node: np.ndarray, | ||
| joints: List[Tuple[float, float, float]], half: float) -> np.ndarray: |
Comment on lines
+89
to
+93
| dpsi, _ = _signed_curvature(ref_xy) | ||
| left_pts = ref_xy[dpsi > kappa_thresh] | ||
| right_pts = ref_xy[dpsi < -kappa_thresh] | ||
| c_left, _ = _circle_fit(left_pts) | ||
| c_right, _ = _circle_fit(right_pts) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.