Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
gnss_utils
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
labrobotica
algorithms
gnss_utils
Merge requests
!12
Resolve "load from rinex outside classes"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "load from rinex outside classes"
12-load-from-rinex-outside-classes
into
devel
Overview
0
Commits
3
Pipelines
0
Changes
1
Merged
Pep Martí Saumell
requested to merge
12-load-from-rinex-outside-classes
into
devel
5 years ago
Overview
0
Commits
3
Pipelines
0
Changes
1
Expand
Closes
#12 (closed)
Edited
5 years ago
by
Pep Martí Saumell
0
0
Merge request reports
Viewing commit
72c0811b
Prev
Next
Show latest version
1 file
+
63
−
72
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
72c0811b
[bug] Example working
· 72c0811b
Pep Martí Saumell
authored
5 years ago
src/examples/gnss_utils_test.cpp
+
63
−
72
Options
@@ -35,83 +35,74 @@ int main(int argc, char* argv[])
// load observations from RINEX file
std
::
vector
<
Observations
>
obs_rinex
=
loadObservationsFromRinex
(
"../src/examples/rover_sample.obs"
,
t_start
,
t_end
,
dt
,
opt
);
loadObservationsFromRinex
(
"../src/examples/sample_data.obs"
,
t_start
,
t_end
,
dt
,
opt
);
observations
=
obs_rinex
[
0
];
observations
.
print
();
std
::
cout
<<
"Number of epochs: "
<<
obs_rinex
.
size
()
<<
std
::
endl
;
// RTKLIB trace
char
str_file
[
80
];
snprintf
(
str_file
,
sizeof
str_file
,
"../src/examples/trace"
);
tracelevel
(
5
);
traceopen
(
str_file
);
observations
=
obs_rinex
.
back
();
for
(
auto
obs
=
observations
.
getObservations
().
begin
();
obs
!=
observations
.
getObservations
().
end
();
++
obs
)
{
printf
(
"Satellite number: %u
\n
"
,
obs
->
sat
);
}
// load navigation from RINEX file
navigation
.
loadFromRinex
(
"../src/examples/sample_data.nav"
,
t_start
,
t_end
,
dt
,
opt
);
navigation
.
print
();
//
observations = obs_rinex[0];
//
observations.print
();
//
Trace close
//
traceclose
();
// RTKLIB trace
// char str_file[80];
// snprintf(str_file, sizeof str_file, "../src/examples/trace");
// tracelevel(5);
// traceopen(str_file);
/* Set processing options */
// load navigation from RINEX file
// navigation.loadFromRinex("../src/examples/sample_data.nav", t_start, t_end, dt, opt);
// navigation.print();
// // Trace close
// // traceclose();
// /* Set processing options */
// /* header */
// std::cout << "------------------" << std::endl;
// std::cout << "Processing options" << std::endl;
// std::cout << "------------------" << std::endl;
// prcopt_t prcopt = prcopt_default;
// prcopt.mode = PMODE_SINGLE;
// prcopt.soltype = 0;
// prcopt.nf = 1;
// prcopt.navsys = SYS_GPS;
// prcopt.elmin = 0.525; // 60 degrees = 1.05 rad
// prcopt.sateph = EPHOPT_BRDC;
// prcopt.ionoopt = IONOOPT_OFF;
// prcopt.tropopt = TROPOPT_OFF;
// prcopt.dynamics = 0;
// prcopt.tidecorr = 0;
// prcopt.sbascorr = SBSOPT_FCORR;
// prcopt.ru[0] = 0; // 4789374.0336;
// prcopt.ru[1] = 0; // 177048.3292;
// prcopt.ru[2] = 0; // 4194542.6444;
// std::cout << "Processing options defined" << std::endl;
// Eigen::Vector3d lla_gt(41.383293114 * M_PI / 180.0, 2.116101115 * M_PI / 180.0, -91.6641);
// // Compute spp
// /* header */
// std::cout << "-----------" << std::endl;
// std::cout << "pntpos call" << std::endl;
// std::cout << "-----------" << std::endl;
// int stat;
// sol_t solb = { { 0 } };
// char msg[128] = "";
// stat = pntpos(observations.data(), observations.size(), &navigation.getNavigation(), &prcopt, &solb, NULL, NULL,
// msg);
// std::cout << "msg: " << msg << std::endl;
// std::cout << "sol.stat: " << int(solb.stat) << std::endl;
// std::cout << "Position: " << solb.rr[0] << ", " << solb.rr[1] << ", " << solb.rr[2] << std::endl;
// std::cout << "Position (GT): " << latLonAltToEcef(lla_gt).transpose() << std::endl;
// std::cout << "Position LLA: " << ecefToLatLonAlt(Eigen::Vector3d(solb.rr[0], solb.rr[1],
// solb.rr[2])).transpose()
// << std::endl;
// std::cout << "Position LLA (GT): " << lla_gt.transpose() << std::endl;
/* header */
std
::
cout
<<
"------------------"
<<
std
::
endl
;
std
::
cout
<<
"Processing options"
<<
std
::
endl
;
std
::
cout
<<
"------------------"
<<
std
::
endl
;
prcopt_t
prcopt
=
prcopt_default
;
prcopt
.
mode
=
PMODE_SINGLE
;
prcopt
.
soltype
=
0
;
prcopt
.
nf
=
1
;
prcopt
.
navsys
=
SYS_GPS
;
prcopt
.
elmin
=
0.525
;
// 60 degrees = 1.05 rad
prcopt
.
sateph
=
EPHOPT_BRDC
;
prcopt
.
ionoopt
=
IONOOPT_OFF
;
prcopt
.
tropopt
=
TROPOPT_OFF
;
prcopt
.
dynamics
=
0
;
prcopt
.
tidecorr
=
0
;
prcopt
.
sbascorr
=
SBSOPT_FCORR
;
prcopt
.
ru
[
0
]
=
0
;
// 4789374.0336;
prcopt
.
ru
[
1
]
=
0
;
// 177048.3292;
prcopt
.
ru
[
2
]
=
0
;
// 4194542.6444;
std
::
cout
<<
"Processing options defined"
<<
std
::
endl
;
Eigen
::
Vector3d
lla_gt
(
41.383293114
*
M_PI
/
180.0
,
2.116101115
*
M_PI
/
180.0
,
-
91.6641
);
// Compute spp
/* header */
std
::
cout
<<
"-----------"
<<
std
::
endl
;
std
::
cout
<<
"pntpos call"
<<
std
::
endl
;
std
::
cout
<<
"-----------"
<<
std
::
endl
;
int
stat
;
sol_t
solb
=
{
{
0
}
};
char
msg
[
128
]
=
""
;
stat
=
pntpos
(
observations
.
data
(),
observations
.
size
(),
&
navigation
.
getNavigation
(),
&
prcopt
,
&
solb
,
NULL
,
NULL
,
msg
);
std
::
cout
<<
"msg: "
<<
msg
<<
std
::
endl
;
std
::
cout
<<
"sol.stat: "
<<
int
(
solb
.
stat
)
<<
std
::
endl
;
std
::
cout
<<
"Position: "
<<
solb
.
rr
[
0
]
<<
", "
<<
solb
.
rr
[
1
]
<<
", "
<<
solb
.
rr
[
2
]
<<
std
::
endl
;
std
::
cout
<<
"Position (GT): "
<<
latLonAltToEcef
(
lla_gt
).
transpose
()
<<
std
::
endl
;
std
::
cout
<<
"Position LLA: "
<<
ecefToLatLonAlt
(
Eigen
::
Vector3d
(
solb
.
rr
[
0
],
solb
.
rr
[
1
],
solb
.
rr
[
2
])).
transpose
()
<<
std
::
endl
;
std
::
cout
<<
"Position LLA (GT): "
<<
lla_gt
.
transpose
()
<<
std
::
endl
;
// traceclose();
}
Loading