summaryrefslogtreecommitdiffstats
path: root/templates/simulate.m
diff options
context:
space:
mode:
authorYanzhenXiangRobotics <xyz000327@gmail.com>2023-05-10 23:30:01 +0200
committerYanzhenXiangRobotics <xyz000327@gmail.com>2023-05-10 23:30:01 +0200
commit3d6ef58ff1edee6d882a8d9cbe97625ff26afe6e (patch)
tree070832993dd8b63ee2aa70ee6f611d4d139f1d65 /templates/simulate.m
parentRevert mistakenly pushed to master (diff)
downloadmpc_pe-3d6ef58ff1edee6d882a8d9cbe97625ff26afe6e.tar.gz
mpc_pe-3d6ef58ff1edee6d882a8d9cbe97625ff26afe6e.zip
Revert to handout
Diffstat (limited to 'templates/simulate.m')
-rw-r--r--templates/simulate.m15
1 files changed, 0 insertions, 15 deletions
diff --git a/templates/simulate.m b/templates/simulate.m
index 6100434..3138cd1 100644
--- a/templates/simulate.m
+++ b/templates/simulate.m
@@ -10,20 +10,5 @@ function [Xt,Ut,ctrl_info] = simulate(x0, ctrl, params)
% YOUR CODE HERE
% Hint: you can access the control command with ctrl.eval(x(:,i))
- Xt = [x0];
- Ut = [];
- x = x0
- ctrl_info = [];
- % obj = LQR();
- for i = 1:params.model.HorizonLength
- [u, ctrl_info_] = ctrl.eval(x);
- Ut = [Ut u];
- ctrl_info = [ctrl_info ctrl_info_];
- x = params.model.A*x + params.model.B*u;
- Xt = [Xt x];
- end
- plot_trajectory(Xt, Ut, ctrl_info, params);
-% Ut = u;
-% Xt = x;
end \ No newline at end of file