Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Pierre NARVOR
rtac_base
Commits
a056a29f
Commit
a056a29f
authored
Nov 30, 2021
by
Pierre NARVOR
Browse files
[navigation] Added some enu_to_ned helpers
parent
80d53302
Changes
1
Hide whitespace changes
Inline
Side-by-side
include/rtac_base/navigation.h
View file @
a056a29f
...
...
@@ -33,10 +33,6 @@ Eigen::Quaternion<T> enu_to_ned_quaternion()
return
ned_to_enu_quaternion
<
T
>
().
inverse
();
}
/**
* Conversion of a Quaternion from North East Down (NED) convention to
* East North Up convention.
*/
template
<
typename
T
>
Eigen
::
Quaternion
<
T
>
ned_to_enu
(
const
Eigen
::
Quaternion
<
T
>&
nedRot
)
{
...
...
@@ -44,10 +40,6 @@ Eigen::Quaternion<T> ned_to_enu(const Eigen::Quaternion<T>& nedRot)
return
q
.
inverse
()
*
nedRot
*
q
;
}
/**
* Conversion of a Matrix3 from North East Down (NED) convention to
* East North Up convention.
*/
template
<
typename
T
>
Eigen
::
Matrix3
<
T
>
ned_to_enu
(
const
Eigen
::
Matrix3
<
T
>&
m
)
{
...
...
@@ -56,16 +48,33 @@ Eigen::Matrix3<T> ned_to_enu(const Eigen::Matrix3<T>& m)
}
/**
* Conversion of a Vector3 from North East Down (NED) convention to
* East North Up convention.
*/
template
<
typename
T
>
Eigen
::
Vector3
<
T
>
ned_to_enu
(
const
Eigen
::
Vector3
<
T
>&
v
)
{
return
(
Eigen
::
Vector3
<
T
>
()
<<
v
(
1
),
v
(
0
),
-
v
(
2
)).
finished
();
}
template
<
typename
T
>
Eigen
::
Quaternion
<
T
>
enu_to_ned
(
const
Eigen
::
Quaternion
<
T
>&
nedRot
)
{
auto
q
=
enu_to_ned_quaternion
<
T
>
();
return
q
.
inverse
()
*
nedRot
*
q
;
}
template
<
typename
T
>
Eigen
::
Matrix3
<
T
>
enu_to_ned
(
const
Eigen
::
Matrix3
<
T
>&
m
)
{
auto
P
=
enu_to_ned_matrix
<
T
>
();
return
P
.
transpose
()
*
m
*
P
;
}
template
<
typename
T
>
Eigen
::
Vector3
<
T
>
enu_to_ned
(
const
Eigen
::
Vector3
<
T
>&
v
)
{
return
(
Eigen
::
Vector3
<
T
>
()
<<
v
(
1
),
v
(
0
),
-
v
(
2
)).
finished
();
}
/**
* Conversion from Tait-Bryan angles to Quaternion in NED convention.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment