Skip to content

Commit

Permalink
fix: more precise mpc
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruslan Shaiakhmetov committed Jun 7, 2024
1 parent c80f1a7 commit 250e1ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,8 @@ def abu_dhabi():
"algorithm": "mpc",
"track": "ABU_F2.csv",
}
mpc_list_in = np.arange(0.8, 1.6, 0.002)
mpc = run_parallel(mpc_parameters, mpc_list_in, "pacejka_D")
plot_line_shadow(mpc_list_in, mpc, "--", "red", "MPC")
mpc = run_parallel(mpc_parameters, list_in, "pacejka_D")
plot_line_shadow(list_in, mpc, "--", "red", "MPC")

N_list = [50, 100, 200, 400]
for i in range(4):
Expand Down Expand Up @@ -414,7 +413,7 @@ def ph_vs_ds():
print(f"Look at the picture: img/Ds_vs_ph.pdf")


if __name__ == "__main__":
if __name__ == "__main__":
# Execute the following functions when the script is run as the main program.

ph_vs_ds()
Expand Down
2 changes: 1 addition & 1 deletion source/mpc_tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def control_step(self) -> model.Racecar_Action:
)
yaw_0 = torch.tensor(self.model.state.heading).to(self.device)

relative_cost_threshold = 0.001 # Stop if improvement is less than 1%
relative_cost_threshold = 0.000001 # Stop if improvement is less than 1%
previous_loss = float("inf")

for iter in range(0, 200):
Expand Down

0 comments on commit 250e1ee

Please sign in to comment.