From 74b6b9052277c8f9533abcfbf3692019658fb065 Mon Sep 17 00:00:00 2001
From: Claudio <claudio.mandrioli@control.lth.se>
Date: Tue, 26 Feb 2019 17:05:12 +0100
Subject: [PATCH] removed more comments with unused code

---
 matlab/GPSaidedINS_car.m     | 13 +------------
 matlab/GPSaidedINS_cycling.m | 22 ++++------------------
 2 files changed, 5 insertions(+), 30 deletions(-)

diff --git a/matlab/GPSaidedINS_car.m b/matlab/GPSaidedINS_car.m
index 3a6f10d..d84bef9 100644
--- a/matlab/GPSaidedINS_car.m
+++ b/matlab/GPSaidedINS_car.m
@@ -86,7 +86,7 @@ for k=2:N
     %%%%%%%%%%%%%%%%%
     %randomized number of visible satellites
     sv = random_satellites(sv);
-    %sv=5;
+    %sv=5;                               %uncomment for simulations without loss of visibility 
     %control action
     P_store=[P_store,sum(sqrt(out_data.diag_P(1:3,k-1)))];
     if sum(sqrt(out_data.diag_P(1:3,k-1)))<P_treshold
@@ -95,7 +95,6 @@ for k=2:N
         turn=true;
     end
     %update sensor state
-%     pre_state=sensor.state;
     sensor=gps_randomized_car(t(k),sensor,turn,sv); %remove _randomized for worst case
     %determine if GPS position is available
     GPS_position=strcmp(sensor.state,'position_available');
@@ -104,12 +103,6 @@ for k=2:N
         energy=energy+power*Ts;
     end
     
-%      %print new state and current time if it changes
-%      if ~strcmp(pre_state, sensor.state)
-%          sensor.state
-%          t(k)
-%      end
-    
     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     
     % Calibrate the sensor measurements using current sensor bias estimate.
@@ -168,10 +161,6 @@ for k=2:N
     out_data.turn(k)=turn;
 end
 
-%% plot feedback over P matrix
-%figure(11)
-%plot(P_store),grid
-
 %% output for simulation of energy-accuracy tradeoff 
 out_data.energy=energy;
 xest = out_data.x_h(2,:);
diff --git a/matlab/GPSaidedINS_cycling.m b/matlab/GPSaidedINS_cycling.m
index e0e9202..aa17f2b 100644
--- a/matlab/GPSaidedINS_cycling.m
+++ b/matlab/GPSaidedINS_cycling.m
@@ -92,7 +92,7 @@ for k=start_sim:start_sim+length_sim
     %%%%%%%%%%%%%%%%%
     %randomized number of visible satellites
     sv = random_satellites(sv);
-    %sv=5;
+    %sv=5;                               %uncomment for simulations without loss of visibility 
     %control action
     P_store=[P_store,sum(sqrt(out_data.diag_P(1:3,k-1)))];
     if sum(sqrt(out_data.diag_P(1:3,k-1)))<P_treshold
@@ -101,7 +101,6 @@ for k=start_sim:start_sim+length_sim
         turn=true;
     end
     %update sensor state
-%     pre_state=sensor.state;
     sensor=gps_randomized_cycling(t(k),sensor,turn,sv); %remove _randomized for worst case
     %determine if GPS position is available
     GPS_position=strcmp(sensor.state,'position_available');
@@ -110,12 +109,6 @@ for k=start_sim:start_sim+length_sim
         energy=energy+power*Ts;
     end
     
-%      %print new state and current time if it changes
-%      if ~strcmp(pre_state, sensor.state)
-%          sensor.state
-%          t(k)
-%      end
-    
     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     
     % Calibrate the sensor measurements using current sensor bias estimate.
@@ -171,26 +164,19 @@ for k=start_sim:start_sim+length_sim
     out_data.diag_P(:,k)=diag(P);
     out_data.delta_u_h(:,k)=delta_u_h;
     out_data.sv(k)=sv;
-    turn_store=[turn_store, turn];
+    out_data.turn(k)=turn;
 end
 
-%% plot feedback over P matrix
-%figure(11)
-%plot(P_store),grid
-
 %% output for simulation of energy-accuracy tradeoff 
 out_data.energy=energy;
-
-xest = out_data.x_h(2,start_sim:start_sim+length_sim);%2,:);
-yest = out_data.x_h(1,start_sim:start_sim+length_sim);%1,:);
+xest = out_data.x_h(2,start_sim:start_sim+length_sim);
+yest = out_data.x_h(1,start_sim:start_sim+length_sim);
 xgps = interp1(in_data.GNSS.t,in_data.GNSS.pos_ned(2,:),in_data.IMU.t(start_sim:start_sim+length_sim),'linear','extrap')';
 ygps = interp1(in_data.GNSS.t,in_data.GNSS.pos_ned(1,:),in_data.IMU.t(start_sim:start_sim+length_sim),'linear','extrap')';
 xerr = xest - xgps; 
 yerr = yest - ygps;
 out_data.error = sqrt(mean(xerr.^2+yerr.^2));
 out_data.P_store=P_store;
-out_data.turn=turn_store;
-
 end
 
 
-- 
GitLab