1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-02-07 14:40:12 +00:00

Save one iteration in the Bancroft algorithm

This commit is contained in:
Carles Fernandez 2023-04-02 10:31:17 +02:00
parent 81eb2a07c3
commit 3def3c36cd
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
2 changed files with 60 additions and 59 deletions

View File

@ -76,6 +76,12 @@ target_link_libraries(algorithms_libs_rtklib
BLAS::BLAS BLAS::BLAS
) )
if(ENABLE_ARMA_NO_DEBUG)
target_compile_definitions(algorithms_libs_rtklib
PRIVATE -DARMA_NO_BOUND_CHECKING=1
)
endif()
if(FILESYSTEM_FOUND) if(FILESYSTEM_FOUND)
target_compile_definitions(algorithms_libs_rtklib PUBLIC -DHAS_STD_FILESYSTEM=1) target_compile_definitions(algorithms_libs_rtklib PUBLIC -DHAS_STD_FILESYSTEM=1)
if(find_experimental) if(find_experimental)

View File

@ -29,6 +29,10 @@
* ----------------------------------------------------------------------------- * -----------------------------------------------------------------------------
*/ */
#if ARMA_NO_BOUND_CHECKING
#define ARMA_NO_DEBUG 1
#endif
#include "rtklib_pntpos.h" #include "rtklib_pntpos.h"
#include "rtklib_ephemeris.h" #include "rtklib_ephemeris.h"
#include "rtklib_ionex.h" #include "rtklib_ionex.h"
@ -615,19 +619,11 @@ arma::vec rough_bancroft(const arma::mat &B_pass)
{ {
const int m = B_pass.n_rows; const int m = B_pass.n_rows;
arma::vec pos = arma::zeros<arma::vec>(4); arma::vec pos = arma::zeros<arma::vec>(4);
for (int iter = 1; iter <= 2; iter++)
{
// We should rotate the matrix accounting for the travel time here,
// but for a rough first estimation we can skip it
arma::mat BBB; arma::mat BBB;
bool success; bool success;
if (m > 4) if (m > 4)
{ {
success = arma::inv(BBB, B_pass.t() * B_pass); success = arma::pinv(BBB, B_pass);
if (success)
{
BBB *= B_pass.t();
}
} }
else else
{ {
@ -679,7 +675,6 @@ arma::vec rough_bancroft(const arma::mat &B_pass)
{ {
pos = possible_pos.col(0); pos = possible_pos.col(0);
} }
}
return pos; return pos;
} }