Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sim_ws/src/scripts/map_preparation/raceline_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
@dataclass(frozen=True)
class RacelineConfig:
# Map files
map_folder: str = "../raceLine_maker/slam_maps"
forced_map_basename: str = ""
map_folder: str = "slam_maps"
forced_map_basename: str = "slam_map_20260503_222842_clean"

# Output
csv_folder: str = "saved/"
Expand All @@ -16,7 +16,7 @@ class RacelineConfig:

# A* tuning
safety_weight: float = 100
turn_weight: float = 8.0
turn_weight: float = 0.0

# Raceline mode: "astar", "min_curvature" or "manual_spline"
raceline_mode: str = "min_curvature"
Expand Down
8 changes: 8 additions & 0 deletions sim_ws/src/scripts/map_preparation/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
numpy
opencv-python
PyYAML
matplotlib
scipy
scikit-image
Pillow
cvxpy
5 changes: 3 additions & 2 deletions sim_ws/src/scripts/map_preparation/utils/map_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,15 @@ def find_latest_map_pair(map_folder):
if not os.path.isfile(pgm_path):
continue

candidates.append((m.group(1), entry, pgm_name))
is_clean = stem.endswith("_clean")
candidates.append((m.group(1), is_clean, entry, pgm_name))

if not candidates:
raise FileNotFoundError(
f"No timestamped YAML/PGM map pairs found in '{map_folder}'."
)

_, yaml_name, pgm_name = max(candidates, key=lambda x: x[0])
_, _, yaml_name, pgm_name = max(candidates, key=lambda x: (x[0], x[1]))
return yaml_name, pgm_name


Expand Down
Loading