8 namespace experimental {
10 template <
class Scalar>
13 std::vector<SE3<Scalar>, Eigen::aligned_allocator<SE3<Scalar>>> bar_Ts_baz;
15 for (
size_t i = 0; i < 10; ++i) {
24 std::vector<SE3<Scalar>, Eigen::aligned_allocator<SE3<Scalar>>> foo_Ts_baz;
25 for (
auto const& bar_T_baz : bar_Ts_baz) {
26 foo_Ts_baz.push_back(foo_T_bar * bar_T_baz);
29 auto gen_linear_vels =
30 [](std::vector<SE3<Scalar>, Eigen::aligned_allocator<SE3<Scalar>>>
const&
32 std::vector<Vector3<Scalar>, Eigen::aligned_allocator<Vector3<Scalar>>>
34 for (
size_t i = 0; i < a_Ts_b.size() - 1; ++i) {
35 linearVels_a.push_back(a_Ts_b[i + 1].translation() -
36 a_Ts_b[i].translation());
42 std::vector<Vector3<Scalar>, Eigen::aligned_allocator<Vector3<Scalar>>>
43 linearVels_bar = gen_linear_vels(bar_Ts_baz);
45 std::vector<Vector3<Scalar>, Eigen::aligned_allocator<Vector3<Scalar>>>
46 linearVels_foo = gen_linear_vels(foo_Ts_baz);
48 for (
size_t i = 0; i < linearVels_bar.size(); ++i) {
56 template <
class Scalar>
70 std::vector<Scalar> ts = {Scalar(0), Scalar(0.3), Scalar(1)};
76 finiteDifferenceRotationalVelocity<Scalar>(bar_T_baz, t, h);
80 finiteDifferenceRotationalVelocity<Scalar>(
82 return foo_T_bar * bar_T_baz(t);
89 passed, rotVel_in_frame_bar, rotVel_in_frame_bar2,
104 foo_T_bar.
so3().matrix()),
114 cerr <<
"Test Velocities" << endl << endl;
115 cerr <<
"Double tests: " << endl;
116 bool passed = tests_linear_velocities<double>();
117 passed &= tests_rotational_velocities<double>();
120 cerr <<
"Float tests: " << endl;
121 passed = tests_linear_velocities<float>();
122 passed &= tests_rotational_velocities<float>();