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
62d6baf5
Commit
62d6baf5
authored
1 month ago
by
Joan Vallvé Navarro
Browse files
Options
Downloads
Patches
Plain Diff
undef PI of RTKLIB to avoid conflicts with other libraries
parent
c9bb44b8
No related branches found
No related tags found
1 merge request
!29
Devel
Pipeline
#21183
passed
1 month ago
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/gnss_utils/gnss_utils.h
+1
-8
1 addition, 8 deletions
include/gnss_utils/gnss_utils.h
src/utils/transformations.cpp
+7
-10
7 additions, 10 deletions
src/utils/transformations.cpp
with
8 additions
and
18 deletions
include/gnss_utils/gnss_utils.h
+
1
−
8
View file @
62d6baf5
...
@@ -34,14 +34,6 @@ extern "C" {
...
@@ -34,14 +34,6 @@ extern "C" {
// eigen
// eigen
#include
<Eigen/Dense>
#include
<Eigen/Dense>
#ifndef RAD2DEG
#define RAD2DEG 180.0 / 3.14159265358979323846
#endif
#ifndef DEG2RAD
#define DEG2RAD 3.14159265358979323846 / 180.0
#endif
namespace
GnssUtils
namespace
GnssUtils
{
{
...
@@ -226,5 +218,6 @@ enum Combination
...
@@ -226,5 +218,6 @@ enum Combination
};
};
#undef PI // avoid conflict with other libraries that may define PI
}
}
This diff is collapsed.
Click to expand it.
src/utils/transformations.cpp
+
7
−
10
View file @
62d6baf5
...
@@ -29,25 +29,22 @@ namespace GnssUtils
...
@@ -29,25 +29,22 @@ namespace GnssUtils
Eigen
::
Vector3d
ecefToLatLonAlt
(
const
Eigen
::
Vector3d
&
_ecef
,
bool
in_rads
)
Eigen
::
Vector3d
ecefToLatLonAlt
(
const
Eigen
::
Vector3d
&
_ecef
,
bool
in_rads
)
{
{
Eigen
::
Vector3d
latlonalt
;
Eigen
::
Vector3d
latlonalt
;
ecef2pos
(
_ecef
.
data
(),
latlonalt
.
data
());
ecef2pos
(
_ecef
.
data
(),
latlonalt
.
data
());
// in rads
if
(
not
in_rads
)
// requested in degrees
latlonalt
.
head
<
2
>
()
*=
180.0
/
M_PI
;
if
(
not
in_rads
)
{
latlonalt
(
0
)
=
RAD2DEG
*
latlonalt
(
0
);
latlonalt
(
1
)
=
RAD2DEG
*
latlonalt
(
1
);
}
return
latlonalt
;
return
latlonalt
;
}
}
Eigen
::
Vector3d
latLonAltToEcef
(
const
Eigen
::
Vector3d
&
_latlon
,
bool
in_rads
)
Eigen
::
Vector3d
latLonAltToEcef
(
const
Eigen
::
Vector3d
&
_latlon
,
bool
in_rads
)
{
{
Eigen
::
Vector3d
ecef
;
Eigen
::
Vector3d
ecef
;
if
(
not
in_rads
)
if
(
not
in_rads
)
// provided in degrees
{
{
Eigen
::
Vector3d
latlon_rads
=
_latlon
;
Eigen
::
Vector3d
latlon_rads
=
_latlon
;
latlon_rads
(
0
)
=
DEG2RAD
*
_latlon
(
0
);
latlon_rads
.
head
<
2
>
()
*=
M_PI
/
180.0
;
latlon_rads
(
1
)
=
DEG2RAD
*
_latlon
(
1
);
latlon_rads
(
2
)
=
_latlon
(
2
);
pos2ecef
(
latlon_rads
.
data
(),
ecef
.
data
());
pos2ecef
(
latlon_rads
.
data
(),
ecef
.
data
());
}
}
else
else
...
...
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