mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-29 02:43:47 +08:00
back to open loop (#19781)
old-commit-hash: bf5332c4918c2340126cada543b9068fea731716
This commit is contained in:
@@ -171,13 +171,6 @@ class PathPlanner():
|
||||
y_pts = np.interp(self.t_idxs[:MPC_N+1], np.linalg.norm(d_path_xyz, axis=1)/v_ego, d_path_xyz[:,1])
|
||||
heading_pts = np.interp(self.t_idxs[:MPC_N+1], np.linalg.norm(self.path_xyz, axis=1)/v_ego, self.plan_yaw)
|
||||
|
||||
# init state
|
||||
self.cur_state.x = 0.0
|
||||
self.cur_state.y = 0.0
|
||||
self.cur_state.psi = 0.0
|
||||
# TODO negative sign, still run mpc in ENU, make NED
|
||||
self.cur_state.delta = -math.radians(angle_steers - angle_offset) / VM.sR
|
||||
|
||||
v_ego_mpc = max(v_ego, 5.0) # avoid mpc roughness due to low speed
|
||||
v_poly = [0.0, 0.0, 0.0, v_ego_mpc]
|
||||
assert len(v_poly) == 4
|
||||
@@ -189,6 +182,11 @@ class PathPlanner():
|
||||
CAR_ROTATION_RADIUS,
|
||||
list(y_pts),
|
||||
list(heading_pts))
|
||||
# init state for next
|
||||
self.cur_state.x = 0.0
|
||||
self.cur_state.y = 0.0
|
||||
self.cur_state.psi = 0.0
|
||||
self.cur_state.delta = interp(DT_MDL, self.t_idxs[:MPC_N+1], self.mpc_solution.delta)
|
||||
|
||||
# TODO this needs more thought, use .2s extra for now to estimate other delays
|
||||
delay = CP.steerActuatorDelay + .2
|
||||
|
||||
@@ -1 +1 @@
|
||||
61b7527b95d7a573a8c11ff8c260a4f01cc15113
|
||||
57d9562d7e6103746090570c6be200c54296c95f
|
||||
Reference in New Issue
Block a user