Skip to content

feat: add skidpad track builder with symmetric centerline - #1

Closed
rafaelborges5 wants to merge 8 commits into
mainfrom
claude/skidpad-lto-analysis-3yuvj4
Closed

rafaelborges5 wants to merge 8 commits into
mainfrom
claude/skidpad-lto-analysis-3yuvj4

Conversation

@rafaelborges5

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings June 30, 2026 22:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 timed column 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 thread src/pipeline.py
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 thread src/tracks/skidpad.py
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

Comment thread src/tracks/skidpad.py
"c_second": c_second,
"sign_first": sign_first,
"gate": gate,
"axis": normal,
Comment thread src/tracks/skidpad.py
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 thread src/tracks/skidpad.py
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants