15 #include <boost/test/unit_test.hpp>
16 #include <boost/utility/binary.hpp>
18 BOOST_AUTO_TEST_SUITE(BOOST_TEST_MODULE)
22 using namespace Eigen;
30 model.lowerPositionLimit.head<3>().
fill(-1.);
31 model.upperPositionLimit.head<3>().
fill(1.);
33 VectorXd
v(VectorXd::Random(
model.nv));
34 VectorXd
a(VectorXd::Random(
model.nv));
39 for (
size_t i = 1;
i < (size_t)
model.njoints; ++
i)
41 BOOST_CHECK(
data.oMi[
i].isApprox(data_ref.oMi[
i]));
42 BOOST_CHECK(
data.v[
i].isApprox(data_ref.v[
i]));
43 BOOST_CHECK(
data.ov[
i].isApprox(data_ref.oMi[
i].act(data_ref.v[
i])));
44 BOOST_CHECK(
data.a[
i].isApprox(data_ref.a[
i]));
45 BOOST_CHECK(
data.oa[
i].isApprox(data_ref.oMi[
i].act(data_ref.a[
i])));
49 BOOST_CHECK(
data.J.isApprox(data_ref.
J));
52 BOOST_CHECK(
data.dJ.isApprox(data_ref.
dJ));
57 using namespace Eigen;
65 model.lowerPositionLimit.head<3>().
fill(-1.);
66 model.upperPositionLimit.head<3>().
fill(1.);
68 VectorXd
v(VectorXd::Random(
model.nv));
69 VectorXd
a(VectorXd::Random(
model.nv));
74 ?
model.getJointId(
"rarm2_joint")
79 partial_dq_local_world_aligned.setZero();
81 partial_dq_local.setZero();
85 partial_dv_local_world_aligned.setZero();
87 partial_dv_local.setZero();
93 partial_dv_local_world_aligned);
100 J_ref_local_world_aligned.setZero();
102 J_ref_local.setZero();
108 BOOST_CHECK(partial_dv.isApprox(J_ref));
109 BOOST_CHECK(partial_dv_local_world_aligned.isApprox(J_ref_local_world_aligned));
110 BOOST_CHECK(partial_dv_local.isApprox(J_ref_local));
114 partial_dq_fd.setZero();
116 partial_dq_fd_local_world_aligned.setZero();
118 partial_dq_fd_local.setZero();
120 partial_dv_fd.setZero();
122 partial_dv_fd_local_world_aligned.setZero();
124 partial_dv_fd_local.setZero();
125 const double alpha = 1e-8;
128 Eigen::VectorXd v_plus(
v);
131 SE3 oMi_rot(SE3::Identity());
132 oMi_rot.
rotation() = data_ref.oMi[jointId].rotation();
133 Motion v0(data_ref.oMi[jointId].act(data_ref.v[jointId]));
134 Motion v0_local_world_aligned(oMi_rot.act(data_ref.v[jointId]));
135 Motion v0_local(data_ref.v[jointId]);
136 for (
int k = 0; k <
model.nv; ++k)
141 partial_dv_fd.col(k) =
142 (data_plus.oMi[jointId].act(data_plus.v[jointId]) -
v0).toVector() /
alpha;
143 partial_dv_fd_local_world_aligned.col(k) =
144 (oMi_rot.act(data_plus.v[jointId]) - v0_local_world_aligned).toVector() /
alpha;
145 partial_dv_fd_local.col(k) = (data_plus.v[jointId] - v0_local).toVector() /
alpha;
149 BOOST_CHECK(partial_dv.isApprox(partial_dv_fd, sqrt(
alpha)));
151 partial_dv_local_world_aligned.isApprox(partial_dv_fd_local_world_aligned, sqrt(
alpha)));
152 BOOST_CHECK(partial_dv_local.isApprox(partial_dv_fd_local, sqrt(
alpha)));
155 Eigen::VectorXd q_plus(
q), v_eps(Eigen::VectorXd::Zero(
model.nv));
157 v0 = data_ref.oMi[jointId].act(data_ref.v[jointId]);
159 for (
int k = 0; k <
model.nv; ++k)
165 SE3 oMi_plus_rot = data_plus.oMi[jointId];
168 Motion v_plus_local_world_aligned = oMi_plus_rot.act(data_plus.v[jointId]);
169 SE3::Vector3 trans = data_plus.oMi[jointId].translation() - data_ref.oMi[jointId].translation();
170 v_plus_local_world_aligned.linear() -= v_plus_local_world_aligned.angular().cross(trans);
171 partial_dq_fd.col(k) =
172 (data_plus.oMi[jointId].act(data_plus.v[jointId]) -
v0).toVector() /
alpha;
173 partial_dq_fd_local_world_aligned.col(k) =
174 (v_plus_local_world_aligned - v0_local_world_aligned).toVector() /
alpha;
175 partial_dq_fd_local.col(k) = (data_plus.v[jointId] - v0_local).toVector() /
alpha;
179 BOOST_CHECK(partial_dq.isApprox(partial_dq_fd, sqrt(
alpha)));
181 partial_dq_local_world_aligned.isApprox(partial_dq_fd_local_world_aligned, sqrt(
alpha)));
182 BOOST_CHECK(partial_dq_local.isApprox(partial_dq_fd_local, sqrt(
alpha)));
187 using namespace Eigen;
195 model.lowerPositionLimit.head<3>().
fill(-1.);
196 model.upperPositionLimit.head<3>().
fill(1.);
198 VectorXd
v(VectorXd::Random(
model.nv));
199 VectorXd
a(VectorXd::Random(
model.nv));
204 ?
model.getJointId(
"rarm2_joint")
208 v_partial_dq.setZero();
210 v_partial_dq_local.setZero();
212 v_partial_dq_local_world_aligned.setZero();
214 a_partial_dq.setZero();
216 a_partial_dq_local_world_aligned.setZero();
218 a_partial_dq_local.setZero();
220 a_partial_dv.setZero();
222 a_partial_dv_local_world_aligned.setZero();
224 a_partial_dv_local.setZero();
226 a_partial_da.setZero();
228 a_partial_da_local_world_aligned.setZero();
230 a_partial_da_local.setZero();
233 model,
data, jointId,
WORLD, v_partial_dq, a_partial_dq, a_partial_dv, a_partial_da);
237 a_partial_dq_local_world_aligned, a_partial_dv_local_world_aligned,
238 a_partial_da_local_world_aligned);
241 model,
data, jointId,
LOCAL, v_partial_dq_local, a_partial_dq_local, a_partial_dv_local,
250 v_partial_dq_ref.setZero();
252 v_partial_dq_ref_local_world_aligned.setZero();
254 v_partial_dq_ref_local.setZero();
256 v_partial_dv_ref.setZero();
258 v_partial_dv_ref_local_world_aligned.setZero();
260 v_partial_dv_ref_local.setZero();
264 BOOST_CHECK(v_partial_dq.isApprox(v_partial_dq_ref));
265 BOOST_CHECK(a_partial_da.isApprox(v_partial_dv_ref));
269 v_partial_dv_ref_local_world_aligned);
271 BOOST_CHECK(v_partial_dq_local_world_aligned.isApprox(v_partial_dq_ref_local_world_aligned));
272 BOOST_CHECK(a_partial_da_local_world_aligned.isApprox(v_partial_dv_ref_local_world_aligned));
275 model, data_v, jointId,
LOCAL, v_partial_dq_ref_local, v_partial_dv_ref_local);
277 BOOST_CHECK(v_partial_dq_local.isApprox(v_partial_dq_ref_local));
278 BOOST_CHECK(a_partial_da_local.isApprox(v_partial_dv_ref_local));
284 J_ref_local.setZero();
286 J_ref_local_world_aligned.setZero();
292 BOOST_CHECK(a_partial_da.isApprox(J_ref));
293 BOOST_CHECK(a_partial_da_local_world_aligned.isApprox(J_ref_local_world_aligned));
294 BOOST_CHECK(a_partial_da_local.isApprox(J_ref_local));
298 a_partial_da_fd.setZero();
300 a_partial_da_fd_local_world_aligned.setZero();
302 a_partial_da_fd_local.setZero();
303 const double alpha = 1e-8;
305 Eigen::VectorXd v_plus(
v), a_plus(
a);
308 SE3 oMi_rot(SE3::Identity());
309 oMi_rot.
rotation() = data_ref.oMi[jointId].rotation();
312 Motion a0(data_ref.oMi[jointId].act(data_ref.a[jointId]));
313 Motion a0_local_world_aligned(oMi_rot.act(data_ref.a[jointId]));
314 Motion a0_local(data_ref.a[jointId]);
315 for (
int k = 0; k <
model.nv; ++k)
320 a_partial_da_fd.col(k) =
321 (data_plus.oMi[jointId].act(data_plus.a[jointId]) -
a0).toVector() /
alpha;
322 a_partial_da_fd_local_world_aligned.col(k) =
323 (oMi_rot.act(data_plus.a[jointId]) - a0_local_world_aligned).toVector() /
alpha;
324 a_partial_da_fd_local.col(k) = (data_plus.a[jointId] - a0_local).toVector() /
alpha;
327 BOOST_CHECK(a_partial_da.isApprox(a_partial_da_fd, sqrt(
alpha)));
329 a_partial_da_local_world_aligned.isApprox(a_partial_da_fd_local_world_aligned, sqrt(
alpha)));
330 BOOST_CHECK(a_partial_da_local.isApprox(a_partial_da_fd_local, sqrt(
alpha)));
332 BOOST_CHECK(a_partial_da_local.isApprox(a_partial_da_fd_local, sqrt(
alpha)));
336 a_partial_dv_fd.setZero();
338 a_partial_dv_fd_local_world_aligned.setZero();
340 a_partial_dv_fd_local.setZero();
341 for (
int k = 0; k <
model.nv; ++k)
346 a_partial_dv_fd.col(k) =
347 (data_plus.oMi[jointId].act(data_plus.a[jointId]) -
a0).toVector() /
alpha;
348 a_partial_dv_fd_local_world_aligned.col(k) =
349 (oMi_rot.act(data_plus.a[jointId]) - a0_local_world_aligned).toVector() /
alpha;
350 a_partial_dv_fd_local.col(k) = (data_plus.a[jointId] - a0_local).toVector() /
alpha;
354 BOOST_CHECK(a_partial_dv.isApprox(a_partial_dv_fd, sqrt(
alpha)));
356 a_partial_dv_local_world_aligned.isApprox(a_partial_dv_fd_local_world_aligned, sqrt(
alpha)));
357 BOOST_CHECK(a_partial_dv_local.isApprox(a_partial_dv_fd_local, sqrt(
alpha)));
359 BOOST_CHECK(a_partial_dv_local.isApprox(a_partial_dv_fd_local, sqrt(
alpha)));
362 a_partial_dq.setZero();
363 a_partial_dv.setZero();
364 a_partial_da.setZero();
366 a_partial_dq_local_world_aligned.setZero();
367 a_partial_dv_local_world_aligned.setZero();
368 a_partial_da_local_world_aligned.setZero();
370 a_partial_dq_local.setZero();
371 a_partial_dv_local.setZero();
372 a_partial_da_local.setZero();
375 a_partial_dq_fd.setZero();
377 a_partial_dq_fd_local_world_aligned.setZero();
379 a_partial_dq_fd_local.setZero();
383 model,
data, jointId,
WORLD, v_partial_dq, a_partial_dq, a_partial_dv, a_partial_da);
387 a_partial_dq_local_world_aligned, a_partial_dv_local_world_aligned,
388 a_partial_da_local_world_aligned);
391 model,
data, jointId,
LOCAL, v_partial_dq_local, a_partial_dq_local, a_partial_dv_local,
394 Eigen::VectorXd q_plus(
q), v_eps(Eigen::VectorXd::Zero(
model.nv));
396 a0 = data_ref.oMi[jointId].act(data_ref.a[jointId]);
397 oMi_rot.
rotation() = data_ref.oMi[jointId].rotation();
398 a0_local_world_aligned = oMi_rot.act(data_ref.a[jointId]);
399 a0_local = data_ref.a[jointId];
401 for (
int k = 0; k <
model.nv; ++k)
407 SE3 oMi_plus_rot = data_plus.oMi[jointId];
410 Motion a_plus_local_world_aligned = oMi_plus_rot.act(data_plus.a[jointId]);
412 data_plus.oMi[jointId].translation() - data_ref.oMi[jointId].translation();
413 a_plus_local_world_aligned.linear() -= a_plus_local_world_aligned.angular().cross(trans);
414 a_partial_dq_fd.col(k) =
415 (data_plus.oMi[jointId].act(data_plus.a[jointId]) -
a0).toVector() /
alpha;
416 a_partial_dq_fd_local_world_aligned.col(k) =
417 (a_plus_local_world_aligned - a0_local_world_aligned).toVector() /
alpha;
418 a_partial_dq_fd_local.col(k) = (data_plus.a[jointId] - a0_local).toVector() /
alpha;
422 BOOST_CHECK(a_partial_dq.isApprox(a_partial_dq_fd, sqrt(
alpha)));
424 a_partial_dq_local_world_aligned.isApprox(a_partial_dq_fd_local_world_aligned, sqrt(
alpha)));
425 BOOST_CHECK(a_partial_dq_local.isApprox(a_partial_dq_fd_local, sqrt(
alpha)));
430 using namespace Eigen;
438 model.lowerPositionLimit.head<3>().
fill(-1.);
439 model.upperPositionLimit.head<3>().
fill(1.);
441 VectorXd
v(VectorXd::Random(
model.nv));
442 VectorXd
a(VectorXd::Random(
model.nv));
445 ?
model.getJointId(
"rarm4_joint")
448 v_partial_dq.setZero();
450 v_partial_dq_ref.setZero();
452 v_partial_dv_ref.setZero();
454 a_partial_dq.setZero();
456 a_partial_dv.setZero();
458 a_partial_da.setZero();
493 v_partial_dq.setZero();
494 a_partial_dq.setZero();
495 a_partial_dv.setZero();
496 a_partial_da.setZero();
502 model,
data, jointId,
WORLD, v_partial_dq, a_partial_dq, a_partial_dv, a_partial_da);
506 v_partial_dq_ref.setZero();
507 v_partial_dv_ref.setZero();
509 model, data_ref, jointId,
WORLD, v_partial_dq_ref, v_partial_dv_ref);
510 rhs += v_partial_dq_ref;
511 BOOST_CHECK(a_partial_dv.isApprox(
rhs, 1e-12));
572 const double alpha = 1e-8;
573 Eigen::VectorXd q_plus(
model.nq), v_plus(
model.nv);
583 v_partial_dq_plus.setZero();
585 v_partial_dv_plus.setZero();
587 v_partial_dq_ref.setZero();
588 v_partial_dv_ref.setZero();
590 v_partial_dq.setZero();
591 a_partial_dq.setZero();
592 a_partial_dv.setZero();
593 a_partial_da.setZero();
596 model, data_ref, jointId,
LOCAL, v_partial_dq_ref, v_partial_dv_ref);
598 model, data_plus, jointId,
LOCAL, v_partial_dq_plus, v_partial_dv_plus);
601 model, data_ref, jointId,
LOCAL, v_partial_dq, a_partial_dq, a_partial_dv, a_partial_da);
604 BOOST_CHECK(a_partial_dq.isApprox(
rhs, sqrt(
alpha)));
613 using namespace Eigen;
621 model.lowerPositionLimit.head<3>().
fill(-1.);
622 model.upperPositionLimit.head<3>().
fill(1.);
624 VectorXd
v = VectorXd::Random(
model.nv);
625 VectorXd
a = VectorXd::Random(
model.nv);
628 ?
model.getJointId(
"rarm4_joint")
631 v3_partial_dq.setZero();
633 a3_partial_dq.setZero();
635 a3_partial_dv.setZero();
637 a3_partial_da.setZero();
640 v_partial_dq_ref.setZero();
642 v_partial_dv_ref.setZero();
644 a_partial_dq_ref.setZero();
646 a_partial_dv_ref.setZero();
648 a_partial_da_ref.setZero();
655 model, data_ref,
joint_id,
LOCAL, v_partial_dq_ref, v_partial_dv_ref, a_partial_dq_ref,
656 a_partial_dv_ref, a_partial_da_ref);
662 BOOST_CHECK(v3_partial_dq.isApprox(v_partial_dq_ref.middleRows<3>(Motion::LINEAR)));
663 BOOST_CHECK(a3_partial_dq.isApprox(a_partial_dq_ref.middleRows<3>(Motion::LINEAR)));
664 BOOST_CHECK(a3_partial_dv.isApprox(a_partial_dv_ref.middleRows<3>(Motion::LINEAR)));
665 BOOST_CHECK(a3_partial_da.isApprox(a_partial_da_ref.middleRows<3>(Motion::LINEAR)));
668 v_partial_dq_ref.setZero();
669 v_partial_dv_ref.setZero();
670 a_partial_dq_ref.setZero();
671 a_partial_dv_ref.setZero();
672 a_partial_da_ref.setZero();
675 a_partial_dq_ref, a_partial_dv_ref, a_partial_da_ref);
677 v3_partial_dq.setZero();
678 a3_partial_dq.setZero();
679 a3_partial_dv.setZero();
680 a3_partial_da.setZero();
683 a3_partial_dv, a3_partial_da);
685 BOOST_CHECK(v3_partial_dq.isApprox(v_partial_dq_ref.middleRows<3>(Motion::LINEAR)));
687 BOOST_CHECK(a3_partial_dv.isApprox(a_partial_dv_ref.middleRows<3>(Motion::LINEAR)));
688 BOOST_CHECK(a3_partial_da.isApprox(a_partial_da_ref.middleRows<3>(Motion::LINEAR)));
694 const SE3 iMpoint = SE3::Random();
697 v3_partial_dq.setZero();
698 a3_partial_dq.setZero();
699 a3_partial_dv.setZero();
700 a3_partial_da.setZero();
706 v3_partial_dq_LWA.setZero();
708 a3_partial_dq_LWA.setZero();
710 a3_partial_LWA_dv.setZero();
712 a3_partial_LWA_da.setZero();
716 a3_partial_LWA_dv, a3_partial_LWA_da);
718 const double eps = 1e-8;
719 Eigen::VectorXd v_plus = Eigen::VectorXd::Zero(
model.nv);
741 for (Eigen::DenseIndex k = 0; k <
model.nv; ++k)
747 const SE3 oMpoint_plus = data_plus.oMi[
joint_id] * iMpoint;
755 v3_partial_dq_fd.col(k) = (point_vec_L_plus - point_vec_L) /
eps;
756 a3_partial_dq_fd.col(k) = (point_acc_L_plus - point_acc_L) /
eps;
758 v3_partial_dq_LWA_fd.col(k) = (point_vec_LWA_plus - point_vec_LWA) /
eps;
759 a3_partial_dq_LWA_fd.col(k) = (point_acc_LWA_plus - point_acc_LWA) /
eps;
764 BOOST_CHECK(v3_partial_dq_fd.isApprox(v3_partial_dq, sqrt(
eps)));
765 BOOST_CHECK(a3_partial_dq_fd.isApprox(a3_partial_dq, sqrt(
eps)));
767 BOOST_CHECK(v3_partial_dq_LWA_fd.isApprox(v3_partial_dq_LWA, sqrt(
eps)));
768 BOOST_CHECK(a3_partial_dq_LWA_fd.isApprox(a3_partial_dq_LWA, sqrt(
eps)));
771 for (Eigen::DenseIndex k = 0; k <
model.nv; ++k)
777 const SE3 oMpoint_plus = data_plus.oMi[
joint_id] * iMpoint;
785 v3_partial_dv_fd.col(k) = (point_vec_L_plus - point_vec_L) /
eps;
786 a3_partial_dv_fd.col(k) = (point_acc_L_plus - point_acc_L) /
eps;
788 v3_partial_dv_LWA_fd.col(k) = (point_vec_LWA_plus - point_vec_LWA) /
eps;
789 a3_partial_dv_LWA_fd.col(k) = (point_acc_LWA_plus - point_acc_LWA) /
eps;
792 BOOST_CHECK(v3_partial_dv_fd.isApprox(a3_partial_da, sqrt(
eps)));
793 BOOST_CHECK(a3_partial_dv_fd.isApprox(a3_partial_dv, sqrt(
eps)));
796 Eigen::VectorXd a_plus = Eigen::VectorXd::Zero(
model.nv);
797 for (Eigen::DenseIndex k = 0; k <
model.nv; ++k)
803 const SE3 oMpoint_plus = data_plus.oMi[
joint_id] * iMpoint;
809 a3_partial_da_fd.col(k) = (point_acc_L_plus - point_acc_L) /
eps;
810 a3_partial_da_LWA_fd.col(k) = (point_acc_LWA_plus - point_acc_LWA) /
eps;
813 BOOST_CHECK(a3_partial_da_fd.isApprox(a3_partial_da, sqrt(
eps)));
818 v3_partial_dq_other.setZero();
820 v3_partial_dv_other.setZero();
822 a3_partial_dq_other.setZero();
824 a3_partial_dv_other.setZero();
826 a3_partial_da_other.setZero();
830 model, data_other,
joint_id, iMpoint,
LOCAL, v3_partial_dq_other, v3_partial_dv_other,
831 a3_partial_dq_other, a3_partial_dv_other, a3_partial_da_other);
833 BOOST_CHECK(v3_partial_dq_other.isApprox(v3_partial_dq));
834 BOOST_CHECK(v3_partial_dv_other.isApprox(a3_partial_da));
835 BOOST_CHECK(a3_partial_dq_other.isApprox(a3_partial_dq));
836 BOOST_CHECK(a3_partial_dv_other.isApprox(a3_partial_dv));
837 BOOST_CHECK(a3_partial_da_other.isApprox(a3_partial_da));
842 using namespace Eigen;
850 model.lowerPositionLimit.head<3>().
fill(-1.);
851 model.upperPositionLimit.head<3>().
fill(1.);
853 VectorXd
v = VectorXd::Random(
model.nv);
854 VectorXd
a = VectorXd::Random(
model.nv);
856 const SE3 iMpoint = SE3::Random();
858 ?
model.getJointId(
"rarm4_joint")
861 v3_partial_dq_L.setZero();
863 v3_partial_dv_L.setZero();
870 v_partial_dq_ref_L.setZero();
872 v_partial_dv_ref_L.setZero();
874 a_partial_dq_ref_L.setZero();
876 a_partial_dv_ref_L.setZero();
878 a_partial_da_ref_L.setZero();
883 a_partial_dq_ref_L, a_partial_dv_ref_L, a_partial_da_ref_L);
885 BOOST_CHECK(v3_partial_dq_L.isApprox(v_partial_dq_ref_L));
886 BOOST_CHECK(v3_partial_dv_L.isApprox(v_partial_dv_ref_L));
890 v3_partial_dq_LWA.setZero();
892 v3_partial_dv_LWA.setZero();
898 v_partial_dq_ref_LWA.setZero();
900 v_partial_dv_ref_LWA.setZero();
902 a_partial_dq_ref_LWA.setZero();
904 a_partial_dv_ref_LWA.setZero();
906 a_partial_da_ref_LWA.setZero();
910 v_partial_dv_ref_LWA, a_partial_dq_ref_LWA, a_partial_dv_ref_LWA, a_partial_da_ref_LWA);
912 BOOST_CHECK(v3_partial_dq_LWA.isApprox(v_partial_dq_ref_LWA));
913 BOOST_CHECK(v3_partial_dv_LWA.isApprox(v_partial_dv_ref_LWA));
918 using namespace Eigen;
926 model.lowerPositionLimit.head<3>().
fill(-1.);
927 model.upperPositionLimit.head<3>().
fill(1.);
931 ?
model.getJointId(
"rarm2_joint")
939 BOOST_CHECK(data2.
J.isApprox(
data.J));
941 const Eigen::DenseIndex matrix_offset = 6 *
model.nv;
943 for (
int k = 0; k <
model.nv; ++k)
945 Eigen::Map<Data::Matrix6x> dJ(
data.kinematic_hessians.data() + k * matrix_offset, 6,
model.nv);
946 Eigen::Map<Data::Matrix6x> dJ2(
949 BOOST_CHECK(dJ2.isApprox(dJ));
954 for (
int j =
i; j <
model.nv; ++j)
956 bool j_is_children_of_i =
false;
961 j_is_children_of_i =
true;
966 if (j_is_children_of_i)
970 Eigen::Map<Data::Motion::Vector6> SixSi(
971 data.kinematic_hessians.data() +
i * matrix_offset +
i * 6);
972 BOOST_CHECK(SixSi.isZero());
976 Eigen::Map<Data::Motion::Vector6> SixSj(
977 data.kinematic_hessians.data() +
i * matrix_offset + j * 6);
979 Eigen::Map<Data::Motion::Vector6> SjxSi(
980 data.kinematic_hessians.data() + j * matrix_offset +
i * 6);
982 BOOST_CHECK(SixSj.isApprox(-SjxSi));
987 Eigen::Map<Data::Motion::Vector6> SixSj(
988 data.kinematic_hessians.data() +
i * matrix_offset + j * 6);
990 Eigen::Map<Data::Motion::Vector6> SjxSi(
991 data.kinematic_hessians.data() + j * matrix_offset +
i * 6);
993 BOOST_CHECK(SixSj.isZero());
994 BOOST_CHECK(SjxSi.isZero());
999 const double eps = 1e-8;
1005 VectorXd v_plus(VectorXd::Zero(
model.nv));
1007 const Eigen::DenseIndex outer_offset =
model.nv * 6;
1012 for (Eigen::DenseIndex k = 0; k <
model.nv; ++k)
1021 Eigen::Map<Data::Matrix6x> dJ_dq(
1022 kinematic_hessian_world.
data() + k * outer_offset, 6,
model.nv);
1027 BOOST_CHECK((dJ_dq_ref - dJ_dq).
isZero(sqrt(
eps)));
1037 for (Eigen::DenseIndex k = 0; k <
model.nv; ++k)
1052 Eigen::Map<Data::Matrix6x> dJ_dq(
1053 kinematic_hessian_local_world_aligned.
data() + k * outer_offset, 6,
model.nv);
1058 BOOST_CHECK((dJ_dq_ref - dJ_dq).
isZero(sqrt(
eps)));
1066 BOOST_CHECK(dt_last_fd.isApprox(J_world.topRows<3>(), sqrt(
eps)));
1072 for (Eigen::DenseIndex k = 0; k <
model.nv; ++k)
1083 Eigen::Map<Data::Matrix6x> dJ_dq(
1084 kinematic_hessian_local.
data() + k * outer_offset, 6,
model.nv);
1089 BOOST_CHECK((dJ_dq_ref - dJ_dq).
isZero(sqrt(
eps)));
1094 BOOST_AUTO_TEST_SUITE_END()