summaryrefslogtreecommitdiffstats
path: root/templates/compute_tightening.m
diff options
context:
space:
mode:
authorYanzhenXiang <54230111+YanzhenXiangRobotics@users.noreply.github.com>2023-11-06 16:49:26 +0100
committerGitHub <noreply@github.com>2023-11-06 16:49:26 +0100
commitd6b96c55ebb89ebd6e2d990ec89122799c68a230 (patch)
tree7a837438da9e07a5e77658c6d882577fff8bcae1 /templates/compute_tightening.m
parentUpdate 23 (diff)
parentupdate the new submission zip generated from npross branch (diff)
downloadmpc_pe-d6b96c55ebb89ebd6e2d990ec89122799c68a230.tar.gz
mpc_pe-d6b96c55ebb89ebd6e2d990ec89122799c68a230.zip
Merge pull request #1 from YanzhenXiangRobotics/submissionHEADmaster
Submission
Diffstat (limited to '')
-rw-r--r--templates/compute_tightening.m18
1 files changed, 18 insertions, 0 deletions
diff --git a/templates/compute_tightening.m b/templates/compute_tightening.m
index 8919d12..7095f9c 100644
--- a/templates/compute_tightening.m
+++ b/templates/compute_tightening.m
@@ -8,4 +8,22 @@
function params = compute_tightening(K_tube,H_tube,h_tube,params)
% YOUR CODE HERE
+ Hx = params.constraints.StateMatrix;
+ hx = params.constraints.StateRHS;
+
+ Hu = params.constraints.InputMatrix;
+ hu = params.constraints.InputRHS;
+
+ Pxz = Polyhedron('A',Hx,'b',hx);
+ Puz = Polyhedron('A',Hu,'b',hu);
+ % Ptube = Polyhedron('A',H_tube,'b',h_tube);
+
+ Px_tube = Pxz.minus(Polyhedron('A',H_tube,'b',h_tube));
+ params.constraints.StateMatrix = Px_tube.A;
+ params.constraints.StateRHS = Px_tube.b;
+
+ Pu_tube = Puz.minus(K_tube*Polyhedron('A',H_tube,'b',h_tube))
+% Pu_tube = Puz.minus(Polyhedron('A',H_tube*K_tube,'b',h_tube));
+ params.constraints.InputMatrix = Pu_tube.A;
+ params.constraints.InputRHS = Pu_tube.b;
end \ No newline at end of file