mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-10-31 15:23:04 +00:00 
			
		
		
		
	Added Dilution Of Precision (DOP) values computation in the Least Squares PVT solver.
git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@232 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
		| @@ -223,6 +223,8 @@ int gps_l1_ca_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_ite | |||||||
| 	            std::cout << "Position at " << boost::posix_time::to_simple_string(d_ls_pvt->d_position_UTC_time) | 	            std::cout << "Position at " << boost::posix_time::to_simple_string(d_ls_pvt->d_position_UTC_time) | ||||||
| 	            << " is Lat = " << d_ls_pvt->d_latitude_d << " [deg], Long = " << d_ls_pvt->d_longitude_d | 	            << " is Lat = " << d_ls_pvt->d_latitude_d << " [deg], Long = " << d_ls_pvt->d_longitude_d | ||||||
| 	            << " [deg], Height= " << d_ls_pvt->d_height_m << " [m]" << std::endl; | 	            << " [deg], Height= " << d_ls_pvt->d_height_m << " [m]" << std::endl; | ||||||
|  | 	            std::cout << "Dilution of Precision at " << boost::posix_time::to_simple_string(d_ls_pvt->d_position_UTC_time) | ||||||
|  | 	            << " is HDOP = " << d_ls_pvt->d_HDOP << " and VDOP = " << d_ls_pvt->d_VDOP << std::endl; | ||||||
|     		} |     		} | ||||||
|  |  | ||||||
|     		if(d_dump == true) |     		if(d_dump == true) | ||||||
|   | |||||||
| @@ -216,6 +216,24 @@ arma::vec gps_l1_ca_ls_pvt::leastSquarePos(arma::mat satpos, arma::vec obs, arma | |||||||
|             //--- Apply position update -------------------------------------------- |             //--- Apply position update -------------------------------------------- | ||||||
|             pos = pos + x; |             pos = pos + x; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  |     try{ | ||||||
|  |     //-- compute the Dilution Of Precision values | ||||||
|  | 		arma::mat Q; | ||||||
|  | 		Q       = arma::inv(arma::htrans(A)*A); | ||||||
|  | 		d_GDOP  = sqrt(arma::trace(Q));                 // GDOP | ||||||
|  | 		d_PDOP  = sqrt(Q(1,1) + Q(2,2) + Q(3,3));       // PDOP | ||||||
|  | 		d_HDOP  = sqrt(Q(1,1) + Q(2,2));                // HDOP | ||||||
|  | 		d_VDOP  = sqrt(Q(3,3));                         // VDOP | ||||||
|  | 		d_TDOP  = sqrt(Q(4,4));                         // TDOP | ||||||
|  |     }catch(std::exception e) | ||||||
|  |     { | ||||||
|  |     	d_GDOP  = -1; | ||||||
|  | 		d_PDOP  = -1; | ||||||
|  | 		d_HDOP  = -1; | ||||||
|  | 		d_VDOP  = -1; | ||||||
|  | 		d_TDOP	= -1; | ||||||
|  |     } | ||||||
|     return pos; |     return pos; | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -68,6 +68,7 @@ public: | |||||||
|     double d_latitude_d;  //! Latitude in degrees |     double d_latitude_d;  //! Latitude in degrees | ||||||
|     double d_longitude_d; //! Longitude in degrees |     double d_longitude_d; //! Longitude in degrees | ||||||
|     double d_height_m;    //! Height [m] |     double d_height_m;    //! Height [m] | ||||||
|  |  | ||||||
|     //averaging |     //averaging | ||||||
|     std::deque<double> d_hist_latitude_d; |     std::deque<double> d_hist_latitude_d; | ||||||
|     std::deque<double> d_hist_longitude_d; |     std::deque<double> d_hist_longitude_d; | ||||||
| @@ -82,6 +83,14 @@ public: | |||||||
|     double d_y_m; |     double d_y_m; | ||||||
|     double d_z_m; |     double d_z_m; | ||||||
|  |  | ||||||
|  |     // DOP estimations | ||||||
|  |  | ||||||
|  |     double d_GDOP; | ||||||
|  |     double d_PDOP; | ||||||
|  |     double d_HDOP; | ||||||
|  |     double d_VDOP; | ||||||
|  |     double d_TDOP; | ||||||
|  |  | ||||||
|     bool d_flag_dump_enabled; |     bool d_flag_dump_enabled; | ||||||
|     std::string d_dump_filename; |     std::string d_dump_filename; | ||||||
|     std::ofstream d_dump_file; |     std::ofstream d_dump_file; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Javier Arribas
					Javier Arribas