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
395e44bd
Commit
395e44bd
authored
6 years ago
by
Javier Laplaza Galindo
Browse files
Options
Downloads
Patches
Plain Diff
Receiver class definition without the example
parent
3f1bc2c7
No related branches found
Branches containing commit
No related tags found
1 merge request
!2
Resolve "Enable Standard Point Positioning (SPP) computation"
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
include/gnss_utils.h
+22
-14
22 additions, 14 deletions
include/gnss_utils.h
src/CMakeLists.txt
+2
-2
2 additions, 2 deletions
src/CMakeLists.txt
src/examples/gnss_utils_test.cpp
+12
-13
12 additions, 13 deletions
src/examples/gnss_utils_test.cpp
src/gnss_utils.cpp
+65
-8
65 additions, 8 deletions
src/gnss_utils.cpp
with
101 additions
and
37 deletions
include/gnss_utils.h
+
22
−
14
View file @
395e44bd
...
@@ -5,8 +5,6 @@
...
@@ -5,8 +5,6 @@
#include
<iostream>
#include
<iostream>
#include
<memory>
#include
<memory>
#include
"observation.h"
extern
"C"
extern
"C"
{
{
#include
"/home/jlaplaza/RTKLIB/src/rtklib.h"
#include
"/home/jlaplaza/RTKLIB/src/rtklib.h"
...
@@ -39,25 +37,38 @@ namespace GNSSUtils
...
@@ -39,25 +37,38 @@ namespace GNSSUtils
void
clearNavigation
();
void
clearNavigation
();
void
push
Navigation
(
nav_t
nav
);
void
set
Navigation
(
nav_t
nav
);
std
::
vector
<
nav_t
>
getNavigation
();
nav_t
getNavigation
();
/* - Processing Options - */
/* - Processing Options - */
void
clearOptions
();
void
clearOptions
();
void
push
Option
(
prcopt_t
opt
);
void
set
Option
s
(
prcopt_t
opt
);
std
::
vector
<
prcopt_t
>
getOptions
();
prcopt_t
getOptions
();
/* - Solution - */
/* - Solution - */
void
clearSolution
();
void
setSolution
(
sol_t
sol
);
sol_t
getSolution
();
/* - Satellite status - */
/* - Satellite status - */
void
clearSatStatus
();
void
setSatStatus
(
ssat_t
ssat
);
ssat_t
getSatStatus
();
/* - Compute Fix - */
/* - Compute Fix - */
int
computeSPP
(
double
*
azel
,
char
*
msg
);
int
computeSPP
(
double
*
azel
,
char
*
msg
);
...
@@ -67,21 +78,18 @@ namespace GNSSUtils
...
@@ -67,21 +78,18 @@ namespace GNSSUtils
std
::
vector
<
obsd_t
>
_obsVector
;
std
::
vector
<
obsd_t
>
_obsVector
;
// rtklib-like attribute to represent the different navigation msgs for a given epoch
// rtklib-like attribute to represent the different navigation msgs for a given epoch
std
::
vector
<
nav_t
>
_nav
Vector
;
nav_t
_nav
;
// rtklib-like attribute to represent the different options for a given epoch
// rtklib-like attribute to represent the different options for a given epoch
std
::
vector
<
prcopt_t
>
_opt
;
prcopt_t
_opt
;
// rtklib-like attribute to represent the solution for a given epoch
// rtklib-like attribute to represent the solution for a given epoch
std
::
Vector
<
sol_t
>
_sol
;
sol_t
_sol
;
// rtklib-like attribute to represent the satellite status for a given epoch
// rtklib-like attribute to represent the satellite status for a given epoch
std
::
vector
<
ssat_t
>
_ssat
;
ssat_t
_ssat
;
};
};
}
}
#endif
#endif
This diff is collapsed.
Click to expand it.
src/CMakeLists.txt
+
2
−
2
View file @
395e44bd
# driver source files
# driver source files
SET
(
sources gnss_utils.cpp
observation.cpp
)
SET
(
sources gnss_utils.cpp
)
# application header files
# application header files
SET
(
headers ../include/gnss_utils.h
../include/observation.h
)
SET
(
headers ../include/gnss_utils.h
)
# RTKLIB
# RTKLIB
INCLUDE
(
${
PROJECT_SOURCE_DIR
}
/cmake_modules/FindRTKLIB.cmake
)
INCLUDE
(
${
PROJECT_SOURCE_DIR
}
/cmake_modules/FindRTKLIB.cmake
)
...
...
This diff is collapsed.
Click to expand it.
src/examples/gnss_utils_test.cpp
+
12
−
13
View file @
395e44bd
#include
"../../include/gnss_utils.h"
#include
"../../include/gnss_utils.h"
#include
"../../include/observation.h"
#include
<iostream>
#include
<iostream>
using
namespace
GNSSUtils
;
using
namespace
GNSSUtils
;
...
@@ -11,7 +10,7 @@ int main(int argc, char *argv[])
...
@@ -11,7 +10,7 @@ int main(int argc, char *argv[])
std
::
cout
<<
"GNSS Utils Library Example"
<<
std
::
endl
;
std
::
cout
<<
"GNSS Utils Library Example"
<<
std
::
endl
;
std
::
cout
<<
"--------------------------"
<<
std
::
endl
;
std
::
cout
<<
"--------------------------"
<<
std
::
endl
;
// create a Receiver object
// create a Receiver object
GNSSUtils
::
Receiver
test_rcv
;
//
GNSSUtils::Receiver test_rcv;
// create a Observation object
// create a Observation object
gtime_t
ts
=
{
0
};
gtime_t
ts
=
{
0
};
...
@@ -19,22 +18,22 @@ int main(int argc, char *argv[])
...
@@ -19,22 +18,22 @@ int main(int argc, char *argv[])
std
::
vector
<
unsigned
char
>
vu
({
q
,
w
,
e
});
std
::
vector
<
unsigned
char
>
vu
({
q
,
w
,
e
});
std
::
vector
<
double
>
vd
({
1.
,
2.
,
3.
});
std
::
vector
<
double
>
vd
({
1.
,
2.
,
3.
});
std
::
vector
<
float
>
vf
({
1.
,
2.
,
3.
});
std
::
vector
<
float
>
vf
({
1.
,
2.
,
3.
});
Observation
test_obs
(
ts
,
1
,
1
,
vu
,
vu
,
vu
,
vd
,
vd
,
vf
);
//
Observation test_obs(ts, 1, 1, vu, vu, vu, vd, vd, vf);
// Display current Observation
// Display current Observation
std
::
cout
<<
"Current observation (sat): "
<<
"("
<<
test_obs
.
getSat
()
<<
")"
<<
std
::
endl
;
//
std::cout << "Current observation (sat): " << "(" << test_obs.getSat() << ")" << std::endl;
std
::
cout
<<
"Current observation (SNR): "
<<
"("
;
//
std::cout << "Current observation (SNR): " << "(" ;
for
(
unsigned
char
i
=
0
;
i
<
3
;
++
i
)
//
for (unsigned char i=0; i < 3; ++i)
std
::
cout
<<
test_obs
.
getSNR
()[
i
]
<<
", "
;
//
std::cout << test_obs.getSNR()[i] << ", ";
std
::
cout
<<
")"
<<
std
::
endl
;
//
std::cout << ")" << std::endl;
obsd_t
obs
=
test_obs
.
convert2rtk
();
//
obsd_t obs = test_obs.convert2rtk();
std
::
cout
<<
"Observation SNR in RTKLIB format: "
<<
"("
;
//
std::cout << "Observation SNR in RTKLIB format: " << "(";
for
(
unsigned
char
i
=
0
;
i
<
3
;
++
i
)
//
for (unsigned char i=0; i < 3; ++i)
std
::
cout
<<
obs
.
SNR
[
i
]
<<
", "
;
//
std::cout << obs.SNR[i] << ", ";
std
::
cout
<<
")"
<<
std
::
endl
;
//
std::cout << ")" << std::endl;
}
}
This diff is collapsed.
Click to expand it.
src/gnss_utils.cpp
+
65
−
8
View file @
395e44bd
...
@@ -37,31 +37,88 @@ std::vector<obsd_t> Receiver::getObservations()
...
@@ -37,31 +37,88 @@ std::vector<obsd_t> Receiver::getObservations()
void
Receiver
::
clearNavigation
()
void
Receiver
::
clearNavigation
()
{
{
_nav
Vector
.
clear
()
;
//
_nav
= NULL
;
}
}
void
Receiver
::
push
Navigation
(
nav_t
nav
)
void
Receiver
::
set
Navigation
(
nav_t
nav
)
{
{
_nav
Vector
.
push_back
(
nav
)
;
_nav
=
nav
;
}
}
std
::
vector
<
nav_t
>
Receiver
::
getNavigation
()
nav_t
Receiver
::
getNavigation
()
{
{
return
this
->
_nav
Vector
;
return
this
->
_nav
;
}
}
/* - Processing options - */
void
Receiver
::
clearOptions
()
{
//_opt = NULL;
}
void
Receiver
::
setOptions
(
prcopt_t
opt
)
{
_opt
=
opt
;
}
prcopt_t
Receiver
::
getOptions
()
{
return
this
->
_opt
;
}
/* - Solution - */
void
Receiver
::
clearSolution
()
{
//_sol = NULL;
}
void
Receiver
::
setSolution
(
sol_t
sol
)
{
_sol
=
sol
;
}
sol_t
Receiver
::
getSolution
()
{
return
this
->
_sol
;
}
/* - Satellite Status - */
void
Receiver
::
clearSatStatus
()
{
//_ssat = NULL;
}
void
Receiver
::
setSatStatus
(
ssat_t
ssat
)
{
_ssat
=
ssat
;
}
ssat_t
Receiver
::
getSatStatus
()
{
return
this
->
_ssat
;
}
/* - Compute Fix - */
int
Receiver
::
get
SPP
(
double
*
azel
,
char
*
msg
)
int
Receiver
::
compute
SPP
(
double
*
azel
,
char
*
msg
)
{
{
obsd_t
*
obs
=
&
this
->
_obsVector
[
0
];
const
obsd_t
*
obs
=
&
this
->
_obsVector
[
0
];
int
n
=
this
->
_obsVector
.
size
();
int
n
=
this
->
_obsVector
.
size
();
/*
const nav_t *nav = this->_nav;
const prcopt_t *opt = this->_opt;
sol_t *sol = this->_sol;
ssat_t *ssat = this->_ssat;
*/
return
int
pntpos
(
*
obs
,
n
,
nav_t
*
nav
,
*
opt
,
*
sol
,
*
azel
,
*
ssat
,
*
msg
)
return
pntpos
(
obs
,
n
,
&
_
nav
,
&
_
opt
,
&
_
sol
,
azel
,
&
_
ssat
,
msg
)
;
}
}
...
...
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