Commit d6324aa8 authored by mmroma's avatar mmroma
Browse files

Cleaning up folder structure and gitignoring extra simulink files and folders...

Cleaning up folder structure and gitignoring extra simulink files and folders (still in progress through next commit or so).
parent 9714900e
.DS_Store
*.asv
\ No newline at end of file
*.asv
*.slxc
\ No newline at end of file
No preview for this file type
% Determing how DCM_be works
%% 1) Let's set our Roll, Pitch, Yaw angles to things we understand
phi = 0; % (rad)
theta = 0.2; % (rad)
psi = 0; % (rad)
%% 2) Let's call the function we used in our MATLAB-based implementation
R_V1 = rpy_to_R(phi, theta, psi);
%% 3) Let's consruct and call the DCM_be output variable
simData = sim('dcm_be_test');
R_V2 = simData.R_DCM_be(:,:,end);
R_V2_T = simData.R_DCM_be_transpose(:,:,end);
R_V3 = simData.R_our_version(:,:,end);
R_V3_T = simData.R_our_version_transpose(:,:,end);
phi_theta_psi_from_sim = simData.phi_theta_psi(end,:);
%%
function [R] = rpy_to_R(phi, theta, psi)
%rpy_to_R Convert Euler Angles (roll, pitch, yaw) to Rotation matrix
R = [cos(theta)*cos(psi) sin(phi)*sin(theta)*cos(psi)-cos(phi)*sin(psi) cos(phi)*sin(theta)*cos(psi)+sin(phi)*sin(psi);
cos(theta)*sin(psi) sin(phi)*sin(theta)*sin(psi)+cos(phi)*cos(psi) cos(phi)*sin(theta)*sin(psi)-sin(phi)*cos(psi);
-sin(theta) sin(phi)*cos(theta) cos(phi)*cos(theta)];
end
<?xml version="1.0" encoding="UTF-8"?>
<MF0 version="1.1" packageUris="http://schema.mathworks.com/mf0/SlCache/19700101">
<slcache.FileAttributes type="slcache.FileAttributes" uuid="3cfbb2c2-0a3a-4ed7-9132-3518e66df790">
<checksum>1L/Qb0pA8kmsVEy4QdEqDw==</checksum>
</slcache.FileAttributes>
</MF0>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<MF0 version="1.1" packageUris="http://schema.mathworks.com/mf0/SlCache/19700101">
<slcache.FileAttributes type="slcache.FileAttributes" uuid="ecbe362c-eb41-45a0-9bc7-8091673b05af">
<checksum>vpYT2iJYuLBidZiXrAcE0Q==</checksum>
</slcache.FileAttributes>
</MF0>
\ No newline at end of file
......@@ -7,20 +7,28 @@ addpath(genpath(pwd));
% a = 2.1;
%% Set up Parameters
traj_num = 1;
traj_num = 2;
params = setUpParameters(traj_num);
%% Load Top Level Simulink Model (helps Simulink load ahead of time)
open('coop_payload_sim');
%%
% call simulink
simData = sim('coop_payload_sim');
% simData = sim('coop_payload_sim');
simData = sim('coop_payload_sim','StartTime','0','StopTime',num2str(params.tFinal));
%%
% simData = out;
% sim('modelName','StartTime','0','StopTime','10','FixedStep','0.2');
%% 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');
% 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');
plot_force(simData.tout, simData.q1_F_tether, 'Q1 Tether_G');
%% Animate
animate_simulink_data(simData, params);
......
#ifndef CF_coop_payload_sim_H__
#define CF_coop_payload_sim_H__
#endif
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment