Skip to content

Commit 31b26f8

Browse files
author
ipuch
committed
mini modifs
1 parent e64a6fc commit 31b26f8

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

unittest/joint-ellipsoid.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,6 @@ BOOST_AUTO_TEST_CASE(vsSphericalZYX)
284284
JointDataEllipsoid jdata_e = jmodel_e.createData();
285285
jmodel_e.calc(jdata_e, q_e);
286286

287-
288287
// The motion subspace S gives us: omega = S * v
289288
Matrix3 S_s = jdata_s.S.matrix().bottomRows<3>(); // Angular part
290289
Matrix3 S_e = jdata_e.S.matrix().bottomRows<3>(); // Angular part
@@ -313,19 +312,22 @@ BOOST_AUTO_TEST_CASE(vsSphericalZYX)
313312
// Compute forward kinematics with the converted configurations
314313
forwardKinematics(modelEllipsoid, dataEllipsoid, q_e, qd_e);
315314

316-
// Also get the joint data to see body-frame velocities
315+
// Getting S with q_e from the three calcs
317316
JointDataEllipsoid jdata_e_fk = jmodel_e.createData();
318317
JointDataEllipsoid jdata_e_fk2 = jmodel_e.createData();
318+
JointDataEllipsoid jdata_e_fk3 = jmodel_e.createData();
319+
319320
jmodel_e.calc(jdata_e_fk, q_e, qd_e);
321+
320322
jmodel_e.calc(jdata_e_fk2, q_e);
321323

322-
std::cout << "\n=== Motion Subspace Matrices after FK ===" << std::endl;
323-
std::cout << "S_e calc q:\n" << jdata_e_fk.S.matrix() << std::endl;
324-
std::cout << "\nS_e calc q v:\n" << jdata_e_fk2.S.matrix() << std::endl;
325-
324+
jmodel_e.calc(jdata_e_fk3, q_e);
325+
jmodel_e.calc(jdata_e_fk3, Blank(), qd_e);
326+
326327
BOOST_CHECK(jdata_e_fk.S.matrix().isApprox(jdata_e_fk2.S.matrix()));
327-
std::cout << "✓ Motion subspace matrices match" << std::endl;
328-
328+
BOOST_CHECK(jdata_e_fk.S.matrix().isApprox(jdata_e_fk3.S.matrix()));
329+
std::cout << "✓ Motion subspace matrices match for the three calc(...) methods" << std::endl;
330+
329331
JointDataSphericalZYX jdata_s_fk = jmodel_s.createData();
330332
jmodel_s.calc(jdata_s_fk, q_s, qd_s);
331333

@@ -334,8 +336,6 @@ BOOST_AUTO_TEST_CASE(vsSphericalZYX)
334336
std::cout << "joint_vel_e: " << joint_vel_e.transpose() << std::endl;
335337
std::cout << "jdata_e_fk.v : " << jdata_e_fk.v.toVector().transpose() << std::endl;
336338

337-
338-
339339
Eigen::Matrix<double, 6, 1> joint_vel_s = jdata_s_fk.S.matrix() * qd_s;
340340
std::cout << "Ellipsoid (S_xyz * qd_e): " << joint_vel_e.transpose() << std::endl;
341341
std::cout << "SphericalZYX (S_zyx * qd_s): " << joint_vel_s.transpose() << std::endl;

0 commit comments

Comments
 (0)