From e0734384252675e2a37f4d9287184cc48ab68b05 Mon Sep 17 00:00:00 2001 From: Martin Miller Date: Mon, 27 Mar 2017 14:23:43 -0500 Subject: EKF is working --- src/body.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/body.cpp') diff --git a/src/body.cpp b/src/body.cpp index e6afe8a..ff54e89 100644 --- a/src/body.cpp +++ b/src/body.cpp @@ -40,7 +40,7 @@ Body::dx ( const Matrix &del ) void Body::vel ( const Matrix &v ) { - X.segment(3,3) = v; + X.segment<3>(3) = v; return ; } /* ----- end of method Body::vel ----- */ @@ -127,7 +127,7 @@ Body::H ( ) { Matrix H; H = Matrix::Zero(); - H[0,2] = 1; + H(2) = 1.; return H ; } /* ----- end of method Body::H ----- */ @@ -192,9 +192,9 @@ Body::motionModel ( const Vector3d &acc, const Vector3d &ang, const Quaterniond Matrix W; W = skewSymmetric(ang); A.block<3,3>(3,0) = -W; - b.segment(3,3) = acc-bias+Rbw.transpose()*gravity_world; + b.segment<3>(3) = acc-bias+Rbw.transpose()*gravity_world; - X.segment(0,6) += (A*X.segment(3,3)+b)*dt; + X.segment<6>(0) += (A*X.segment<3>(3)+b)*dt; return ; } /* ----- end of method Body::motionModel ----- */ @@ -226,7 +226,7 @@ Body::unicsv ( ) void Body::accelerometer_bias ( const Vector3d &b ) { - X.segment(6,3) = b; + X.segment<3>(6) = b; return ; } /* ----- end of method State::accelerometer_bias ----- */ -- cgit v1.1