From 73b82a00eb2488f11266a3c80cf9940a37ed71b0 Mon Sep 17 00:00:00 2001 From: Luca Carlone Date: Tue, 29 Oct 2013 23:38:31 +0000 Subject: [PATCH] added possibility to disable Cheirality in triangulation.h using cmake flag --- gtsam_unstable/geometry/triangulation.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gtsam_unstable/geometry/triangulation.h b/gtsam_unstable/geometry/triangulation.h index 2145a37fd..311ab9418 100644 --- a/gtsam_unstable/geometry/triangulation.h +++ b/gtsam_unstable/geometry/triangulation.h @@ -184,8 +184,11 @@ Point3 triangulatePoint3(const std::vector& poses, // verify that the triangulated point lies infront of all cameras BOOST_FOREACH(const Pose3& pose, poses) { const Point3& p_local = pose.transform_to(triangulated_point); - if(p_local.z() <= 0) - throw(TriangulationCheiralityException()); + + #ifdef GTSAM_THROW_CHEIRALITY_EXCEPTION + if(p_local.z() <= 0) + throw(TriangulationCheiralityException()); + #endif } return triangulated_point;