Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
wolf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
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
mobile_robotics
wolf_projects
wolf_lib
wolf
Commits
9f47d66e
Commit
9f47d66e
authored
3 years ago
by
Mederic Fourmy
Browse files
Options
Downloads
Patches
Plain Diff
[skip-ci] Implemented inverse composite for SE3
parent
1a5880dc
No related branches found
No related tags found
1 merge request
!466
devel->main
Pipeline
#11563
skipped
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/core/math/SE3.h
+13
-13
13 additions, 13 deletions
include/core/math/SE3.h
test/gtest_SE3.cpp
+22
-0
22 additions, 0 deletions
test/gtest_SE3.cpp
with
35 additions
and
13 deletions
include/core/math/SE3.h
+
13
−
13
View file @
9f47d66e
...
@@ -135,19 +135,19 @@ inline Matrix<typename D::Scalar, 7, 1> inverse(const MatrixBase<D>& d)
...
@@ -135,19 +135,19 @@ inline Matrix<typename D::Scalar, 7, 1> inverse(const MatrixBase<D>& d)
return
id
;
return
id
;
}
}
//
inline void inverse(const VectorComposite& v, VectorComposite& c)
inline
void
inverse
(
const
VectorComposite
&
v
,
VectorComposite
&
c
)
//
{
{
//
Map<const Quaternion<double> > qv( & v.at('O')(0) );
Map
<
const
Quaternion
<
double
>
>
qv
(
&
v
.
at
(
'O'
)(
0
)
);
//
Map<
const
Quaternion<double> > qc( & c
.at(
'O'
)
(0) );
Map
<
Quaternion
<
double
>
>
qc
(
&
c
[
'O'
]
(
0
)
);
//
inverse(v.at('P'), qv, c
.at(
'P'
)
, qc);
inverse
(
v
.
at
(
'P'
),
qv
,
c
[
'P'
]
,
qc
);
//
}
}
//
inline VectorComposite inverse(const VectorComposite& v)
inline
VectorComposite
inverse
(
const
VectorComposite
&
v
)
//
{
{
//
VectorComposite c("PO", {3,4});
VectorComposite
c
(
"PO"
,
{
3
,
4
});
//
inverse(v, c);
inverse
(
v
,
c
);
//
return c;
return
c
;
//
}
}
template
<
typename
D1
,
typename
D2
,
typename
D4
,
typename
D5
,
typename
D7
,
typename
D8
>
template
<
typename
D1
,
typename
D2
,
typename
D4
,
typename
D5
,
typename
D7
,
typename
D8
>
...
...
This diff is collapsed.
Click to expand it.
test/gtest_SE3.cpp
+
22
−
0
View file @
9f47d66e
...
@@ -131,6 +131,28 @@ TEST(SE3, inverse)
...
@@ -131,6 +131,28 @@ TEST(SE3, inverse)
ASSERT_MATRIX_APPROX
(
posei_out
,
posei_true
,
1e-8
);
ASSERT_MATRIX_APPROX
(
posei_out
,
posei_true
,
1e-8
);
}
}
TEST
(
SE3
,
inverseComposite
)
{
Vector3d
p
;
p
.
setRandom
();
Vector4d
qvec
;
qvec
.
setRandom
().
normalized
();
VectorComposite
pose_vc
(
"PO"
,
{
p
,
qvec
});
Quaterniond
q
(
qvec
);
// ground truth
Vector3d
pi_true
=
-
(
q
.
conjugate
()
*
p
);
Quaterniond
qi_true
=
q
.
conjugate
();
VectorComposite
pose_vc_out
(
"PO"
,
{
3
,
4
});
inverse
(
pose_vc
,
pose_vc_out
);
ASSERT_MATRIX_APPROX
(
pose_vc_out
.
at
(
'P'
),
pi_true
,
1e-8
);
ASSERT_MATRIX_APPROX
(
pose_vc_out
.
at
(
'O'
),
qi_true
.
coeffs
(),
1e-8
);
VectorComposite
pose_vc_out_bis
=
inverse
(
pose_vc
);
ASSERT_MATRIX_APPROX
(
pose_vc_out_bis
.
at
(
'P'
),
pi_true
,
1e-8
);
ASSERT_MATRIX_APPROX
(
pose_vc_out_bis
.
at
(
'O'
),
qi_true
.
coeffs
(),
1e-8
);
}
TEST
(
SE3
,
composeBlocks
)
TEST
(
SE3
,
composeBlocks
)
{
{
Vector3d
p1
,
p2
,
pc
;
Vector3d
p1
,
p2
,
pc
;
...
...
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