Skip to content
Snippets Groups Projects
Commit 42a99693 authored by Alessandro Del Duca's avatar Alessandro Del Duca
Browse files

Added Fix simulation

parent fe4d40e3
Branches
No related tags found
No related merge requests found
......@@ -100,6 +100,8 @@ P_c(:,:,1) = P_prev;
index_GPS=1;
index_bar=1;
index_mag=1;
for i=2:length(t_v)
%Prediction part
[x_lin(i,:),P_lin(:,:,i)] = predictorLinear(x_lin(i-1,:),dt_k,...
......
......@@ -350,6 +350,8 @@ while flagStopIntegration || n_old < nmax
end
[fix,nsat] = gpsFix(accel(end,:));
if iTimes==1
x_prev = [X0; V0; Q0(2:4); Q0(1);0;0;0];
P_prev = 0.01*eye(12);
......
function [fix, n_sat] = gpsFix(accel)
% Routine to simulate the data acquisition from the sensors
% Author: Alessandro Del Duca
% Skyward Experimental Rocketry | ELC-SCS Dept
% email: alessandro.delduca@skywarder.eu
% Revision date: 18/03/2021
a = mean(accel,1);
if norm(a)/9.81 < 2
fix = 1;
n_sat = 4;
else
if rand(1) < 0.98
fix = 1;
n_sat = 4;
else
fix = 0;
n_sat = 0;
end
end
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment