Skip to content

Commit

Permalink
small edit
Browse files Browse the repository at this point in the history
  • Loading branch information
pmusau17 committed Sep 30, 2021
1 parent 7a7cb85 commit 31dee3b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions learning_dompc/bicyclemodel/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,14 @@ def run_closedloop(self):
mpc_graphics = do_mpc.graphics.Graphics(self.mpc.data)
sim_graphics = do_mpc.graphics.Graphics(self.simulator.data)

inputs = []
states = []
for k in range(self.n_steps):
u0 = self.mpc.make_step(self.x0)
inputs.append(u0)
y_next = self.simulator.make_step(u0)
x0 = self.estimator.make_step(y_next)

print(x0)


fig, ax = plt.subplots(6, sharex=True, figsize=(16,9))
fig.align_ylabels()
Expand Down Expand Up @@ -235,5 +236,5 @@ def update(t_ind):
# line 119 track_porto_26780.csv
x0 = np.asarray([0.958413,0.810734,0.750340,1.003465])
xt = [1.567785, 1.381567, 0.754297, 0.999855]
bmpc = BicycleMPC(x0,xt[0],xt[1],n_steps=20).run_closedloop()
bmpc = BicycleMPC(x0,xt[0],xt[1],n_steps=20,static_plot=True).run_closedloop()

0 comments on commit 31dee3b

Please sign in to comment.