Commit 74b6b905 authored by Claudio Mandrioli's avatar Claudio Mandrioli
Browse files

removed more comments with unused code

parent e74a82a1
......@@ -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,:);
......
......@@ -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
......
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