mirror of
https://github.com/ROB-535-F21-Team-3/Control-Project.git
synced 2025-08-21 10:02:46 +00:00
File Renaming / Reorganization & Minor Changes
- Add 1/2 coefficient to cost function - Move `MPC_Class.m` to "Deliverables" folder - Modify `part2_test_controller.m` plotting style a bit - Rename `part2_MPC_controller.m` to `sravan_MPC_controller.m`
This commit is contained in:
@@ -200,7 +200,7 @@ classdef MPC_Class
|
|||||||
H = diag(H);
|
H = diag(H);
|
||||||
|
|
||||||
% Evaluate cost function (quadratic function)
|
% Evaluate cost function (quadratic function)
|
||||||
J = Z_err.' * H * Z_err;
|
J = 0.5 * Z_err.' * H * Z_err;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@@ -9,13 +9,17 @@ info = getTrajectoryInfo(Y,U)
|
|||||||
|
|
||||||
%% Figures
|
%% Figures
|
||||||
% Plot segmented trajectory for debugging purposes
|
% Plot segmented trajectory for debugging purposes
|
||||||
|
close all;
|
||||||
figure(1)
|
figure(1)
|
||||||
hold on;
|
hold on;
|
||||||
grid on;
|
grid on;
|
||||||
|
|
||||||
plot(Y(:,1), Y(:,3), '-');
|
|
||||||
|
|
||||||
load('TestTrack.mat')
|
load('TestTrack.mat')
|
||||||
plot(TestTrack.bl(1,:), TestTrack.bl(2,:), '--r');
|
load('ROB535_ControlProject_part1_Team3.mat')
|
||||||
plot(TestTrack.br(1,:), TestTrack.br(2,:), '--r');
|
|
||||||
plot(TestTrack.cline(1,:), TestTrack.cline(2,:), '-.g');
|
plot(Y(:,1), Y(:,3), 'b-');
|
||||||
|
plot(ROB535_ControlProject_part1_state(:,1), ROB535_ControlProject_part1_state(:,3), 'k-');
|
||||||
|
|
||||||
|
plot(TestTrack.bl(1,:), TestTrack.bl(2,:), 'r.-');
|
||||||
|
plot(TestTrack.br(1,:), TestTrack.br(2,:), 'r.-');
|
||||||
|
plot(TestTrack.cline(1,:), TestTrack.cline(2,:), 'g.-');
|
Reference in New Issue
Block a user