coopPayloadSim.m 1.05 KB
Newer Older
mmroma's avatar
mmroma committed
1
%% Cooperative Payload Simulator
mmroma's avatar
mmroma committed
2
3
4
5
6
7
% Author: Matthew Romano (mmroma@umich.edu)
% Date: 1/21/2019

% This is the high level script that calls all of the necessary functions
% to run the simulation. When tuning and testing, changes should be made to
% the parameters files (called by setUpParameters() ).
mmroma's avatar
mmroma committed
8
% Run simulink model
mmroma's avatar
mmroma committed
9

mmroma's avatar
mmroma committed
10
%% Add Necessary Folders to MATLAB Path (add everything)
11
addpath(genpath(pwd));
mmroma's avatar
mmroma committed
12

mmroma's avatar
mmroma committed
13
14
15
16
17
18
19
20
21
22
23
24
25
26
%% Set up Parameters
traj_num = 2;
params = setUpParameters(traj_num);

%% Load Top Level Simulink Model (helps Simulink load ahead of time)
open('coop_payload_sim');

%% Call Simulink and Run the Simulation
simData = sim('coop_payload_sim','StartTime','0','StopTime',num2str(params.tFinal));

%% Plot
% plot_position(simData.tout, simData.q1_X, simData.q1_Xd);
% plot_orientation(simData.tout, simData.q1_X, simData.q1_Xd);
% plot_force(simData.tout, simData.q1_F_gravity, 'Q1 Gravity');
27
28
% plot_force(simData.tout, simData.q1_F_tether, 'Q1 Tether_G');
plot_force(simData.tout, simData.q1_F_drag, 'Q1 Drag_V');
mmroma's avatar
mmroma committed
29
30
31

%% Animate
animate_simulink_data(simData, params);
32
33


mmroma's avatar
mmroma committed
34

mmroma's avatar
mmroma committed
35
36
37



38
39