12 bool test2dGeometry() {
16 for (
int i = 0; i < 20; ++i) {
18 Vector2<T> normal_foo = Vector2<T>::Random().normalized();
24 for (
int i = 0; i < 20; ++i) {
27 Line2<T>(Vector2<T>::Random().normalized(), Vector2<T>::Random()));
29 Line2<T> resultPlane_foo =
lineFromSE2(T_foo_plane);
31 resultPlane_foo.normal().eval(), eps);
36 std::vector<SE2<T>, Eigen::aligned_allocator<SE2<T>>> Ts_foo_line =
39 for (SE2<T>
const& T_foo_line : Ts_foo_line) {
44 line2_foo.normal().eval(), eps);
52 bool test3dGeometry() {
56 Vector3<T> normal_foo = Vector3<T>(1, 2, 0).normalized();
63 Matrix3<T> R3_foo_plane =
65 Vector3<T>(T(0), T(1.1), T(0)));
68 normal_foo = Vector3<T>(1, 0, 0);
74 normal_foo = Vector3<T>(0, 1, 0);
80 for (
int i = 0; i < 20; ++i) {
82 Vector3<T> normal_foo = Vector3<T>::Random().normalized();
88 for (
int i = 0; i < 20; ++i) {
91 Plane3<T>(Vector3<T>::Random().normalized(), Vector3<T>::Random()));
95 resultPlane_foo.normal().eval(), eps);
100 std::vector<SE3<T>, Eigen::aligned_allocator<SE3<T>>> Ts_foo_plane =
103 for (SE3<T>
const& T_foo_plane : Ts_foo_plane) {
108 plane2_foo.normal().eval(), eps);
116 std::cerr <<
"Geometry (Lines/Planes) tests:" << std::endl;
117 std::cerr <<
"Double tests: " << std::endl;
118 bool passed = test2dGeometry<double>();
119 passed = test3dGeometry<double>();
121 std::cerr <<
"Float tests: " << std::endl;
122 passed = test2dGeometry<float>();
123 passed = test3dGeometry<float>();
130 int main() { Sophus::runAll(); }