wrapped throw StereoCheiralityException inside #ifdef GTSAM_THROW_CHEIRALITY_EXCEPTION
parent
7e44a1776e
commit
7e3aa7aa9a
|
@ -39,7 +39,10 @@ namespace gtsam {
|
||||||
|
|
||||||
const Point3 q = leftCamPose_.transform_to(point);
|
const Point3 q = leftCamPose_.transform_to(point);
|
||||||
|
|
||||||
if ( q.z() <= 0 ) throw StereoCheiralityException();
|
#ifdef GTSAM_THROW_CHEIRALITY_EXCEPTION
|
||||||
|
if (q.z() <= 0)
|
||||||
|
throw StereoCheiralityException();
|
||||||
|
#endif
|
||||||
|
|
||||||
// get calibration
|
// get calibration
|
||||||
const Cal3_S2Stereo& K = *K_;
|
const Cal3_S2Stereo& K = *K_;
|
||||||
|
|
|
@ -104,6 +104,20 @@ TEST( StereoCamera, Dproject)
|
||||||
CHECK(assert_equal(expected2,actual2,1e-7));
|
CHECK(assert_equal(expected2,actual2,1e-7));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ************************************************************************* */
|
||||||
|
TEST( StereoCamera, projectCheirality)
|
||||||
|
{
|
||||||
|
// create a Stereo camera
|
||||||
|
Cal3_S2Stereo::shared_ptr K(new Cal3_S2Stereo(1500, 1500, 0, 320, 240, 0.5));
|
||||||
|
StereoCamera stereoCam(Pose3(), K);
|
||||||
|
|
||||||
|
// point behind the camera
|
||||||
|
Point3 p(0, 0, -5);
|
||||||
|
#ifdef GTSAM_THROW_CHEIRALITY_EXCEPTION
|
||||||
|
CHECK_EXCEPTION(stereoCam.project2(p), StereoCheiralityException);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
TEST( StereoCamera, backproject_case1)
|
TEST( StereoCamera, backproject_case1)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue