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
783f7a32
Commit
783f7a32
authored
2 years ago
by
Joan Vallvé Navarro
Browse files
Options
Downloads
Patches
Plain Diff
fixed quaternion asserts for gtest
parent
e5bc7f2c
No related branches found
No related tags found
1 merge request
!462
Resolve "Subscriber&processor for landmark external detections"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/core/utils/utils_gtest.h
+6
-6
6 additions, 6 deletions
include/core/utils/utils_gtest.h
test/gtest_SE3.cpp
+0
-12
0 additions, 12 deletions
test/gtest_SE3.cpp
with
6 additions
and
18 deletions
include/core/utils/utils_gtest.h
+
6
−
6
View file @
783f7a32
...
...
@@ -135,15 +135,15 @@ TEST(Test, Foo)
}, \
C_expect, C_actual);
#define EXPECT_QUATERNION_APPROX(C_expect, C_actual, precision) EXPECT_PRED2([](const Eigen::
Quaternion
d lhs, const Eigen::
Quaternion
d rhs) { \
return lhs.angularDistance(rhs) < precision; \
#define EXPECT_QUATERNION_APPROX(C_expect, C_actual, precision) EXPECT_PRED2([](const Eigen::
VectorX
d lhs, const Eigen::
VectorX
d rhs) { \
return
Eigen::Quaterniond(Eigen::Vector4d(
lhs
))
.angularDistance(
Eigen::Quaterniond(Eigen::Vector4d(
rhs)
))
< precision; \
}, \
C_expect, C_actual
);
Quaterniond(C_expect).coeffs(), Quaterniond(C_actual).coeffs()
);
#define ASSERT_QUATERNION_APPROX(C_expect, C_actual, precision) ASSERT_PRED2([](const Eigen::
Quaternion
d lhs, const Eigen::
Quaternion
d rhs) { \
return lhs.angularDistance(rhs) < precision; \
#define ASSERT_QUATERNION_APPROX(C_expect, C_actual, precision) ASSERT_PRED2([](const Eigen::
VectorX
d lhs, const Eigen::
VectorX
d rhs) { \
return
Eigen::Quaterniond(Eigen::Vector4d(
lhs
))
.angularDistance(
Eigen::Quaterniond(Eigen::Vector4d(
rhs)
))
< precision; \
}, \
C_expect, C_actual
);
Quaterniond(C_expect).coeffs(), Quaterniond(C_actual).coeffs()
);
#define EXPECT_QUATERNION_VECTOR_APPROX(C_expect, C_actual, precision) EXPECT_PRED2([](const Eigen::VectorXd lhs, const Eigen::VectorXd rhs) { \
return Eigen::Quaterniond(Eigen::Vector4d(lhs)).angularDistance(Eigen::Quaterniond(Eigen::Vector4d(rhs))) < precision; \
...
...
This diff is collapsed.
Click to expand it.
test/gtest_SE3.cpp
+
0
−
12
View file @
783f7a32
...
...
@@ -19,19 +19,10 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
//--------LICENSE_END--------
/**
* \file gtest_SE3.cpp
*
* Created on: Feb 2, 2019
* \author: jsola
*/
#include
"core/math/SE3.h"
#include
"core/utils/utils_gtest.h"
using
namespace
Eigen
;
using
namespace
wolf
;
using
namespace
SE3
;
...
...
@@ -150,7 +141,6 @@ TEST(SE3, inverseComposite)
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
)
...
...
@@ -194,7 +184,6 @@ TEST(SE3, composeEigenVectors)
compose
(
p1
,
q1
,
p2
,
q2
,
pc
,
qc
);
// tested in composeVectorBlocks
Vector7d
x1
;
x1
<<
p1
,
q1
.
coeffs
();
Vector7d
x2
;
x2
<<
p2
,
q2
.
coeffs
();
Vector7d
xc
,
xc_true
;
xc_true
<<
pc
,
qc
.
coeffs
();
...
...
@@ -287,7 +276,6 @@ TEST(SE3, exp_0_Composite)
ASSERT_MATRIX_APPROX
(
x
.
at
(
'P'
),
Vector3d
::
Zero
(),
1e-8
);
ASSERT_MATRIX_APPROX
(
x
.
at
(
'O'
),
Quaterniond
::
Identity
().
coeffs
(),
1e-8
);
}
TEST
(
SE3
,
plus_0_Composite
)
...
...
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