3 #include <unsupported/Eigen/MatrixFunctions>
11 template class Map<Sophus::Sim3<double>>;
12 template class Map<Sophus::Sim3<double>
const>;
17 template class Sim3<double, Eigen::AutoAlign>;
18 template class Sim3<float, Eigen::DontAlign>;
20 template class Sim3<ceres::Jet<double, 3>>;
23 template <
class Scalar>
127 Eigen::Matrix<Scalar, 7, 1> raw;
130 Eigen::Map<Sim3Type const> map_of_const_sim3(raw.data());
132 raw.template head<4>().eval(),
135 raw.template tail<3>().eval(),
141 Eigen::Map<Sim3Type const> const_shallow_copy = map_of_const_sim3;
143 map_of_const_sim3.quaternion().coeffs().eval());
145 map_of_const_sim3.translation().eval());
147 Eigen::Matrix<Scalar, 7, 1> raw2;
150 Eigen::Map<Sim3Type> map_of_sim3(raw.data());
151 Eigen::Quaternion<Scalar> quat;
152 quat.coeffs() = raw2.template head<4>();
153 map_of_sim3.setQuaternion(quat);
154 map_of_sim3.translation() = raw2.template tail<3>();
156 raw2.template head<4>().eval(),
159 raw2.template tail<3>().eval(),
165 quat.coeffs().data());
166 Eigen::Map<Sim3Type> shallow_copy = map_of_sim3;
168 map_of_sim3.quaternion().coeffs().eval());
170 map_of_sim3.translation().eval());
171 Eigen::Map<Sim3Type>
const const_map_of_sim3 = map_of_sim3;
173 map_of_sim3.quaternion().coeffs().eval());
175 map_of_sim3.translation().eval());
177 Sim3Type const const_sim3(quat, raw2.template tail<3>().eval());
178 for (
int i = 0; i < 7; ++i) {
182 Sim3Type se3(quat, raw2.template tail<3>().eval());
183 for (
int i = 0; i < 7; ++i) {
187 for (
int i = 0; i < 7; ++i) {
195 Eigen::Matrix<Scalar, 4, 4> I = Eigen::Matrix<Scalar, 4, 4>::Identity();
211 sim3.setScale(scale);
215 sim3.setQuaternion(
sim3_vec_[0].rxso3().quaternion());
217 sim3_vec_[0].rxso3().quaternion().coeffs(),
222 std::vector<Sim3Type, Eigen::aligned_allocator<Sim3Type>>
sim3_vec_;
223 std::vector<Tangent, Eigen::aligned_allocator<Tangent>>
tangent_vec_;
224 std::vector<Point, Eigen::aligned_allocator<Point>>
point_vec_;
231 cerr <<
"Test Sim3" << endl << endl;
232 cerr <<
"Double tests: " << endl;
234 cerr <<
"Float tests: " << endl;
238 cerr <<
"ceres::Jet<double, 3> tests: " << endl;