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
1d6d7cdd
Commit
1d6d7cdd
authored
5 years ago
by
Pep Martí Saumell
Browse files
Options
Downloads
Patches
Plain Diff
[improvement] load rinex removed from observations
parent
6c1829ee
No related branches found
No related tags found
3 merge requests
!20
new tag
,
!19
new tag
,
!12
Resolve "load from rinex outside classes"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/gnss_utils/observations.h
+25
-38
25 additions, 38 deletions
include/gnss_utils/observations.h
src/observations.cpp
+0
-35
0 additions, 35 deletions
src/observations.cpp
with
25 additions
and
73 deletions
include/gnss_utils/observations.h
+
25
−
38
View file @
1d6d7cdd
...
...
@@ -5,7 +5,6 @@
namespace
GnssUtils
{
class
Observations
{
public:
...
...
@@ -15,34 +14,26 @@ public:
~
Observations
();
void
clearObservations
();
void
addObservation
(
const
obsd_t
&
obs
);
void
loadFromRinex
(
const
std
::
string
&
rnx_file
,
gtime_t
t_start
,
gtime_t
t_end
,
double
dt
=
0.0
,
const
char
*
opt
=
""
);
void
removeObservationByIdx
(
const
int
&
_idx
);
void
removeObservationBySat
(
const
int
&
_sat
);
std
::
vector
<
obsd_t
>&
getObservations
();
const
std
::
vector
<
obsd_t
>&
getObservations
()
const
;
obsd_t
&
getObservationBySat
(
const
unsigned
char
&
sat_number
);
const
obsd_t
&
getObservationBySat
(
const
unsigned
char
&
sat_number
)
const
;
obsd_t
&
getObservationByIdx
(
const
int
&
idx
);
const
obsd_t
&
getObservationByIdx
(
const
int
&
idx
)
const
;
obsd_t
*
data
();
const
obsd_t
*
data
()
const
;
size_t
size
()
const
;
bool
hasSatellite
(
const
unsigned
char
&
i
)
const
;
static
void
print
(
obsd_t
&
_obs
);
void
printBySat
(
const
int
&
_sat
);
void
printByIdx
(
const
int
&
_idx
);
void
print
();
void
printBySat
(
const
int
&
_sat
);
void
printByIdx
(
const
int
&
_idx
);
void
print
();
// Filter observations
std
::
set
<
int
>
filterByEphemeris
(
const
SatellitesPositions
&
sats_pos
);
...
...
@@ -50,38 +41,35 @@ public:
std
::
set
<
int
>
filterByCode
();
std
::
set
<
int
>
filterByCarrierPhase
();
std
::
set
<
int
>
filterByConstellations
(
const
int
&
navsys
);
std
::
set
<
int
>
filterByElevationSnr
(
const
Eigen
::
Vector3d
&
x_r
,
std
::
set
<
int
>
filterByElevationSnr
(
const
Eigen
::
Vector3d
&
x_r
,
const
SatellitesPositions
&
sats_pos
,
const
snrmask_t
&
snrmask
,
const
double
&
elmin
);
std
::
set
<
int
>
filter
(
const
SatellitesPositions
&
sats_pos
,
const
std
::
set
<
int
>&
discarded_sats
,
const
Eigen
::
Vector3d
&
x_r
,
const
bool
&
check_code
,
const
bool
&
check_carrier_phase
,
const
prcopt_t
&
opt
);
std
::
set
<
int
>
filter
(
const
SatellitesPositions
&
sats_pos
,
const
std
::
set
<
int
>&
discarded_sats
,
const
Eigen
::
Vector3d
&
x_r
,
const
bool
&
check_code
,
const
bool
&
check_carrier_phase
,
const
int
&
navsys
,
const
snrmask_t
&
snrmask
,
const
double
&
elmin
);
static
std
::
set
<
int
>
findCommonObservations
(
const
Observations
&
obs_1
,
const
Observations
&
obs_2
);
const
snrmask_t
&
snrmask
,
const
double
&
elmin
);
std
::
set
<
int
>
filter
(
const
SatellitesPositions
&
sats_pos
,
const
std
::
set
<
int
>&
discarded_sats
,
const
Eigen
::
Vector3d
&
x_r
,
const
bool
&
check_code
,
const
bool
&
check_carrier_phase
,
const
prcopt_t
&
opt
);
std
::
set
<
int
>
filter
(
const
SatellitesPositions
&
sats_pos
,
const
std
::
set
<
int
>&
discarded_sats
,
const
Eigen
::
Vector3d
&
x_r
,
const
bool
&
check_code
,
const
bool
&
check_carrier_phase
,
const
int
&
navsys
,
const
snrmask_t
&
snrmask
,
const
double
&
elmin
);
static
std
::
set
<
int
>
findCommonObservations
(
const
Observations
&
obs_1
,
const
Observations
&
obs_2
);
bool
operator
==
(
const
Observations
&
other_obs
)
const
;
bool
operator
!=
(
const
Observations
&
other_obs
)
const
;
bool
operator
!=
(
const
Observations
&
other_obs
)
const
;
private:
// Private objects
std
::
map
<
unsigned
char
,
int
>
sat_2_idx_
;
//< key: corresponding sat number, value: idx in obs_ vector
std
::
vector
<
unsigned
char
>
idx_2_sat_
;
//< key: idx in obs_ vector, value: corresponding sat number
std
::
vector
<
obsd_t
>
obs_
;
//< vector of RTKLIB observations for a given epoch
// Private methods
};
}
// namespace GnssUtils
...
...
@@ -92,7 +80,6 @@ private:
namespace
GnssUtils
{
inline
const
std
::
vector
<
obsd_t
>&
Observations
::
getObservations
()
const
{
return
this
->
obs_
;
...
...
@@ -147,9 +134,9 @@ inline bool Observations::hasSatellite(const unsigned char& i) const
return
sat_2_idx_
.
count
(
i
)
!=
0
;
}
inline
bool
Observations
::
operator
!=
(
const
Observations
&
other_obs
)
const
inline
bool
Observations
::
operator
!=
(
const
Observations
&
other_obs
)
const
{
return
!
(
*
this
==
other_obs
);
return
!
(
*
this
==
other_obs
);
}
}
// namespace GnssUtils
...
...
This diff is collapsed.
Click to expand it.
src/observations.cpp
+
0
−
35
View file @
1d6d7cdd
...
...
@@ -74,41 +74,6 @@ void Observations::addObservation(const obsd_t& obs)
assert
(
sat_2_idx_
.
size
()
==
obs_
.
size
());
}
void
Observations
::
loadFromRinex
(
const
std
::
string
&
rnx_file
,
gtime_t
t_start
,
gtime_t
t_end
,
double
dt
,
const
char
*
opt
)
{
obs_t
obs
;
obs
.
data
=
(
obsd_t
*
)
malloc
(
sizeof
(
obsd_t
)
*
MAXSAT
);
obs
.
n
=
0
;
obs
.
nmax
=
MAXSAT
;
// const char* opt = "";
auto
stat
=
readrnxt
(
rnx_file
.
c_str
(),
1
,
t_start
,
t_end
,
dt
,
opt
,
&
obs
,
NULL
,
NULL
);
if
(
stat
==
1
)
sortobs
(
&
obs
);
else
{
std
::
cout
<<
"Observation: couldn't load provided observation file, reason: "
<<
(
stat
==
0
?
"no data"
:
"error"
)
<<
stat
<<
std
::
endl
;
return
;
}
for
(
int
i
=
0
;
i
<
obs
.
n
;
i
++
)
{
// std::cout << "time: " << time_str(obs.data[i].time, 3) << " | sat: " << int(obs.data[i].sat) << " | rcv: " <<
// int(obs.data[i].rcv) <<
// " | SNR: " << int(obs.data[i].SNR[0]) << " | LLI: " << int(obs.data[i].LLI[0]) << " | code: " <<
// int(obs.data[i].code[0]) <<
// " | L: " << obs.data[i].L[0] << " | P: " << obs.data[i].P[0] << " | D: " << obs.data[i].D[0] <<
// std::endl;
addObservation
(
obs
.
data
[
i
]);
}
free
(
obs
.
data
);
}
void
Observations
::
removeObservationByIdx
(
const
int
&
_idx
)
{
// std::cout << "removing observation of idx " << _idx << std::endl;
...
...
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