From 5fc8b445154886d77e3689350c9fde75abe33750 Mon Sep 17 00:00:00 2001 From: Joris Vaillant Date: Thu, 9 Jan 2025 11:15:55 +0100 Subject: [PATCH] spatial: Add SE3Expr unit test --- unittest/spatial.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/unittest/spatial.cpp b/unittest/spatial.cpp index 65cb9b9279..3679c94090 100644 --- a/unittest/spatial.cpp +++ b/unittest/spatial.cpp @@ -116,6 +116,25 @@ BOOST_AUTO_TEST_CASE(test_SE3) } } +BOOST_AUTO_TEST_CASE(test_SE3_expr) +{ + using namespace pinocchio; + + SE3 amb = SE3::Random(); + SE3 bmc = SE3::Random(); + + SE3 amc_expected; + SE3 amc_expr; + SE3 amc_expr_noalias; + + amc_expected = amb * bmc; + amc_expr.expr() = amb.const_expr() * bmc.const_expr(); + amc_expr_noalias.expr().noalias() = amb.const_expr() * bmc.const_expr(); + + BOOST_CHECK(amc_expected.toActionMatrix().isApprox(amc_expr.toActionMatrix())); + BOOST_CHECK(amc_expected.toActionMatrix().isApprox(amc_expr_noalias.toActionMatrix())); +} + BOOST_AUTO_TEST_CASE(test_Motion) { using namespace pinocchio;