Fixed evaluateError signature (double -> const double&)

release/4.3a0
dellaert 2014-11-22 22:31:28 +01:00
parent ab08cb65b0
commit db3126cd14
2 changed files with 3 additions and 3 deletions

View File

@ -189,7 +189,7 @@ public:
* @param nM (unknown) local earth magnetic field vector, in nav frame * @param nM (unknown) local earth magnetic field vector, in nav frame
* @param bias (unknown) 3D bias * @param bias (unknown) 3D bias
*/ */
Vector evaluateError(double scale, const Unit3& direction, Vector evaluateError(const double& scale, const Unit3& direction,
const Point3& bias, boost::optional<Matrix&> H1 = boost::none, const Point3& bias, boost::optional<Matrix&> H1 = boost::none,
boost::optional<Matrix&> H2 = boost::none, boost::optional<Matrix&> H3 = boost::optional<Matrix&> H2 = boost::none, boost::optional<Matrix&> H3 =
boost::none) const { boost::none) const {

View File

@ -48,7 +48,7 @@ Point3 bias(10, -10, 50);
Point3 scaled = scale * nM; Point3 scaled = scale * nM;
Point3 measured = nRb.inverse() * (scale * nM) + bias; Point3 measured = nRb.inverse() * (scale * nM) + bias;
LieScalar s(scale * nM.norm()); double s(scale * nM.norm());
Unit3 dir(nM); Unit3 dir(nM);
SharedNoiseModel model = noiseModel::Isotropic::Sigma(3, 0.25); SharedNoiseModel model = noiseModel::Isotropic::Sigma(3, 0.25);
@ -94,7 +94,7 @@ TEST( MagFactor, Factors ) {
// MagFactor2 // MagFactor2
MagFactor3 f3(1, 2, 3, measured, nRb, model); MagFactor3 f3(1, 2, 3, measured, nRb, model);
EXPECT(assert_equal(zero(3),f3.evaluateError(s,dir,bias,H1,H2,H3),1e-5)); EXPECT(assert_equal(zero(3),f3.evaluateError(s,dir,bias,H1,H2,H3),1e-5));
EXPECT(assert_equal(numericalDerivative11<Vector,LieScalar> // EXPECT(assert_equal(numericalDerivative11<Vector,double> //
(boost::bind(&MagFactor3::evaluateError, &f3, _1, dir, bias, none, none, none), s),// (boost::bind(&MagFactor3::evaluateError, &f3, _1, dir, bias, none, none, none), s),//
H1, 1e-7)); H1, 1e-7));
EXPECT(assert_equal(numericalDerivative11<Vector,Unit3> // EXPECT(assert_equal(numericalDerivative11<Vector,Unit3> //