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
2 changes: 1 addition & 1 deletion sim_ws/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ RUN echo "export RCUTILS_COLORIZED_OUTPUT=1 " >> ~/.bashrc
RUN echo -e "b() { \n source /opt/ros/humble/setup.bash\n cd /sim_ws || exit \n colcon build "$@" --packages-ignore range_libc particle_filter --symlink-install\n source install/local_setup.bash\n \n}" >> ~/.bashrc

# Fix for 'no module name 'numba' with docker compose 2.40
RUN pip3 install transforms3d gymnasium numba scipy pyglet pillow "matplotlib<=3.8"
RUN pip3 install transforms3d gymnasium numba scipy pyglet pillow "matplotlib<=3.8" "cvxpy==1.4" "scikit-image<0.20"


# -----------------------------
Expand Down
19 changes: 17 additions & 2 deletions sim_ws/src/scripts/map_preparation/utils/min_curvature.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,24 @@ def solve_min_curvature_raceline(
]

prob = cp.Problem(cp.Minimize(cost), constraints)
prob.solve(solver=cp.OSQP, verbose=False, max_iter=10000, eps_abs=1e-6, eps_rel=1e-6)
solver_attempts = [
(cp.ECOS, dict(verbose=False, max_iters=2000, abstol=1e-7, reltol=1e-7)),
(cp.OSQP, dict(verbose=False, max_iter=10000, eps_abs=1e-6, eps_rel=1e-6)),
(cp.SCS, dict(verbose=False, max_iters=2500, eps=1e-5)),
]

solved = False
for solver, solver_kwargs in solver_attempts:
try:
prob.solve(solver=solver, **solver_kwargs)
except cp.error.SolverError:
continue

if alpha.value is not None:
solved = True
break

if alpha.value is None:
if not solved:
print("[WARNING] Solver did not converge — returning centreline as fallback.")
return p, np.zeros(N)

Expand Down
Loading