Skip to content

Commit a817cd9

Browse files
NoelieRamuzatnim65s
authored andcommitted
[operator] Add test in test_operator.cpp
The test compare MatrixHomoToPoseQuaternion to PoseQuaternionToMatrixHomo
1 parent 2b9ebaa commit a817cd9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/matrix/test_operator.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,12 @@ template <> VectorQuaternion random<VectorQuaternion>() {
154154
template <> MatrixRotation random<MatrixRotation>() {
155155
return MatrixRotation(random<VectorQuaternion>());
156156
}
157+
template <> MatrixHomogeneous random<MatrixHomogeneous>() {
158+
MatrixHomogeneous matrix_homo;
159+
matrix_homo.translation() = Eigen::Vector3d::Random();
160+
matrix_homo.linear() = random<MatrixRotation>();
161+
return matrix_homo;
162+
}
157163

158164
template <typename type> bool compare(const type &a, const type &b) {
159165
return a.isApprox(b);
@@ -189,5 +195,8 @@ BOOST_AUTO_TEST_CASE(quaternion_rpy) {
189195
BOOST_AUTO_TEST_CASE(matrix_quaternion) {
190196
test_impl<MatrixToQuaternion, QuaternionToMatrix>();
191197
}
198+
BOOST_AUTO_TEST_CASE(matrixHomo_poseQuaternion) {
199+
test_impl<MatrixHomoToPoseQuaternion, PoseQuaternionToMatrixHomo>();
200+
}
192201

193202
BOOST_AUTO_TEST_SUITE_END()

0 commit comments

Comments
 (0)