Skip to content

Corridor-aware planner: boundary tracking, trap-avoidance, race-line heuristic, tests & Docker#1

Open
Weiores wants to merge 1 commit into
mainfrom
codex/improve-track-detection-and-driving-behavior
Open

Corridor-aware planner: boundary tracking, trap-avoidance, race-line heuristic, tests & Docker#1
Weiores wants to merge 1 commit into
mainfrom
codex/improve-track-detection-and-driving-behavior

Conversation

@Weiores

@Weiores Weiores commented Feb 27, 2026

Copy link
Copy Markdown
Owner

Motivation

  • The original planner selected the deepest LiDAR gap and was vulnerable to trap openings and off-track choices, so a corridor-aware approach was needed to respect track boundaries and avoid unsafe openings.
  • The vehicle should follow a more optimal racing line (outside-inside-outside) rather than simply aiming for the largest open bearing.
  • Changes must be limited to the gap_finder package and be verifiable with pure-Python unit tests and a Docker-based test runner.

Description

  • Add a new CorridorPlanner in gap_finder/gap_finder/planner.py that sanitizes scans, extracts left/right boundary features with confidence, computes a safe corridor, detects trap openings, applies a race-line bias, and scores candidate angles (clearance + race-term + smoothness) rather than taking a raw max-range index.
  • Replace the old logic in scripts/gap_finder_base.py to call the new planner and expose tunable parameters (e.g. track_width_estimate, boundary_confidence_threshold, trap_range_jump_threshold, race_line_bias_strength, steering_smoothing_alpha, speed_reduction_on_low_confidence).
  • Add unit tests f1tenth_ws/src/gap_finder/tests/test_planner.py that use synthetic LaserScan-like arrays for straight corridor, left curve, trap opening, and missing-boundary scenarios.
  • Add f1tenth_ws/src/gap_finder/Dockerfile and update README.md with exact commands to build/run tests in Docker, and export planner types via gap_finder/gap_finder/__init__.py.

Testing

  • Ran the unit test suite locally with PYTHONPATH=f1tenth_ws/src/gap_finder pytest -q f1tenth_ws/src/gap_finder/tests which completed successfully: 4 passed.
  • Attempted to run the Docker build from the environment with docker build -t gap-finder-tests -f f1tenth_ws/src/gap_finder/Dockerfile f1tenth_ws/src/gap_finder but the docker CLI is not available in this environment, so the Docker build/run could not be executed here.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant