No more default argument
parent
be3d39b395
commit
0a6fe0f0a8
|
|
@ -115,7 +115,7 @@ public:
|
||||||
Vector evaluateError(const Point3& point, boost::optional<Matrix&> H2 =
|
Vector evaluateError(const Point3& point, boost::optional<Matrix&> H2 =
|
||||||
boost::none) const {
|
boost::none) const {
|
||||||
try {
|
try {
|
||||||
Point2 error(camera_.project(point, boost::none, H2) - measured_);
|
Point2 error(camera_.project(point, boost::none, H2, boost::none) - measured_);
|
||||||
return error.vector();
|
return error.vector();
|
||||||
} catch (CheiralityException& e) {
|
} catch (CheiralityException& e) {
|
||||||
if (H2)
|
if (H2)
|
||||||
|
|
@ -155,7 +155,7 @@ public:
|
||||||
|
|
||||||
// Would be even better if we could pass blocks to project
|
// Would be even better if we could pass blocks to project
|
||||||
const Point3& point = x.at<Point3>(key());
|
const Point3& point = x.at<Point3>(key());
|
||||||
b = -(camera_.project(point, boost::none, A) - measured_).vector();
|
b = -(camera_.project(point, boost::none, A, boost::none) - measured_).vector();
|
||||||
if (noiseModel_)
|
if (noiseModel_)
|
||||||
this->noiseModel_->WhitenSystem(A, b);
|
this->noiseModel_->WhitenSystem(A, b);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ static Point2 project2(const Pose3& pose, const Point3& point) {
|
||||||
TEST( SimpleCamera, Dproject_point_pose)
|
TEST( SimpleCamera, Dproject_point_pose)
|
||||||
{
|
{
|
||||||
Matrix Dpose, Dpoint;
|
Matrix Dpose, Dpoint;
|
||||||
Point2 result = camera.project(point1, Dpose, Dpoint);
|
Point2 result = camera.project(point1, Dpose, Dpoint, boost::none);
|
||||||
Matrix numerical_pose = numericalDerivative21(project2, pose1, point1);
|
Matrix numerical_pose = numericalDerivative21(project2, pose1, point1);
|
||||||
Matrix numerical_point = numericalDerivative22(project2, pose1, point1);
|
Matrix numerical_point = numericalDerivative22(project2, pose1, point1);
|
||||||
CHECK(assert_equal(result, Point2(-100, 100) ));
|
CHECK(assert_equal(result, Point2(-100, 100) ));
|
||||||
|
|
|
||||||
|
|
@ -132,17 +132,17 @@ namespace gtsam {
|
||||||
if(H1) {
|
if(H1) {
|
||||||
gtsam::Matrix H0;
|
gtsam::Matrix H0;
|
||||||
PinholeCamera<CALIBRATION> camera(pose.compose(*body_P_sensor_, H0), *K_);
|
PinholeCamera<CALIBRATION> camera(pose.compose(*body_P_sensor_, H0), *K_);
|
||||||
Point2 reprojectionError(camera.project(point, H1, H2) - measured_);
|
Point2 reprojectionError(camera.project(point, H1, H2, boost::none) - measured_);
|
||||||
*H1 = *H1 * H0;
|
*H1 = *H1 * H0;
|
||||||
return reprojectionError.vector();
|
return reprojectionError.vector();
|
||||||
} else {
|
} else {
|
||||||
PinholeCamera<CALIBRATION> camera(pose.compose(*body_P_sensor_), *K_);
|
PinholeCamera<CALIBRATION> camera(pose.compose(*body_P_sensor_), *K_);
|
||||||
Point2 reprojectionError(camera.project(point, H1, H2) - measured_);
|
Point2 reprojectionError(camera.project(point, H1, H2, boost::none) - measured_);
|
||||||
return reprojectionError.vector();
|
return reprojectionError.vector();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
PinholeCamera<CALIBRATION> camera(pose, *K_);
|
PinholeCamera<CALIBRATION> camera(pose, *K_);
|
||||||
Point2 reprojectionError(camera.project(point, H1, H2) - measured_);
|
Point2 reprojectionError(camera.project(point, H1, H2, boost::none) - measured_);
|
||||||
return reprojectionError.vector();
|
return reprojectionError.vector();
|
||||||
}
|
}
|
||||||
} catch( CheiralityException& e) {
|
} catch( CheiralityException& e) {
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ public:
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
gtsam::Matrix J2;
|
gtsam::Matrix J2;
|
||||||
gtsam::Point2 uv= camera.project(landmark,H1, J2);
|
gtsam::Point2 uv= camera.project(landmark,H1, J2, boost::none);
|
||||||
if (H1) {
|
if (H1) {
|
||||||
*H1 = (*H1) * gtsam::eye(6);
|
*H1 = (*H1) * gtsam::eye(6);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue