Commit 3991274a authored by mmroma's avatar mmroma
Browse files

added wind back in. fixed a bug in quadrotor drag (was negated).

parent 727d0a75
......@@ -86,7 +86,7 @@ function [params] = setUpParameters(traj_num)
end
%% Set Wind Parameters
params.wind.enable = 0;
params.wind.enable = 1;
params.wind.speed = 0; % (m/s)
params.wind.yaw = 0; % (rad). 0 = +x, pi/2 = +y
......
......@@ -12,7 +12,7 @@ function [F_Drag] = calc_drag_force_vehicle(X, Thrust_Force_Mag, params_global)
%% 1) Calculate Drag Force on Quadrotor
V_W_Vi_rel_Vi = R_V_G' * params_global.wind.R_W_G * [params_global.wind.speed; 0; 0] - [X.u;X.v;X.w];
F_Drag = - params_global.wind.C_bar_d * Thrust_Force_Mag * V_W_Vi_rel_Vi;
F_Drag = params_global.wind.C_bar_d * Thrust_Force_Mag * V_W_Vi_rel_Vi;
%% 2) Allow for parameter to enable/disable drag force
if params_global.wind.enable == 0
......
......@@ -24,7 +24,8 @@ simData = sim('coop_payload_sim','StartTime','0','StopTime',num2str(params.tFina
% 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');
% plot_force(simData.tout, simData.q1_F_tether, 'Q1 Tether_G');
plot_force(simData.tout, simData.q1_F_drag, 'Q1 Drag_V');
%% Animate
animate_simulink_data(simData, params);
......
Markdown is supported
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