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
a6c2c58d
Commit
a6c2c58d
authored
5 years ago
by
Pep Martí Saumell
Browse files
Options
Downloads
Patches
Plain Diff
[tests] observations
parent
207073a1
No related branches found
No related tags found
2 merge requests
!20
new tag
,
!19
new tag
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/gtest_observations.cpp
+39
-15
39 additions, 15 deletions
test/gtest_observations.cpp
with
39 additions
and
15 deletions
test/gtest_observations.cpp
+
39
−
15
View file @
a6c2c58d
...
@@ -4,32 +4,56 @@
...
@@ -4,32 +4,56 @@
using
namespace
GNSSUtils
;
using
namespace
GNSSUtils
;
std
::
string
rnx_file
;
std
::
string
rnx_file
;
obs_t
obs
;
const
gtime_t
t_start
{
0
,
0
};
// no limit
const
gtime_t
t_end
{
0
,
0
};
// no limit
const
double
dt
=
0.0
;
// no limit
const
char
*
opt
=
"-SYS=G"
;
// only GPS | GPS+GAL: "-SYS=G,L" | ALL: ""
TEST
(
ObservationsTest
,
LoadFrom
Rinex
)
void
load
Rinex
(
)
{
{
gtime_t
t_start
{
0
,
0
};
// no limit
gtime_t
t_end
{
0
,
0
};
// no limit
double
dt
=
0.0
;
// no limit
const
char
*
opt
=
"-SYS=G"
;
// only GPS | GPS+GAL: "-SYS=G,L" | ALL: ""
// GNSSUtils utilities
Observations
observations
;
observations
.
loadFromRinex
(
rnx_file
.
c_str
(),
t_start
,
t_end
,
dt
,
opt
);
observations
.
print
();
// RTKLIB utilities
// RTKLIB utilities
obs_t
obs
;
obs
.
data
=
(
obsd_t
*
)
malloc
(
sizeof
(
obsd_t
)
*
MAXSAT
);
obs
.
data
=
(
obsd_t
*
)
malloc
(
sizeof
(
obsd_t
)
*
MAXSAT
);
obs
.
n
=
0
;
obs
.
n
=
0
;
obs
.
nmax
=
MAXSAT
;
obs
.
nmax
=
MAXSAT
;
int
stat
=
readrnxt
(
rnx_file
.
c_str
(),
1
,
t_start
,
t_end
,
dt
,
opt
,
&
obs
,
NULL
,
NULL
);
int
stat
=
readrnxt
(
rnx_file
.
c_str
(),
1
,
t_start
,
t_end
,
dt
,
opt
,
&
obs
,
NULL
,
NULL
);
ASSERT_EQ
(
stat
,
1
);
ASSERT_EQ
(
stat
,
1
);
sortobs
(
&
obs
);
sortobs
(
&
obs
);
}
TEST
(
ObservationsTest
,
AddClearObservation
)
{
loadRinex
();
Observations
observations
;
// testing addition
for
(
int
ii
=
0
;
ii
<
obs
.
n
;
++
ii
)
{
observations
.
addObservation
(
obs
.
data
[
ii
]);
ASSERT_TRUE
(
equalObservations
(
obs
.
data
[
ii
],
observations
.
getObservations
()[
ii
]));
}
ASSERT_TRUE
(
obs
.
n
==
observations
.
getObservations
().
size
());
//Testing clear
observations
.
clearObservations
();
ASSERT_TRUE
(
0
==
observations
.
getObservations
().
size
());
}
TEST
(
ObservationsTest
,
LoadFromRinex
)
{
// GNSSUtils utilities
Observations
observations
;
observations
.
loadFromRinex
(
rnx_file
.
c_str
(),
t_start
,
t_end
,
dt
,
opt
);
observations
.
print
();
// RTKLIB utilities
loadRinex
();
ASSERT_EQ
(
obs
.
n
,
6
);
ASSERT_EQ
(
obs
.
n
,
6
);
// Comparison
// Comparison
...
...
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