summaryrefslogtreecommitdiff
path: root/src/body.cpp
diff options
context:
space:
mode:
authorMartin Miller2017-03-20 11:57:09 -0500
committerMartin Miller2017-03-20 11:57:09 -0500
commit0f25fa35e063d3df3c652153b2d6f1b9f94ce82e (patch)
tree9a8e77093c64a96e355756632ea9dd70c17c98b9 /src/body.cpp
parentc51745a84d6240e68e6a429a8b9c80341a0198d7 (diff)
downloadrefslam-0f25fa35e063d3df3c652153b2d6f1b9f94ce82e.zip
refslam-0f25fa35e063d3df3c652153b2d6f1b9f94ce82e.tar.gz
Fix Jacobian of motion model.
This fixes a bug that was present in the pyslam code. The Jacobian of the motion model needs to be replaced with: F = I + F*dt
Diffstat (limited to 'src/body.cpp')
-rw-r--r--src/body.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/body.cpp b/src/body.cpp
index f27a62f..e6bfb6c 100644
--- a/src/body.cpp
+++ b/src/body.cpp
@@ -105,7 +105,7 @@ Body::Q (double dt)
Q.block<3,3>(0,3) = 0.5*dt*dt*dt*Matrix<double,3,3>::Identity();
Q.block<3,3>(3,3) = dt*dt*Matrix<double,3,3>::Identity();
Q *= 800e-6;
- Q.block<3,3>(6,6) = dt*dt*5e-8*Matrix<double,3,3>::Identity();
+ Q.block<3,3>(6,6) = dt*dt*5e-3*Matrix<double,3,3>::Identity();
return Q;
} /* ----- end of method Body::q ----- */
@@ -149,7 +149,7 @@ Body::h ( )
*--------------------------------------------------------------------------------------
*/
Matrix<double,9,9>
-Body::F ( const Vector3d &ang, const Quaterniond &q )
+Body::F ( const Vector3d &ang, const Quaterniond &q, double dt )
{
Matrix<double,9,9> F = Matrix<double,9,9>::Zero();
Matrix<double,3,3> Rbw(q.toRotationMatrix());
@@ -158,6 +158,8 @@ Body::F ( const Vector3d &ang, const Quaterniond &q )
F.block<3,3>(0,3) = Rbw;
F.block<3,3>(3,3) = -W;
F.block<3,3>(3,6) = -Matrix<double,3,3>::Identity();
+ F *= dt;
+ F += Matrix<double,9,9>::Identity();
return F;
} /* ----- end of method Body::F ----- */