Fixing the mag factor tests
parent
df7470866f
commit
a8f942f19d
|
@ -74,7 +74,7 @@ public:
|
|||
*/
|
||||
Vector evaluateError(const Rot2& nRb,
|
||||
boost::optional<Matrix&> H = boost::none) const {
|
||||
// measured bM = nRbÕ * nM + b
|
||||
// measured bM = nRb<EFBFBD> * nM + b
|
||||
Point3 hx = unrotate(nRb, nM_, H) + bias_;
|
||||
return (hx - measured_).vector();
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ public:
|
|||
*/
|
||||
Vector evaluateError(const Rot3& nRb,
|
||||
boost::optional<Matrix&> H = boost::none) const {
|
||||
// measured bM = nRbÕ * nM + b
|
||||
// measured bM = nRb<EFBFBD> * nM + b
|
||||
Point3 hx = nRb.unrotate(nM_, H, boost::none) + bias_;
|
||||
return (hx - measured_).vector();
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ public:
|
|||
Vector evaluateError(const Point3& nM, const Point3& bias,
|
||||
boost::optional<Matrix&> H1 = boost::none, boost::optional<Matrix&> H2 =
|
||||
boost::none) const {
|
||||
// measured bM = nRbÕ * nM + b, where b is unknown bias
|
||||
// measured bM = nRb<EFBFBD> * nM + b, where b is unknown bias
|
||||
Point3 hx = bRn_.rotate(nM, boost::none, H1) + bias;
|
||||
if (H2)
|
||||
*H2 = eye(3);
|
||||
|
@ -189,11 +189,11 @@ public:
|
|||
* @param nM (unknown) local earth magnetic field vector, in nav frame
|
||||
* @param bias (unknown) 3D bias
|
||||
*/
|
||||
Vector evaluateError(double scale, const Unit3& direction,
|
||||
virtual Vector evaluateError(const double& scale, const Unit3& direction,
|
||||
const Point3& bias, boost::optional<Matrix&> H1 = boost::none,
|
||||
boost::optional<Matrix&> H2 = boost::none, boost::optional<Matrix&> H3 =
|
||||
boost::none) const {
|
||||
// measured bM = nRbÕ * nM + b, where b is unknown bias
|
||||
// measured bM = nRb<EFBFBD> * nM + b, where b is unknown bias
|
||||
Unit3 rotated = bRn_.rotate(direction, boost::none, H2);
|
||||
Point3 hx = scale * rotated.point3() + bias;
|
||||
if (H1)
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include <gtsam/navigation/MagFactor.h>
|
||||
#include <gtsam/base/Testable.h>
|
||||
#include <gtsam/base/numericalDerivative.h>
|
||||
#include <gtsam/base/LieScalar.h>
|
||||
|
||||
#include <CppUnitLite/TestHarness.h>
|
||||
|
||||
|
|
Loading…
Reference in New Issue