34 std::cout <<
"l0: " << std::endl;
36 std::cout << std::endl;
39 v << 1.0, 1.0, -0.3, 0.5, 0.2, 0.3;
44 std::cout << std::endl;
45 std::cout <<
"l1: " << std::endl;
50 std::cout << std::endl;
53 std::cout <<
"l2: " << std::endl;
55 std::cout << std::endl;
57 Eigen::Vector4d mv = l2.
ominus(l1);
58 Eigen::Quaterniond q(sqrt(1 - mv.head<3>().squaredNorm()), mv.x(), mv.y(),
60 Eigen::Vector3d euler_angles = q.toRotationMatrix().eulerAngles(2, 1, 0);
61 double yaw = euler_angles[0];
62 double pitch = euler_angles[1];
63 double roll = euler_angles[2];
64 std::cout <<
"l1 ominus l2: " << roll <<
" " << pitch <<
" " << yaw <<
" "
65 << mv[3] << std::endl;
66 std::cout << std::endl;
68 v << 0.0, 0.0, 1.0, 0.5, 0.5, 0.0;
71 std::cout <<
"l1: " << std::endl;
76 std::cout << std::endl;
78 v << 0.0, 0.0, 1.0, 0.5, -0.5, 0.0;
81 std::cout <<
"l2: " << std::endl;
86 std::cout << std::endl;
89 q = Eigen::Quaterniond(sqrt(1 - mv.head<3>().squaredNorm()), mv.x(), mv.y(),
91 euler_angles = q.toRotationMatrix().eulerAngles(2, 1, 0);
92 yaw = euler_angles[0];
93 pitch = euler_angles[1];
94 roll = euler_angles[2];
95 std::cout <<
"l1 ominus l2: " << roll <<
" " << pitch <<
" " << yaw <<
" "
96 << mv[3] << std::endl;
97 std::cout << std::endl;
100 std::cout <<
"l3: " << std::endl;
103 std::cout <<
"l3 oplus mv: " << std::endl;
105 std::cout << std::endl;
107 std::vector<Line3D> l;
108 v << 0.0, 0.0, 1.0, 1.0, 0.0, 0.0;
112 v << 0.0, 0.0, 1.0, 0.0, 1.0, 0.0;
116 v << 0.0, 0.0, 1.0, 0.0, 0.0, 1.0;
121 for (
size_t i = 0; i < l.size(); ++i) {
123 std::cout <<
"line: " << line.
d()[0] <<
" " << line.
d()[1] <<
" "
124 << line.
d()[2] <<
" " << line.
w()[0] <<
" " << line.
w()[1] <<
" "
125 << line.
w()[2] << std::endl;
127 std::cout << std::endl;
129 Eigen::Isometry3d T = Eigen::Isometry3d::Identity();
130 T.translation().x() = 0.9;
131 std::cout <<
"R: " << std::endl << T.linear() << std::endl;
132 std::cout <<
"t: " << std::endl << T.translation() << std::endl;
133 std::cout << std::endl;
135 for (
size_t i = 0; i < l.size(); ++i) {
138 std::cout <<
"line: " << line.
d()[0] <<
" " << line.
d()[1] <<
" "
139 << line.
d()[2] <<
" " << line.
w()[0] <<
" " << line.
w()[1] <<
" "
140 << line.
w()[2] << std::endl;
142 std::cout << std::endl;