Skip to content

Commit 5fc8b44

Browse files
committed
spatial: Add SE3Expr unit test
1 parent c680da2 commit 5fc8b44

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

unittest/spatial.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,25 @@ BOOST_AUTO_TEST_CASE(test_SE3)
116116
}
117117
}
118118

119+
BOOST_AUTO_TEST_CASE(test_SE3_expr)
120+
{
121+
using namespace pinocchio;
122+
123+
SE3 amb = SE3::Random();
124+
SE3 bmc = SE3::Random();
125+
126+
SE3 amc_expected;
127+
SE3 amc_expr;
128+
SE3 amc_expr_noalias;
129+
130+
amc_expected = amb * bmc;
131+
amc_expr.expr() = amb.const_expr() * bmc.const_expr();
132+
amc_expr_noalias.expr().noalias() = amb.const_expr() * bmc.const_expr();
133+
134+
BOOST_CHECK(amc_expected.toActionMatrix().isApprox(amc_expr.toActionMatrix()));
135+
BOOST_CHECK(amc_expected.toActionMatrix().isApprox(amc_expr_noalias.toActionMatrix()));
136+
}
137+
119138
BOOST_AUTO_TEST_CASE(test_Motion)
120139
{
121140
using namespace pinocchio;

0 commit comments

Comments
 (0)