diff --git a/matlab/GPSaidedINS.m b/matlab/GPSaidedINS.m index 75c96af77f12bd667d1b3928ee2ae9fc501173ac..655499e18a24e4861bb85a118e90acb9008de963 100644 --- a/matlab/GPSaidedINS.m +++ b/matlab/GPSaidedINS.m @@ -305,12 +305,12 @@ end function sv=random_satellites(sv_old) coin=random('uniform',0,1); sv=sv_old; -if sv_old==6 %simulate satellite loss of visibility +if sv_old==6 if coin<0.005 sv=5; end end -if sv_old==5 %simulate satellite loss of visibility +if sv_old==5 if coin>0.99 sv=6; end @@ -318,7 +318,7 @@ if sv_old==5 %simulate satellite loss of visibility sv=4; end end -if sv_old==4 %simulate satellite loss of visibility +if sv_old==4 if coin>0.99 sv=5; end @@ -326,7 +326,7 @@ if sv_old==4 %simulate satellite loss of visibility sv=3; end end -if sv_old==3 %simulate satellite loss of visibility +if sv_old==3 if coin>0.95 sv=4; end diff --git a/matlab/GPSaidedINS_cycling.m b/matlab/GPSaidedINS_cycling.m index 9461e86a61baa6fea50ac7e393ddee71644158bd..c784438b98f728da443e702c20206a0a2d2b6265 100644 --- a/matlab/GPSaidedINS_cycling.m +++ b/matlab/GPSaidedINS_cycling.m @@ -35,9 +35,15 @@ function out_data=GPSaidedINS(in_data,settings) u=[in_data.IMU.acc;in_data.IMU.gyro]; t=in_data.IMU.t; +%% Information fusion +start_sim=822799; %start index of time vector of IMU +[is, where]=ismember(in_data.IMU.t(start_sim),in_data.GNSS.t); %find same start on GPS time vector +ctr_gnss_data=where; +GPS_position=true; + %% Initialization % Initialize the navigation state -x_h=init_navigation_state(u,settings,in_data); +x_h=init_navigation_state(u,settings,in_data,where); % Initialize the sensor bias estimate delta_u_h=zeros(6,1); @@ -45,7 +51,6 @@ delta_u_h=zeros(6,1); % Initialize the Kalman filter [P,Q1,Q2,~,~]=init_filter(settings); - % Allocate memory for the output data N=size(u,2); out_data.x_h=zeros(10,N); @@ -55,15 +60,11 @@ out_data.diag_P(:,1)=diag(P); out_data.delta_u_h=zeros(6,N); turn_store=true; -%% Information fusion -ctr_gnss_data=1838; -GPS_position=true; - %% Initialize GPS sensor sensor.state='warm_start_available'; sensor.fetchfp=1.0; sensor.geteph=Inf; -sensor.ephExp=1800.0; +sensor.ephExp=in_data.IMU.t(start_sim)+180000.0; sensor.fp=0; sensor.eph=5; sv=5; %initialize the number of visible satellites @@ -77,7 +78,7 @@ P_store=0; %store summed valued of the trace of P in time sv_store=sv; %store number of visible satellites in time %for k=2:N -for k=200000:209000 +for k=start_sim:start_sim+20000 % Sampling period Ts=0.01;%t(k)-t(k-1); @@ -231,7 +232,7 @@ end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Init navigation state %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -function x_h=init_navigation_state(u,settings,in_data) +function x_h=init_navigation_state(u,settings,in_data,where) % Calculate the roll and pitch @@ -246,7 +247,7 @@ Rb2t=Rt2b([roll pitch settings.init_heading])'; q=dcm2q(Rb2t); % Initial navigation state vector -x_h=[in_data.GNSS.pos_ned(:,1838);zeros(3,1); q]; +x_h=[in_data.GNSS.pos_ned(:,where);zeros(3,1); q]; %x_h=[zeros(6,1); q]; end diff --git a/matlab/get_settings.m b/matlab/get_settings.m index 193930b7eb2a2f56a6c41101386af5d5dd59b6c8..f4946dd13c4a7cfbeb180a9eb158b2099c7f1bc3 100644 --- a/matlab/get_settings.m +++ b/matlab/get_settings.m @@ -25,8 +25,8 @@ settings.init_heading = 320*pi/180; % Process noise covariance (Q) % Standard deviations, need to be squared -settings.sigma_acc = 0.50;%0.05; % [m/s^2] -settings.sigma_gyro = 1.0*pi/180;%0.1*pi/180; % [rad/s] +settings.sigma_acc = 0.05; % [m/s^2] +settings.sigma_gyro = 0.1*pi/180; % [rad/s] settings.sigma_acc_bias = 0.0001; % [m/s^2.5] settings.sigma_gyro_bias = 0.01*pi/180; % [rad/s^1.5] diff --git a/matlab/get_settings_cycling.m b/matlab/get_settings_cycling.m new file mode 100644 index 0000000000000000000000000000000000000000..e4991dc3e38b3b50a8484d3d78e122ae4846be70 --- /dev/null +++ b/matlab/get_settings_cycling.m @@ -0,0 +1,50 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Function that outputs a struct "settings" with the settings used in the +% GNSS-aided INS +% +% Edit: Isaac Skog (skog@kth.se), 2016-09-01 +% Revised: Bo Bernhardsson 2018-01-01 +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +function settings=get_settings() + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% GENERAL PARAMETERS %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%settings.non_holonomic = 'off'; +%settings.speed_aiding = 'off'; + +settings.init_heading = 320*pi/180; + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% FILTER PARAMETERS %% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Process noise covariance (Q) +% Standard deviations, need to be squared +settings.sigma_acc = 0.50;%0.05; % [m/s^2] +settings.sigma_gyro = 1.0*pi/180;%0.1*pi/180; % [rad/s] +settings.sigma_acc_bias = 0.0001; % [m/s^2.5] +settings.sigma_gyro_bias = 0.01*pi/180; % [rad/s^1.5] + + +% GNSS position measurement noise covariance (R) +% Standard deviations, need to be squared +settings.sigma_gps = 1/sqrt(3);%3/sqrt(3); %[m] + +% Initial Kalman filter uncertainties (standard deviations) +settings.factp(1) = 10; % Position [m] +settings.factp(2) = 5; % Velocity [m/s] +settings.factp(3:5) = (pi/180*[1 1 20]'); % Attitude (roll,pitch,yaw) [rad] +settings.factp(6) = 0.02; % Accelerometer biases [m/s^2] +settings.factp(7) = (0.05*pi/180); % Gyro biases [rad/s] + + +end + + + + diff --git a/matlab/gps.m b/matlab/gps.m index 1a4600dd4b58c45d6d83360ddca4ddcc1eb99f6a..55f0ab917a6156e9e3dee6bcb6dcec4d08e38a61 100644 --- a/matlab/gps.m +++ b/matlab/gps.m @@ -43,7 +43,7 @@ sensor.eph=min(sensor_in.eph,sv); %% events ephemeris_expired=(time>sensor.ephExp)||(sensor.eph<required_sv); %ephemeris data are expired -lost_visibility=(sensor_in.fp~=sensor.fp)&&(sensor.fp<required_sv); +lost_visibility=(sensor.fp<required_sv); fetch_fp=(time-sensor_in.howLong)>=ttfs; get_ephemeris=(time-sensor_in.howLong)>ttge; @@ -108,10 +108,6 @@ if strcmp(sensor_in.state,'read_ephemeris') end end if strcmp(sensor_in.state,'warm_start') - if(lost_visibility) - sensor.state='warm_start'; - sensor.howLong=time; - end if(fetch_fp) sensor.state='position_available'; sensor.howLong=time; @@ -134,10 +130,6 @@ if strcmp(sensor_in.state,'cold_start') sensor.howLong=time; sensor.fp=sv; end - if(lost_visibility) - sensor.state='cold_start'; - sensor.howLong=time; - end if(~turn) sensor.state='no_info'; sensor.howLong=time; diff --git a/matlab/gps_randomized.m b/matlab/gps_randomized.m index cd274e7d9d61a726b584291abc7779c4ac30edd8..3321ca12c96a5e46fae2b0f8a83496ab9b3cd0a1 100644 --- a/matlab/gps_randomized.m +++ b/matlab/gps_randomized.m @@ -31,7 +31,7 @@ required_sv= 4; ephDuration=1800.0; %bounds for time required for fetching freq and phase fp_lower=0.2; -fp_upper=500.5; +fp_upper=1.5; %% initialize output sensor = sensor_in; @@ -43,7 +43,7 @@ sensor.eph=min(sensor_in.eph,sv); %% events ephemeris_expired=(time>sensor.ephExp)||(sensor.eph<required_sv); %ephemeris data are expired -lost_visibility=(sensor_in.fp~=sensor.fp)&&(sensor.fp<required_sv); +lost_visibility=(sensor.fp<required_sv); fetched_fp=(time>sensor.fetchfp); get_ephemeris=(time>sensor.geteph); @@ -106,16 +106,6 @@ if strcmp(sensor_in.state,'read_ephemeris') end end if strcmp(sensor_in.state,'warm_start') -% if(lost_visibility) -% sensor.state='warm_start'; -% sensor.fetchfp=time+random('uniform',fp_lower,fp_upper); -% %might have to go on to cold_start -% if(ephemeris_expired) -% sensor.state='cold_start'; -% sensor.fetchfp=time+random('uniform',fp_lower,fp_upper); -% sensor.eph=0; -% end -% end if(fetched_fp) sensor.state='position_available'; sensor.geteph=time+random('uniform',30,60); @@ -137,10 +127,6 @@ if strcmp(sensor_in.state,'cold_start') sensor.geteph=time+random('uniform',30,60); sensor.fp=sv; end -% if(lost_visibility) -% sensor.state='cold_start'; -% sensor.fetchfp=time+random('uniform',fp_lower,fp_upper); -% end if(~turn) sensor.state='no_info'; sensor.howLong=time; diff --git a/matlab/main.m b/matlab/main.m index cac6874613a59367f778da7bc3e26cad40a3fb9e..9c79e59542684ef5217453f98e762719d3484681 100644 --- a/matlab/main.m +++ b/matlab/main.m @@ -5,37 +5,43 @@ %% Load data disp('Loads data') -%load('GNSSaidedINS_data.mat'); -load('cycling_input_data'); +load('GNSSaidedINS_data.mat'); +%load('cycling_input_data'); %% Load filter settings disp('Loads settings') settings=get_settings(); +%settings=get_settings_cycling(); settings.P_treshold=6.1; %% Run the GNSS-aided INS disp('Runs the GNSS-aided INS') -%out_data=GPSaidedINS(in_data,settings); -out_data=GPSaidedINS_cycling(in_data,settings); +out_data=GPSaidedINS(in_data,settings); +%out_data=GPSaidedINS_cycling(in_data,settings); %% Plot the data disp('Plot data') %plot_data(in_data,out_data,'True');drawnow -h=zeros(1,3); +h=zeros(1,2); figure(2) plot(in_data.GNSS.pos_ned(2,:),in_data.GNSS.pos_ned(1,:),'b-'); +%plot(out_data.x_h(2,:),out_data.x_h(1,:),'r-'); hold on h(1)=plot(in_data.GNSS.pos_ned(2,:),in_data.GNSS.pos_ned(1,:),'b.'); -h(2)=plot(out_data.x_h(2,:),out_data.x_h(1,:),'r'); -h(3)=plot(in_data.GNSS.pos_ned(2,1),in_data.GNSS.pos_ned(1,1),'ks'); +h(2)=plot(out_data.x_h(2,:),out_data.x_h(1,:),'-'); +%h(3)=plot(in_data.GNSS.pos_ned(2,1),in_data.GNSS.pos_ned(1,1),'ks'); title('Trajectory') ylabel('North [m]') xlabel('East [m]') -legend(h,'GNSS position estimate','GNSS aided INS trajectory','Start point') +legend(h,'GNSS position estimate','GNSS aided INS trajectory')%,'Start point') axis equal grid on +%plot control signal P and control action turn +h=zeros(1,2); figure(3) hold on -plot(out_data.P) -plot(out_data.turn) \ No newline at end of file +h(1)=plot(out_data.P_store); +h(2)=plot(out_data.turn); +legend(h,'sum of the trace of P','antenna turned ON') +grid on \ No newline at end of file diff --git a/matlab/run_many_car.m b/matlab/run_many_car.m new file mode 100644 index 0000000000000000000000000000000000000000..854295867c43d4f26fc3a6f249d711bbc43c0244 --- /dev/null +++ b/matlab/run_many_car.m @@ -0,0 +1,48 @@ +%"monteCarlo" example + +%% Load data +disp('Loads data') +load('GNSSaidedINS_data.mat'); + +%% Load filter settings +disp('Loads settings') +settings=get_settings(); + +%vector of RGB colors for plotting for the different P references +color=[[0.7,0.0,0.0];[0.0,0.7,0.0];[0.7,0.0,0.7];[0.0,0.0,0.7];[0.0,0.7,0.7];[0.7,0.7,0.0]]; +%vector of refrences for P +P_treshold=[4.0,5.0,6.0,8.0,10.0,12.0]; +%nubmer of runs per each P +n_run=30; +%allocate memory for output +energy=zeros(n_run,length(P_treshold)); +error=zeros(n_run,length(P_treshold)); + +for j=1:length(P_treshold) + %set P reference + settings.P_treshold=P_treshold(j); + %run simulations + for k=1:n_run + %% Run the GNSS-aided INS + disp('Running the GNSS-aided INS') + P_treshold(j) + k + out_data=GPSaidedINS(in_data,settings); + energy(k,j)=out_data.energy; + error(k,j)=out_data.error; + end +end + + +%plot data +disp('Plotting data:') +figure +hold on +xlabel('energy') +ylabel('error') +title('cycling energy accuracy tracking trade-off') +grid + +for j=1:length(P_treshold) + scatter(energy(:,j), error(:,j),20,color(j,:),'o','filled') +end \ No newline at end of file diff --git a/matlab/run_many_cycling.m b/matlab/run_many_cycling.m index 2ebf28d6c23c7e7744cff24aaee1e54db865bd19..7dd04ceeb0670ba952482877e885c05d3c2ab4f4 100644 --- a/matlab/run_many_cycling.m +++ b/matlab/run_many_cycling.m @@ -6,51 +6,42 @@ load('cycling_input_data'); %% Load filter settings disp('Loads settings') -settings=get_settings(); +settings=get_settings_cycling(); +%vector of RGB colors for plotting for the different P references +color=[[0.7,0.0,0.0];[0.0,0.7,0.0];[0.7,0.0,0.7];[0.0,0.0,0.7];[0.0,0.7,0.7];[0.7,0.7,0.0]]; +%vector of refrences for P +P_treshold=[4.0,5.0,6.0,8.0,10.0,12.0]; +%nubmer of runs per each P +n_run=3; +%allocate memory for output +energy=zeros(n_run,length(P_treshold)); +error=zeros(n_run,length(P_treshold)); -settings.P_treshold=0.1; -% %run first simulation -% out_data=GPSaidedINS(in_data,settings); -% energy=out_data.energy; -% error=out_data.error; - - -figure(5) -hold on -grid -color=[[0.7,0.0,0.0];[0.0,0.7,0.0];[0.7,0.0,0.7];[0.0,0.0,0.7]]; -j=1; -for P_treshold=[5.0,7.0,9.0,11.0]%[2.3,2.8,3.3,3.8,4.3,4.8,5.3,5.8,6.3,6.8,7.3] - clear energy error - settings.P_treshold=P_treshold; - %run first simulation - out_data=GPSaidedINS_cycling(in_data,settings); - energy=out_data.energy; - error=out_data.error; -% energy=[energy,out_data.energy]; -% error=[error,out_data.error]; - %run more simulations - for k=1:10 +for j=1:length(P_treshold) + %set P reference + settings.P_treshold=P_treshold(j); + %run simulations + for k=1:n_run %% Run the GNSS-aided INS disp('Running the GNSS-aided INS') - P_treshold + P_treshold(j) k out_data=GPSaidedINS_cycling(in_data,settings); - energy=[energy,out_data.energy]; - error=[error,out_data.error]; + energy(k,j)=out_data.energy; + error(k,j)=out_data.error; end - %plot data - scatter(energy, error,40,color(j,:),'o','filled') - xlabel('energy') - ylabel('error') - %title(['P treshold = ', num2str(P_treshold)]) - - j=j+1; end -% %plot data -% figure(2) -% scatter(energy, error) -% xlabel('energy') -% ylabel('error') -% grid + + +%plot data +figure +hold on +xlabel('energy') +ylabel('error') +title('cycling energy accuracy tracking trade-off') +grid + +for j=1:length(P_treshold) + scatter(energy(:,j), error(:,j),20,color(j,:),'o','filled') +end \ No newline at end of file diff --git a/paper/sections/06-results.tex b/paper/sections/06-results.tex index 97a6cc2d4bbb87a16566f6c943ea2f3d72160c88..337093084fcddadb049943b604992cfbeb78692b 100644 --- a/paper/sections/06-results.tex +++ b/paper/sections/06-results.tex @@ -84,47 +84,113 @@ Last simulation of this part of the section shows how the model captures the los \end{figure} This last simulation points out also one limitation of the proposed model. In fact theoretically if the satellite that appears again after the loss of visibility was one of the two that previously disappeared the device would not need to re-acquire the ephemeris data, having still in memory the ones acquired at the start up and being those still valid. But to capture this we would have to describe separately the acquisition of the signal and ephemeris data of the different satellites, together with their visibiliy. This apparently would increase the complexity of the model and decrease it usability\footnote{An extension of the model to include also this phenomenon would't be very difficult. It would be sufficient to have parallel state machines similar to the one shown in figure~\ref{fig:cyberdynamics} that independently capture the tracking of the different satellites. Some more adjustments would of course be needede but the basic idea would still hold.}. ------------------------------------------------- -\subsection{Power Consumption Accuracy Trade Off} + +\subsection{Tracking Performance and Power Consumption Accuracy Trade Off} \label{sec:res:tradeoff} +In this section, we use real traces recorded from an IMU sensor (accelerometer and gyroscope) and a GPS receiver in two different conditions: when moving by car and by bicycle. Traces with continuous sampling of GPS have been recorded and then different GPS sensor dynamics have been simulated in order to compare different sampling policies and GPS dynamics. We show the tracking performed by the sampled sensor fusion algorithm compared to the continuous sampling of the GPS. We then use simulations to expose the trade off between power consumption and accuracy in both cases. + +\begin{figure}[h] + \begin{center} + \includegraphics[height=0.70\columnwidth, width=0.90\columnwidth]{images/cycling_trace.png} + \caption{Tracked trace when cycling. The sampled sensor fusion algorithm is compared to the one using all the avaiable GPS measurements. + \label{fig:cycling-trace} + } + \end{center} +\end{figure} + +\begin{figure}[h] + \begin{center} + \includegraphics[height=0.70\columnwidth, width=0.90\columnwidth]{images/car_trace.png} + \caption{Tracked trace when driving a car. The sampled sensor fusion algorithm is compared to the one using all the avaiable GPS measurements. + \label{fig:car-trace} + } + \end{center} +\end{figure} + +Figures~\ref{fig:car-trace} and~\ref{fig:cycling-trace} show part of the traces generates respectively for the tracking of the car and the bike. In general the cycling trace exposes more complex dynamics that are tracked with more difficulty by the sensor fusion algorithm. Specifically we can see how the lower sampling of the GPS can still guarantee some form of tracking, whether this is acceptable or not it will be dependant on the specific application\footnote{This is also a basic implementation of a sensor fusion algorithm, better performances in terms of tracking could be achieved with more advanced versions of it and better quality IMU sensors. In any case this is not part of the discussion here.}. +%\footnote{The reader might argue that the sensor fusion algorithm for the cycling data is even less performing than the pure GPS track. This is due to the fact that the algorithm here implemented is quite simple and for instance doesn't bound in any way the possible movements of the bike. We chosed instead this implementation since it provides more expressive figures, the same considerations would hold.} +From the same simulations we show also plots of the signal used for the triggering of the GPS (i.e. the sum of the trace of $P$) toghether with the state of the GPS antenna. Those are shown in figure~\ref{fig:cycling-control} for the cycling trace and~\ref{fig:car-control} for the car trace. Those figures show how the sampling is able to keep bounded the variance of the estimation while reducing the time that the antenna spends being turned on. -\textcolor{red}{In order to compare different sampling policies and GPS dynamics, traces with continuous sampling of GPS have been recorded and then different GPS sensor dynamics have been simulated.} +\begin{figure}[h] + \begin{center} + \includegraphics[height=0.70\columnwidth, width=0.90\columnwidth]{images/cycling_control.png} + \caption{Control signal and control action for the triggering of the GPS sensor in the cycling trace. + \label{fig:cycling-control} + } + \end{center} +\end{figure} -In this section, we use real traces from an IMU sensor and a GPS -receiver in two different conditions: car, and bicycle. In both cases, -we recorded measurements for the entire duration of the trace with -both devices. We show the accuracy of the IMU, compared to the GPS -trace (which the sensor fusion algorithm considers to be the ground -truth). We expose the trade off between power consumption due to the -GPS antenna being turned on and accuracy in both cases. Expectation: -in the bike trace, the IMU sensor trace is more noisy. +\begin{figure}[h] + \begin{center} + \includegraphics[height=0.70\columnwidth, width=0.90\columnwidth]{images/car_control.png} + \caption{Control signal and control action for the triggering of the GPS sensor in the car trace. + \label{fig:car-control} + } + \end{center} +\end{figure} -Figures (both bike and car) with the accuracy ``areas''. +%\subsection{Simulation of Ranging Data Loss} +%\label{sec:res:vis} -\subsection{Simulation of Ranging Data Loss} -\label{sec:res:vis} +%Simulation of what happens if ``lose visibility'' transition is taken +%from time to time on one of the two traces above. -Simulation of what happens if ``lose visibility'' transition is taken -from time to time on one of the two traces above. +%\subsection{Simulation Results} +%\label{sec:res:sim} + +Finally we run a large number \todo{specify} of simulations with different triggering thresholds of $P$ \todo{specify}. The idea is that higher values of P will guarantee less power consumption at the price of lareger errors in the estimation and vice versa. In the simulations the acquisition time of the satellites signals is modeled as a random variable uniformly distributed. Moreover, while in the simulations with the cycling data the number of visible satellites is constant, in the ones with the car data it randomly changes\footnote{Specifically when the number of visible satellites is a given number there is some probability at every time step that t increases or decreases by one, always bounded betwen 3 and 6 in any case.}. The overall error of a tracking trace is here defined as the root-mean-square of the distance between the trace and the pure GPS signal. + +\begin{figure}[h] + \begin{center} + \includegraphics[height=0.60\columnwidth, width=0.80\columnwidth]{images/cycling_trade_off.png} + \caption{Power-tracking error trade off with the cycling data.\todo{fix error} + \label{fig:cycling-trade-off} + } + \end{center} +\end{figure} + +Figure~\ref{fig:cycling-trade-off} shows the simulation results for the cycing tracking. The different colors of the points correspond to the different values for the triggering threshold of the sensor fusion algorithm. We can see that the trade-off is present and well controlled through the choice of the threshold. Furthermore two other interesting phenomena are pointed out by this simulation. + +For low triggering values (red, green and purple points) there is less variance in terms of error since we are converging to the situation of the antenna being always turned on and therefore saturating the achievable tracking precision. Instead the variance in terms of energy consumption increases due to the sensor being more frequently turned on and off and threfore being affected by the random time required to fetch the satellites' signals. + +Looking at higher triggering values instead (blue, light blue and yelow points) opposite behavior is experienced. There is smaller variance in terms of power consumption since the antenna is turned on less frequently and there will be less uncertainty on how much time is overall spent while fetching the signal. Insterad the error becomes both lager and with higher variance due to the necessity of using more the IMU data that are less reliable. + +\begin{figure}[h] + \begin{center} + \includegraphics[height=0.60\columnwidth, width=0.80\columnwidth]{images/car_trade_off_zoomout.png} + \caption{Power and tracking-error trade off with the car data. + \label{fig:car-trade-off} + } + \end{center} +\end{figure} + +Finally figure~\ref{fig:car-trade-off} shows the simulations performed using the car data. Given the introduction of a varying number of visible satellites and therefore the possibility of losing GPS availability the possible behaviors of the system become much more various. Specifically they seem to spread radially away from the origin. This is reasonable since the loss of visibility will negatively affect both the accuracy, as the GPS data wont be available until a sufficient number of satellites become visible again, and the energy consumption, as the sensor will have to be turned on for relatively long time to re-aquire the ephemeris data. If, as shown in figure~\ref{fig:car-trade-off-zoom}, we zoom in the lower part of the plot we can see that the same behavior as the one described for the cycling data is evidenced. + +\begin{figure}[h] + \begin{center} + \includegraphics[height=0.60\columnwidth, width=0.80\columnwidth]{images/car_trade_off_zoomin.png} + \caption{Zoom on the lower part of the power and tracking-error trade off with the car data. + \label{fig:car-trade-off-zoom} + } + \end{center} +\end{figure} -\subsection{Simulation Results} -\label{sec:res:sim} -Power-accuracy trade-off: Montecarlo simulations. Characteristics: -\begin{itemize} -\item We generate 10000 traces, 60 minutes long. -\item For each point in each trace, we randomly extract from - probability distributions the visibility of satellites. We also - randomize the time to fetch signals. -\item Figure comparing clouds of points with only GPS and GPS+IMU in - the axis \emph{accuracy} (sum of distances from the ideal GPS trace) - and \emph{power consumption} (due to antenna). -\end{itemize} +%Power-accuracy trade-off: Montecarlo simulations. Characteristics: +%\begin{itemize} +%\item We generate 10000 traces, 60 minutes long. +%\item For each point in each trace, we randomly extract from +% probability distributions the visibility of satellites. We also +% randomize the time to fetch signals. +%\item Figure comparing clouds of points with only GPS and GPS+IMU in +% the axis \emph{accuracy} (sum of distances from the ideal GPS trace) +% and \emph{power consumption} (due to antenna). +%\end{itemize} -To show how the proposed model joined with the sensor fusion algorithm allows to capture the trade-off betwen accuracy and power consumption we run simulations for different treshold values for triggering the sampling of the GPS. Coherently with the intuition, we can see that higher values for the treshold allow to save power at the cost of lower precision in the positioning. The accuracy is measured as the distance from the positioning that uses the GPS continuously. +%To show how the proposed model joined with the sensor fusion algorithm allows to capture the trade-off betwen accuracy and power consumption we run simulations for different threshold values for triggering the sampling of the GPS. Coherently with the intuition, we can see that higher values for the threshold allow to save power at the cost of lower precision in the positioning. The accuracy is measured as the distance from the positioning that uses the GPS continuously. -In these simulations the GPS model exposes a random acquisition time for the fetching of the ephemeris data, drawed for a uniform distribution between \textcolor{red}{2 and 12 milliseconds}. Also the number of satellites is randomized as in the previous simulations. +%In these simulations the GPS model exposes a random acquisition time for the fetching of the ephemeris data, drawed for a uniform distribution between \textcolor{red}{2 and 12 milliseconds}. Also the number of satellites is randomized as in the previous simulations.