@@ -475,6 +475,82 @@ TEST_CASE("Get body offset" * doctest::description("[fsb_motion][fsb::coord_tran
475475 REQUIRE (tr_b_actual.translation .y == FsbApprox (tr_b.translation .y ));
476476 REQUIRE (tr_b_actual.translation .z == FsbApprox (tr_b.translation .z ));
477477}
478+ //
479+ // TEST_CASE("Apply space offset" * doctest::description("[fsb_motion][fsb::coord_transform_apply_space_offset]"))
480+ // {
481+ // // Inputs
482+ // const fsb::MotionVector offset = {
483+ // {0.075, -0.12, 0.56},
484+ // {-0.982, 1.234, -0.9987}
485+ // };
486+ // const fsb::Transform tr_a = {
487+ // {0.311126983722081, 0.0565685424949238, -0.848528137423857, 0.424264068711929},
488+ // {0.1, -0.22, 3.12}
489+ // };
490+ // // Expected
491+ // const fsb::Transform tr_expected = {
492+ // {0.12879363305026925, 0.27492701003833253, -0.831866064238503, 0.46457097456194846},
493+ // {-1.070731152097746, 0.7774957237582711, 2.0958970058184354}
494+ // };
495+ // // Process
496+ // const fsb::Transform tr_actual = fsb::coord_transform_apply_space_offset(tr_a, offset);
497+ // const fsb::MotionVector offset_actual = fsb::coord_transform_get_space_offset(tr_a, tr_actual);
498+ //
499+ // REQUIRE(fsb::quat_norm(tr_actual.rotation) == FsbApprox(1.0));
500+ // REQUIRE(tr_actual.rotation.qw == FsbApprox(tr_expected.rotation.qw));
501+ // REQUIRE(tr_actual.rotation.qx == FsbApprox(tr_expected.rotation.qx));
502+ // REQUIRE(tr_actual.rotation.qy == FsbApprox(tr_expected.rotation.qy));
503+ // REQUIRE(tr_actual.rotation.qz == FsbApprox(tr_expected.rotation.qz));
504+ //
505+ // REQUIRE(tr_actual.translation.x == FsbApprox(tr_expected.translation.x));
506+ // REQUIRE(tr_actual.translation.y == FsbApprox(tr_expected.translation.y));
507+ // REQUIRE(tr_actual.translation.z == FsbApprox(tr_expected.translation.z));
508+ //
509+ // REQUIRE(offset_actual.angular.x == FsbApprox(offset.angular.x));
510+ // REQUIRE(offset_actual.angular.y == FsbApprox(offset.angular.y));
511+ // REQUIRE(offset_actual.angular.z == FsbApprox(offset.angular.z));
512+ // REQUIRE(offset_actual.linear.x == FsbApprox(offset.linear.x));
513+ // REQUIRE(offset_actual.linear.y == FsbApprox(offset.linear.y));
514+ // REQUIRE(offset_actual.linear.z == FsbApprox(offset.linear.z));
515+ // }
516+ //
517+ // TEST_CASE("Get space offset" * doctest::description("[fsb_motion][fsb::coord_transform_apply_space_offset]"))
518+ // {
519+ // // Inputs
520+ // const fsb::Transform tr_a = {
521+ // {0.311126983722081, 0.0565685424949238, -0.848528137423857, 0.424264068711929},
522+ // {0.1, -0.22, 3.12}
523+ // };
524+ // const fsb::Transform tr_b = {
525+ // {0.12879363305026925, 0.27492701003833253, -0.831866064238503, 0.46457097456194846},
526+ // {-1.070731152097746, 0.7774957237582711, 2.0958970058184354}
527+ // };
528+ // // Expected
529+ // const fsb::MotionVector offset_expected = {
530+ // {0.075, -0.12, 0.56},
531+ // {-0.982, 1.234, -0.9987}
532+ // };
533+ // // Process
534+ // const fsb::MotionVector offset_actual = fsb::coord_transform_get_space_offset(tr_a, tr_b);
535+ // const fsb::Transform tr_b_actual = fsb::coord_transform_apply_space_offset(tr_a, offset_actual);
536+ //
537+ // REQUIRE(offset_actual.angular.x == FsbApprox(offset_expected.angular.x));
538+ // REQUIRE(offset_actual.angular.y == FsbApprox(offset_expected.angular.y));
539+ // REQUIRE(offset_actual.angular.z == FsbApprox(offset_expected.angular.z));
540+ // REQUIRE(offset_actual.linear.x == FsbApprox(offset_expected.linear.x));
541+ // REQUIRE(offset_actual.linear.y == FsbApprox(offset_expected.linear.y));
542+ // REQUIRE(offset_actual.linear.z == FsbApprox(offset_expected.linear.z));
543+ //
544+ // REQUIRE(fsb::quat_norm(tr_b_actual.rotation) == FsbApprox(1.0));
545+ // REQUIRE(tr_b_actual.rotation.qw == FsbApprox(tr_b.rotation.qw));
546+ // REQUIRE(tr_b_actual.rotation.qx == FsbApprox(tr_b.rotation.qx));
547+ // REQUIRE(tr_b_actual.rotation.qy == FsbApprox(tr_b.rotation.qy));
548+ // REQUIRE(tr_b_actual.rotation.qz == FsbApprox(tr_b.rotation.qz));
549+ //
550+ // REQUIRE(tr_b_actual.translation.x == FsbApprox(tr_b.translation.x));
551+ // REQUIRE(tr_b_actual.translation.y == FsbApprox(tr_b.translation.y));
552+ // REQUIRE(tr_b_actual.translation.z == FsbApprox(tr_b.translation.z));
553+ // }
478554
479555// TEST_CASE("Motion body-fixed transform velocity" * doctest::description("[fsb_motion][fsb::motion_transform_body_velocity]"))
480556// {
0 commit comments