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
d643029f
Commit
d643029f
authored
6 years ago
by
Javier Laplaza Galindo
Browse files
Options
Downloads
Patches
Plain Diff
Single Point Position computed successfuly
parent
dfd7b3e2
No related branches found
No related tags found
1 merge request
!2
Resolve "Enable Standard Point Positioning (SPP) computation"
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/examples/gnss_utils_test.cpp
+49
-32
49 additions, 32 deletions
src/examples/gnss_utils_test.cpp
src/getPos.cpp
+1
-1
1 addition, 1 deletion
src/getPos.cpp
src/navigation.cpp
+1
-1
1 addition, 1 deletion
src/navigation.cpp
with
51 additions
and
34 deletions
src/examples/gnss_utils_test.cpp
+
49
−
32
View file @
d643029f
...
@@ -39,19 +39,22 @@ int createObsAndNav(Observations* observations, char* obs_path, Navigation* nav
...
@@ -39,19 +39,22 @@ int createObsAndNav(Observations* observations, char* obs_path, Navigation* nav
obs_t
obs
;
obs_t
obs
;
obs
.
data
=
(
obsd_t
*
)
malloc
(
sizeof
(
obsd_t
)
*
MAXSAT
);
obs
.
data
=
(
obsd_t
*
)
malloc
(
sizeof
(
obsd_t
)
*
MAXSAT
);
/* header */
std
::
cout
<<
"------------"
<<
std
::
endl
;
std
::
cout
<<
"Observations"
<<
std
::
endl
;
std
::
cout
<<
"------------"
<<
std
::
endl
;
if
(
readrnx
(
obs_path
,
rcv
,
opt
,
&
obs
,
NULL
,
NULL
))
if
(
readrnx
(
obs_path
,
rcv
,
opt
,
&
obs
,
NULL
,
NULL
))
{
{
obs
.
data
[
0
].
P
[
0
]
=
22352029.710
;
sortobs
(
&
obs
)
;
obs
.
data
[
1
].
P
[
0
]
=
2
0876138.578
;
obs
.
data
[
0
].
P
[
0
]
=
2
1597659.275
;
obs
.
data
[
2
].
P
[
0
]
=
2
0922649.533
;
obs
.
data
[
1
].
P
[
0
]
=
2
2348322.550
;
obs
.
data
[
3
].
P
[
0
]
=
2
4736002.147
;
obs
.
data
[
2
].
P
[
0
]
=
2
0873167.574
;
obs
.
data
[
4
].
P
[
0
]
=
2
1596022.619
;
obs
.
data
[
3
].
P
[
0
]
=
2
0920707.830
;
std
::
cout
<<
"Obs number: "
<<
obs
.
n
<<
std
::
endl
;
std
::
cout
<<
"Obs number: "
<<
obs
.
n
<<
std
::
endl
;
sortobs
(
&
obs
);
}
}
...
@@ -65,7 +68,7 @@ int createObsAndNav(Observations* observations, char* obs_path, Navigation* nav
...
@@ -65,7 +68,7 @@ int createObsAndNav(Observations* observations, char* obs_path, Navigation* nav
for
(
int
i
=
0
;
i
<
obs
.
n
;
i
++
)
for
(
int
i
=
0
;
i
<
obs
.
n
;
i
++
)
{
{
std
::
cout
<<
"time: "
<<
obs
.
data
[
i
].
time
.
time
<<
" | sat: "
<<
int
(
obs
.
data
[
i
].
sat
)
<<
" | rcv: "
<<
obs
.
data
[
i
].
rcv
<<
std
::
cout
<<
"time: "
<<
time_str
(
obs
.
data
[
i
].
time
,
3
)
<<
" | sat: "
<<
int
(
obs
.
data
[
i
].
sat
)
<<
" | rcv: "
<<
obs
.
data
[
i
].
rcv
<<
" | SNR: "
<<
obs
.
data
[
i
].
SNR
[
0
]
<<
" | LLI: "
<<
obs
.
data
[
i
].
LLI
[
0
]
<<
" | code: "
<<
obs
.
data
[
i
].
code
[
0
]
<<
" | SNR: "
<<
obs
.
data
[
i
].
SNR
[
0
]
<<
" | LLI: "
<<
obs
.
data
[
i
].
LLI
[
0
]
<<
" | code: "
<<
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
;
" | L: "
<<
obs
.
data
[
i
].
L
[
0
]
<<
" | P: "
<<
obs
.
data
[
i
].
P
[
0
]
<<
" | D: "
<<
obs
.
data
[
i
].
D
[
0
]
<<
std
::
endl
;
observations
->
pushObservation
(
obs
.
data
[
i
]);
observations
->
pushObservation
(
obs
.
data
[
i
]);
...
@@ -73,17 +76,22 @@ int createObsAndNav(Observations* observations, char* obs_path, Navigation* nav
...
@@ -73,17 +76,22 @@ int createObsAndNav(Observations* observations, char* obs_path, Navigation* nav
free
(
obs
.
data
);
free
(
obs
.
data
);
/* header */
std
::
cout
<<
"----------"
<<
std
::
endl
;
std
::
cout
<<
"Navigation"
<<
std
::
endl
;
std
::
cout
<<
"----------"
<<
std
::
endl
;
/* Load _nav attribute into nav variable */
/* Load _nav attribute into nav variable */
nav_t
nav
=
navigation
->
getNavigation
();
nav_t
nav
=
navigation
->
getNavigation
();
if
(
readrnx
(
nav_path
,
rcv
,
opt
,
NULL
,
&
nav
,
NULL
))
if
(
readrnx
(
nav_path
,
rcv
,
opt
,
NULL
,
&
nav
,
NULL
))
{
{
std
::
cout
<<
"Navigation file loaded"
<<
std
::
endl
;
std
::
cout
<<
"Navigation file loaded
.
"
<<
std
::
endl
;
std
::
cout
<<
"GPS satellites: "
<<
nav
.
n
<<
std
::
endl
;
std
::
cout
<<
"GPS satellites
in navigation file
: "
<<
nav
.
n
<<
std
::
endl
;
std
::
cout
<<
"GLONASS satellites: "
<<
nav
.
ng
<<
std
::
endl
;
std
::
cout
<<
"GLONASS satellites
in navigation file
: "
<<
nav
.
ng
<<
std
::
endl
;
std
::
cout
<<
"SBAS satellites: "
<<
nav
.
ns
<<
std
::
endl
;
std
::
cout
<<
"SBAS satellites
in navigation file
: "
<<
nav
.
ns
<<
std
::
endl
;
std
::
cout
<<
"Almanac satellites: "
<<
nav
.
na
<<
std
::
endl
;
std
::
cout
<<
"Almanac satellites
in navigation file
: "
<<
nav
.
na
<<
std
::
endl
;
uniqnav
(
&
nav
);
uniqnav
(
&
nav
);
}
}
...
@@ -110,17 +118,13 @@ int createObsAndNav(Observations* observations, char* obs_path, Navigation* nav
...
@@ -110,17 +118,13 @@ int createObsAndNav(Observations* observations, char* obs_path, Navigation* nav
{
{
std
::
cout
<<
i
<<
" SBAS Sat Id: "
<<
nav
.
seph
[
i
].
sat
<<
std
::
endl
;
std
::
cout
<<
i
<<
" SBAS Sat Id: "
<<
nav
.
seph
[
i
].
sat
<<
std
::
endl
;
}
}
/* Load nav into Navigation object*/
navigation
->
setNavigation
(
nav
);
navigation
->
setNavigation
(
nav
);
std
::
cout
<<
"Navigation message loaded to Navigation class."
<<
std
::
endl
;
std
::
cout
<<
"Navigation message loaded to Navigation class."
<<
std
::
endl
;
return
1
;
return
1
;
}
}
...
@@ -142,22 +146,25 @@ int main(int argc, char *argv[])
...
@@ -142,22 +146,25 @@ int main(int argc, char *argv[])
// create Navigation object
// create Navigation object
Navigation
navigation
;
Navigation
navigation
;
createObsAndNav
(
&
observations
,
"/home/jlaplaza/gitlab/gnss_utils/src/examples/raw_201805171357.obs"
,
&
navigation
,
"/home/jlaplaza/gitlab/gnss_utils/src/examples/raw_201805171357.nav"
);
createObsAndNav
(
&
observations
,
"/home/jlaplaza/gitlab/gnss_utils/src/examples/raw_201805171357.obs"
,
&
navigation
,
"/home/jlaplaza/gitlab/gnss_utils/src/examples/raw_201805171357.nav"
);
nav_t
nav
2
=
navigation
.
getNavigation
();
nav_t
nav
=
navigation
.
getNavigation
();
std
::
cout
<<
"Navigation eph number "
<<
nav
2
.
n
<<
std
::
endl
;
std
::
cout
<<
"Navigation eph number "
<<
nav
.
n
<<
std
::
endl
;
/* Set processing options */
/* Set processing options */
/* header */
std
::
cout
<<
"------------------"
<<
std
::
endl
;
std
::
cout
<<
"Processing options"
<<
std
::
endl
;
std
::
cout
<<
"------------------"
<<
std
::
endl
;
prcopt_t
prcopt
=
prcopt_default
;
prcopt_t
prcopt
=
prcopt_default
;
prcopt
.
mode
=
PMODE_SINGLE
;
prcopt
.
mode
=
PMODE_SINGLE
;
prcopt
.
soltype
=
0
;
prcopt
.
soltype
=
0
;
prcopt
.
nf
=
1
;
prcopt
.
nf
=
1
;
prcopt
.
navsys
=
SYS_GPS
;
prcopt
.
navsys
=
SYS_GPS
;
prcopt
.
elmin
=
1.05
;
// 60 degrees = 1.05 rad
//
prcopt.elmin = 1.05; // 60 degrees = 1.05 rad
prcopt
.
sateph
=
EPHOPT_BRDC
;
prcopt
.
sateph
=
EPHOPT_BRDC
;
prcopt
.
ionoopt
=
IONOOPT_OFF
;
prcopt
.
ionoopt
=
IONOOPT_OFF
;
prcopt
.
tropopt
=
TROPOPT_OFF
;
prcopt
.
tropopt
=
TROPOPT_OFF
;
...
@@ -171,8 +178,13 @@ int main(int argc, char *argv[])
...
@@ -171,8 +178,13 @@ int main(int argc, char *argv[])
std
::
cout
<<
"Processing options defined"
<<
std
::
endl
;
std
::
cout
<<
"Processing options defined"
<<
std
::
endl
;
//Compute fix
//Compute spp
/* header */
std
::
cout
<<
"-----------"
<<
std
::
endl
;
std
::
cout
<<
"pntpos call"
<<
std
::
endl
;
std
::
cout
<<
"-----------"
<<
std
::
endl
;
int
stat
;
int
stat
;
sol_t
solb
=
{{
0
}};
sol_t
solb
=
{{
0
}};
...
@@ -181,15 +193,20 @@ int main(int argc, char *argv[])
...
@@ -181,15 +193,20 @@ int main(int argc, char *argv[])
std
::
vector
<
obsd_t
>
obs
=
observations
.
getObservations
();
std
::
vector
<
obsd_t
>
obs
=
observations
.
getObservations
();
std
::
cout
<<
"obs: "
<<
obs
[
0
].
P
[
0
]
<<
std
::
endl
;
for
(
int
i
=
0
;
i
<
obs
.
size
();
i
++
)
{
nav_t
nav
=
navigation
.
getNavigation
();
std
::
cout
<<
"time: "
<<
time_str
(
obs
[
i
].
time
,
3
)
<<
" | sat: "
<<
int
(
obs
[
i
].
sat
)
<<
" | rcv: "
<<
obs
[
i
].
rcv
<<
" | SNR: "
<<
obs
[
i
].
SNR
[
0
]
<<
" | LLI: "
<<
obs
[
i
].
LLI
[
0
]
<<
" | code: "
<<
obs
[
i
].
code
[
0
]
<<
" | L: "
<<
obs
[
i
].
L
[
0
]
<<
" | P: "
<<
obs
[
i
].
P
[
0
]
<<
" | D: "
<<
obs
[
i
].
D
[
0
]
<<
std
::
endl
;
}
stat
=
pntpos
(
&
(
obs
[
0
]),
obs
.
size
(),
&
nav
,
&
prcopt
,
&
solb
,
NULL
,
NULL
,
msg
);
std
::
cout
<<
"obs.size(): "
<<
obs
.
size
()
<<
std
::
endl
;
stat
=
pntpos
(
&
obs
[
0
],
obs
.
size
(),
&
nav
,
&
prcopt
,
&
solb
,
NULL
,
NULL
,
msg
);
std
::
cout
<<
"msg: "
<<
msg
<<
std
::
endl
;
std
::
cout
<<
"msg: "
<<
msg
<<
std
::
endl
;
std
::
cout
<<
"
S
tat: "
<<
stat
<<
std
::
endl
;
std
::
cout
<<
"
sol.s
tat: "
<<
solb
.
stat
<<
std
::
endl
;
std
::
cout
<<
"Position: "
<<
solb
.
rr
[
0
]
<<
", "
<<
solb
.
rr
[
1
]
<<
", "
<<
solb
.
rr
[
2
]
<<
std
::
endl
;
std
::
cout
<<
"Position: "
<<
solb
.
rr
[
0
]
<<
", "
<<
solb
.
rr
[
1
]
<<
", "
<<
solb
.
rr
[
2
]
<<
std
::
endl
;
...
...
This diff is collapsed.
Click to expand it.
src/getPos.cpp
+
1
−
1
View file @
d643029f
...
@@ -16,7 +16,7 @@ static int getPos(Observations observations, Navigation navigation, sol_t sol)
...
@@ -16,7 +16,7 @@ static int getPos(Observations observations, Navigation navigation, sol_t sol)
prcopt
.
soltype
=
0
;
prcopt
.
soltype
=
0
;
prcopt
.
nf
=
1
;
prcopt
.
nf
=
1
;
prcopt
.
navsys
=
SYS_GPS
;
prcopt
.
navsys
=
SYS_GPS
;
prcopt
.
elmin
=
1.05
;
// 60 degrees = 1.05 rad
//
prcopt.elmin = 1.05; // 60 degrees = 1.05 rad
prcopt
.
sateph
=
EPHOPT_BRDC
;
prcopt
.
sateph
=
EPHOPT_BRDC
;
prcopt
.
ionoopt
=
IONOOPT_OFF
;
prcopt
.
ionoopt
=
IONOOPT_OFF
;
prcopt
.
tropopt
=
TROPOPT_OFF
;
prcopt
.
tropopt
=
TROPOPT_OFF
;
...
...
This diff is collapsed.
Click to expand it.
src/navigation.cpp
+
1
−
1
View file @
d643029f
...
@@ -87,7 +87,7 @@ void Navigation::setNavigation(nav_t nav)
...
@@ -87,7 +87,7 @@ void Navigation::setNavigation(nav_t nav)
*/
*/
//
_nav = nav;
_nav
=
nav
;
}
}
const
nav_t
&
Navigation
::
getNavigation
()
const
const
nav_t
&
Navigation
::
getNavigation
()
const
...
...
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