mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-02 03:52:11 +08:00
Fix division by zero in lateral_planner.py (#20071)
* Fix division by zero * Change fix logic old-commit-hash: 8f9ee10b8a1aeeac26c5b269c1137984b172b378
This commit is contained in:
@@ -188,7 +188,7 @@ class LateralPlanner():
|
||||
next_curvature = interp(delay, self.t_idxs[:MPC_N+1], self.mpc_solution.curvature)
|
||||
psi = interp(delay, self.t_idxs[:MPC_N+1], self.mpc_solution.psi)
|
||||
next_curvature_rate = self.mpc_solution.curvature_rate[0]
|
||||
next_curvature_from_psi = psi/(v_ego*delay)
|
||||
next_curvature_from_psi = psi/(max(v_ego, 1e-1) * delay)
|
||||
if psi > self.mpc_solution.curvature[0] * delay * v_ego:
|
||||
next_curvature = max(next_curvature_from_psi, next_curvature)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user