-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathRUN_SIMULATION_SCRIPT.m
43 lines (35 loc) · 1.38 KB
/
RUN_SIMULATION_SCRIPT.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
clear all; clc;
global Params Desired integral prev;
run parameters_realtime.m;
%run importfile.m;
% Set any custom initial conditions here
% quat = angle2quat(0, 0, 0, 'XYZ');
%LQR Initial Conditions
Params.x0(1) = 0; ... x
Params.x0(2) = 0; ... y
Params.x0(3) = 0; ... z
Params.x0(4) = 0;
%
% Params.x0(7) = quat(1);
% Params.x0(8) = quat(2);
% Params.x0(9) = quat(3);
% Params.x0(10) = quat(4);
% Params.x0(11)= 0.1;
% Params.x0(12)= 0.1;
% Params.x0(13)= 0.1;
%% PID Controls
%% Attitude Controller
options = simset('SrcWorkspace','current');
%sim('AnimationAttControllerVariableQuadDynamicsMdl.slx',[],options);
%sim('models/HeadlessAttRateControllerVariableQuadDynamicsMdl.slx',[],options);
%sim('models/HeadlessAttControllerVariableQuadDynamicsMdl.slx',[],options);
sim('models/HeadlessPositionControllerVariableQuadDynamicsMdl.slx',[],options);
%sim('models/HeadlessAttControllerVariableQuadDynamicsMdl.slx',[],options);
%sim('models/Helical_Traj_HeadlessPositionControllerVariableQuadDynamicsMdl.slx',[],options);
%sim('models/PID_HeadlessWaypointControllerVariableQuadDynamicsMdl.slx',[],options)
%sim('models/PID_HeadlessTrackingControllerVariableQuadDynamicsMdl.slx',[],options)
%sim('models/LQR_3_HeadlessPositionControllerVariableQuadDynamicsMdl.slx',[],options)
run LogPLotter.m
%run LogPLotterAtt.m
visualize_test_dp(States)
visualize_test_dp_vec(States, Control_Command, Vector)