4 #include <unsupported/Eigen/MatrixFunctions>
10 template class Map<Sophus::SE2<double>>;
11 template class Map<Sophus::SE2<double>
const>;
16 template class SE2<double, Eigen::AutoAlign>;
17 template class SE2<double, Eigen::DontAlign>;
19 template class SE2<ceres::Jet<double, 3>>;
22 template <
class Scalar>
87 Eigen::Matrix<Scalar, 4, 1> raw;
89 Eigen::Map<SE2Type const> const_se2_map(raw.data());
91 raw.template head<2>().eval(),
94 raw.template tail<2>().eval(),
99 Eigen::Map<SE2Type const> const_shallow_copy = const_se2_map;
101 const_se2_map.unit_complex().eval());
103 const_se2_map.translation().eval());
105 Eigen::Matrix<Scalar, 4, 1> raw2;
107 Eigen::Map<SE2Type> map_of_se3(raw.data());
108 map_of_se3.setComplex(raw2.template head<2>());
109 map_of_se3.translation() = raw2.template tail<2>();
111 raw2.template head<2>().eval(),
114 raw2.template tail<2>().eval(),
118 SOPHUS_TEST_NEQ(passed, map_of_se3.unit_complex().data(), raw2.data());
119 Eigen::Map<SE2Type> shallow_copy = map_of_se3;
121 map_of_se3.unit_complex().eval());
123 map_of_se3.translation().eval());
124 Eigen::Map<SE2Type>
const const_map_of_se2 = map_of_se3;
126 map_of_se3.unit_complex().eval());
128 map_of_se3.translation().eval());
130 SE2Type const const_se2(raw2.template head<2>().eval(),
131 raw2.template tail<2>().eval());
132 for (
int i = 0; i < 4; ++i) {
136 SE2Type se2(raw2.template head<2>().eval(), raw2.template tail<2>().eval());
137 for (
int i = 0; i < 4; ++i) {
141 for (
int i = 0; i < 4; ++i) {
159 se2.setRotationMatrix(R.matrix());
190 template <
class S = Scalar>
193 for (
int i = 0; i < 100; ++i) {
204 template <
class S = Scalar>
209 std::vector<SE2Type, Eigen::aligned_allocator<SE2Type>>
se2_vec_;
210 std::vector<Tangent, Eigen::aligned_allocator<Tangent>>
tangent_vec_;
211 std::vector<Point, Eigen::aligned_allocator<Point>>
point_vec_;
218 cerr <<
"Test SE2" << endl << endl;
219 cerr <<
"Double tests: " << endl;
221 cerr <<
"Float tests: " << endl;
225 cerr <<
"ceres::Jet<double, 3> tests: " << endl;