Skip to content

Commit

Permalink
Fix compat with c++98
Browse files Browse the repository at this point in the history
  • Loading branch information
fspindle committed Jul 25, 2023
1 parent 363533e commit d471553
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
12 changes: 8 additions & 4 deletions modules/core/test/math/testHomogeneousMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,14 @@ TEST_CASE("ENU to NED conversion", "[enu2ned]")
TEST_CASE("vpHomogenousMatrix * vpRotationMatrix", "[operator*]")
{
// Test rotation_matrix * homogeneous_matrix
vpHomogeneousMatrix _1_M_2_ { 0.9835, -0.0581, 0.1716, 0.0072, -0.0489, -0.9972,
-0.0571, 0.0352, 0.1744, 0.0478, -0.9835, 0.9470 };
vpHomogeneousMatrix _2_M_3_truth { 0.9835, -0.0581, 0.1716, 0, -0.0489, -0.9972,
-0.0571, 0, 0.1744, 0.0478, -0.9835, 0 };
vpHomogeneousMatrix _1_M_2_;
_1_M_2_[0][0] = 0.9835; _1_M_2_[0][1] = -0.0581; _1_M_2_[0][2] = 0.1716; _1_M_2_[0][3] = 0.0072;
_1_M_2_[1][0] = -0.0489; _1_M_2_[1][1] = -0.9972; _1_M_2_[1][2] = -0.0571; _1_M_2_[1][3] = 0.0352;
_1_M_2_[2][0] = 0.1744; _1_M_2_[2][1] = 0.0478; _1_M_2_[2][2] = -0.9835; _1_M_2_[2][3] = 0.9470;
vpHomogeneousMatrix _2_M_3_truth;
_2_M_3_truth[0][0] = 0.9835; _2_M_3_truth[0][1] = -0.0581; _2_M_3_truth[0][2] = 0.1716; _2_M_3_truth[0][3] = 0;
_2_M_3_truth[1][0] = -0.0489; _2_M_3_truth[1][1] = -0.9972; _2_M_3_truth[1][2] = -0.0571; _2_M_3_truth[1][3] = 0;
_2_M_3_truth[2][0] = 0.1744; _2_M_3_truth[2][1] = 0.0478; _2_M_3_truth[2][2] = -0.9835; _2_M_3_truth[2][3] = 0;

vpRotationMatrix _2_R_3_ = _2_M_3_truth.getRotationMatrix();
vpHomogeneousMatrix _1_M_3_(_1_M_2_* _2_R_3_);
Expand Down
13 changes: 9 additions & 4 deletions modules/core/test/math/testRotation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,10 +424,15 @@ int main()
}
{
// Test rotation_matrix * homogeneous_matrix
vpHomogeneousMatrix _1_M_2_truth { 0.9835, -0.0581, 0.1716, 0, -0.0489, -0.9972,
-0.0571, 0, 0.1744, 0.0478, -0.9835, 0 };
vpHomogeneousMatrix _2_M_3_ { 0.9835, -0.0581, 0.1716, 0.0072, -0.0489, -0.9972,
-0.0571, 0.0352, 0.1744, 0.0478, -0.9835, 0.9470 };
vpHomogeneousMatrix _1_M_2_truth;
_1_M_2_truth[0][0] = 0.9835; _1_M_2_truth[0][1] = -0.0581; _1_M_2_truth[0][2] = 0.1716; _1_M_2_truth[0][3] = 0;
_1_M_2_truth[1][0] = -0.0489; _1_M_2_truth[1][1] = -0.9972; _1_M_2_truth[1][2] = -0.0571; _1_M_2_truth[1][3] = 0;
_1_M_2_truth[2][0] = 0.1744; _1_M_2_truth[2][1] = 0.0478; _1_M_2_truth[2][2] = -0.9835; _1_M_2_truth[2][3] = 0;
vpHomogeneousMatrix _2_M_3_;
_2_M_3_[0][0] = 0.9835; _2_M_3_[0][1] = -0.0581; _2_M_3_[0][2] = 0.1716; _2_M_3_[0][3] = 0.0072;
_2_M_3_[1][0] = -0.0489; _2_M_3_[1][1] = -0.9972; _2_M_3_[1][2] = -0.0571; _2_M_3_[1][3] = 0.0352;
_2_M_3_[2][0] = 0.1744; _2_M_3_[2][1] = 0.0478; _2_M_3_[2][2] = -0.9835; _2_M_3_[2][3] = 0.9470;

vpRotationMatrix _1_R_2_ = _1_M_2_truth.getRotationMatrix();
vpHomogeneousMatrix _1_M_3_(_1_R_2_* _2_M_3_);
vpHomogeneousMatrix _1_M_3_truth(_1_M_2_truth * _2_M_3_);
Expand Down

0 comments on commit d471553

Please sign in to comment.