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
Commits
72c0811b
Commit
72c0811b
authored
5 years ago
by
Pep Martí Saumell
Browse files
Options
Downloads
Patches
Plain Diff
[bug] Example working
parent
b71ab39d
No related branches found
Branches containing commit
No related tags found
3 merge requests
!20
new tag
,
!19
new tag
,
!12
Resolve "load from rinex outside classes"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/examples/gnss_utils_test.cpp
+63
-72
63 additions, 72 deletions
src/examples/gnss_utils_test.cpp
with
63 additions
and
72 deletions
src/examples/gnss_utils_test.cpp
+
63
−
72
View file @
72c0811b
...
@@ -35,83 +35,74 @@ int main(int argc, char* argv[])
...
@@ -35,83 +35,74 @@ int main(int argc, char* argv[])
// load observations from RINEX file
// load observations from RINEX file
std
::
vector
<
Observations
>
obs_rinex
=
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
();
// load navigation from RINEX file
for
(
auto
obs
=
observations
.
getObservations
().
begin
();
obs
!=
observations
.
getObservations
().
end
();
++
obs
)
navigation
.
loadFromRinex
(
"../src/examples/sample_data.nav"
,
t_start
,
t_end
,
dt
,
opt
);
{
navigation
.
print
();
printf
(
"Satellite number: %u
\n
"
,
obs
->
sat
);
}
//
observations = obs_rinex[0];
//
Trace close
//
observations.print
();
//
traceclose
();
// RTKLIB trace
/* Set processing options */
// char str_file[80];
// snprintf(str_file, sizeof str_file, "../src/examples/trace");
// tracelevel(5);
// traceopen(str_file);
// load navigation from RINEX file
/* header */
// navigation.loadFromRinex("../src/examples/sample_data.nav", t_start, t_end, dt, opt);
std
::
cout
<<
"------------------"
<<
std
::
endl
;
// navigation.print();
std
::
cout
<<
"Processing options"
<<
std
::
endl
;
std
::
cout
<<
"------------------"
<<
std
::
endl
;
// // Trace close
// // traceclose();
prcopt_t
prcopt
=
prcopt_default
;
prcopt
.
mode
=
PMODE_SINGLE
;
// /* Set processing options */
prcopt
.
soltype
=
0
;
prcopt
.
nf
=
1
;
// /* header */
prcopt
.
navsys
=
SYS_GPS
;
// std::cout << "------------------" << std::endl;
prcopt
.
elmin
=
0.525
;
// 60 degrees = 1.05 rad
// std::cout << "Processing options" << std::endl;
prcopt
.
sateph
=
EPHOPT_BRDC
;
// std::cout << "------------------" << std::endl;
prcopt
.
ionoopt
=
IONOOPT_OFF
;
prcopt
.
tropopt
=
TROPOPT_OFF
;
// prcopt_t prcopt = prcopt_default;
prcopt
.
dynamics
=
0
;
// prcopt.mode = PMODE_SINGLE;
prcopt
.
tidecorr
=
0
;
// prcopt.soltype = 0;
prcopt
.
sbascorr
=
SBSOPT_FCORR
;
// prcopt.nf = 1;
prcopt
.
ru
[
0
]
=
0
;
// 4789374.0336;
// prcopt.navsys = SYS_GPS;
prcopt
.
ru
[
1
]
=
0
;
// 177048.3292;
// prcopt.elmin = 0.525; // 60 degrees = 1.05 rad
prcopt
.
ru
[
2
]
=
0
;
// 4194542.6444;
// prcopt.sateph = EPHOPT_BRDC;
// prcopt.ionoopt = IONOOPT_OFF;
std
::
cout
<<
"Processing options defined"
<<
std
::
endl
;
// prcopt.tropopt = TROPOPT_OFF;
// prcopt.dynamics = 0;
Eigen
::
Vector3d
lla_gt
(
41.383293114
*
M_PI
/
180.0
,
2.116101115
*
M_PI
/
180.0
,
-
91.6641
);
// prcopt.tidecorr = 0;
// prcopt.sbascorr = SBSOPT_FCORR;
// Compute spp
// prcopt.ru[0] = 0; // 4789374.0336;
// prcopt.ru[1] = 0; // 177048.3292;
/* header */
// prcopt.ru[2] = 0; // 4194542.6444;
std
::
cout
<<
"-----------"
<<
std
::
endl
;
std
::
cout
<<
"pntpos call"
<<
std
::
endl
;
// std::cout << "Processing options defined" << std::endl;
std
::
cout
<<
"-----------"
<<
std
::
endl
;
// Eigen::Vector3d lla_gt(41.383293114 * M_PI / 180.0, 2.116101115 * M_PI / 180.0, -91.6641);
int
stat
;
// // Compute spp
sol_t
solb
=
{
{
0
}
};
// /* header */
char
msg
[
128
]
=
""
;
// std::cout << "-----------" << std::endl;
// std::cout << "pntpos call" << std::endl;
stat
=
pntpos
(
observations
.
data
(),
observations
.
size
(),
&
navigation
.
getNavigation
(),
&
prcopt
,
&
solb
,
NULL
,
NULL
,
// std::cout << "-----------" << std::endl;
msg
);
// int stat;
std
::
cout
<<
"msg: "
<<
msg
<<
std
::
endl
;
std
::
cout
<<
"sol.stat: "
<<
int
(
solb
.
stat
)
<<
std
::
endl
;
// sol_t solb = { { 0 } };
std
::
cout
<<
"Position: "
<<
solb
.
rr
[
0
]
<<
", "
<<
solb
.
rr
[
1
]
<<
", "
<<
solb
.
rr
[
2
]
<<
std
::
endl
;
std
::
cout
<<
"Position (GT): "
<<
latLonAltToEcef
(
lla_gt
).
transpose
()
<<
std
::
endl
;
// char msg[128] = "";
std
::
cout
<<
"Position LLA: "
<<
ecefToLatLonAlt
(
Eigen
::
Vector3d
(
solb
.
rr
[
0
],
solb
.
rr
[
1
],
solb
.
rr
[
2
])).
transpose
()
// stat = pntpos(observations.data(), observations.size(), &navigation.getNavigation(), &prcopt, &solb, NULL, NULL,
<<
std
::
endl
;
// msg);
std
::
cout
<<
"Position LLA (GT): "
<<
lla_gt
.
transpose
()
<<
std
::
endl
;
// 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();
// traceclose();
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment