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
1a5880dc
Commit
1a5880dc
authored
3 years ago
by
Mederic Fourmy
Browse files
Options
Downloads
Patches
Plain Diff
Fixed SE3::inverse and wrote a gtest
parent
d6bb3f98
No related branches found
No related tags found
1 merge request
!466
devel->main
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/core/math/SE3.h
+1
-1
1 addition, 1 deletion
include/core/math/SE3.h
test/gtest_SE3.cpp
+29
-0
29 additions, 0 deletions
test/gtest_SE3.cpp
with
30 additions
and
1 deletion
include/core/math/SE3.h
+
1
−
1
View file @
1a5880dc
...
...
@@ -108,7 +108,7 @@ inline void inverse(const MatrixBase<D1>& p, const QuaternionBase<D2>& q,
MatrixSizeCheck
<
3
,
1
>::
check
(
p
);
MatrixSizeCheck
<
3
,
1
>::
check
(
ip
);
ip
=
-
q
.
conjugate
()
*
p
;
ip
=
-
(
q
.
conjugate
()
*
p
)
;
iq
=
q
.
conjugate
()
;
}
...
...
This diff is collapsed.
Click to expand it.
test/gtest_SE3.cpp
+
29
−
0
View file @
1a5880dc
...
...
@@ -103,6 +103,34 @@ TEST(SE3, log_of_power)
ASSERT_MATRIX_APPROX
(
tau3
,
log
(
pose3
),
1e-8
);
}
TEST
(
SE3
,
inverse
)
{
Vector3d
p
;
p
.
setRandom
();
Vector4d
qvec
;
qvec
.
setRandom
().
normalized
();
Quaterniond
q
(
qvec
);
Vector3d
pi_true
=
-
(
q
.
conjugate
()
*
p
);
Quaterniond
qi_true
=
q
.
conjugate
();
// separate API
Vector3d
pi_out
;
Quaterniond
qi_out
;
inverse
(
p
,
q
,
pi_out
,
qi_out
);
ASSERT_MATRIX_APPROX
(
pi_out
,
pi_true
,
1e-8
);
ASSERT_MATRIX_APPROX
(
qi_out
.
coeffs
(),
qi_true
.
coeffs
(),
1e-8
);
// Vector7d API
Vector7d
pose
;
pose
<<
p
,
q
.
coeffs
();
Vector7d
posei_true
;
posei_true
<<
pi_true
,
qi_true
.
coeffs
();
Vector7d
posei_out
;
inverse
(
pose
,
posei_out
);
ASSERT_MATRIX_APPROX
(
posei_out
,
posei_true
,
1e-8
);
posei_out
=
inverse
(
pose
);
ASSERT_MATRIX_APPROX
(
posei_out
,
posei_true
,
1e-8
);
}
TEST
(
SE3
,
composeBlocks
)
{
Vector3d
p1
,
p2
,
pc
;
...
...
@@ -401,6 +429,7 @@ TEST(SE3, interpolate_third)
ASSERT_MATRIX_APPROX
(
p_pre
,
p_gt
,
1e-8
);
}
TEST
(
SE3
,
toSE3_I
)
{
Vector7d
pose
;
pose
<<
0
,
0
,
0
,
0
,
0
,
0
,
1
;
...
...
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