diff options
author | Martin Miller | 2017-03-28 09:53:29 -0500 |
---|---|---|
committer | Martin Miller | 2017-03-28 09:53:29 -0500 |
commit | 9533fbcda07254b65a53a9109555662d9a09086c (patch) | |
tree | 7a7c246241ffc856ea47fc6b35f63d2734aa21f0 /src/state.cpp | |
parent | e0734384252675e2a37f4d9287184cc48ab68b05 (diff) | |
download | refslam-9533fbcda07254b65a53a9109555662d9a09086c.zip refslam-9533fbcda07254b65a53a9109555662d9a09086c.tar.gz |
update
Diffstat (limited to 'src/state.cpp')
-rw-r--r-- | src/state.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/state.cpp b/src/state.cpp index c33c053..aee0caa 100644 --- a/src/state.cpp +++ b/src/state.cpp @@ -21,7 +21,7 @@ State::State ( ) { body = new Body; P = Matrix<double,Dynamic,Dynamic>::Zero(9,9); - P.block<3,3>(6,6) = 1e-9*Matrix3d::Identity(); + P.block<3,3>(6,6) = 1e-6*Matrix3d::Identity(); return ; } /* ----- end of method State::State ----- */ @@ -180,7 +180,7 @@ State::kalmanUpdate( const MatrixXd &h, const MatrixXd &S, { MatrixXd K; // P^T is implied here since P is symmetric - K = S.partialPivLu().solve(h*P).transpose(); + K = S.fullPivLu().solve(h*P).transpose(); // Compute P_k|k P = (MatrixXd::Identity(P.rows(),P.rows())-K*h)*P; @@ -269,7 +269,7 @@ State::handle_measurements ( const std::vector<measurement_t> &z, const Quaterni featuresToAdd.push_back(*i); } } - if (featuresToUpdate.size()>0) { + if (featuresToUpdate.size()>1) { #ifdef FULLS MatrixXd h; h = H(q,featuresToUpdate); @@ -289,11 +289,12 @@ void State::addFeatures ( std::vector<measurement_t> &F, const Quaterniond &q) { // Add new features + double z = aboveWater(q); Vector3d pos = body->ned(); for (auto i=F.begin(); i!=F.end(); ++i) { if (features.size()>MAXFEATURES) break; // Create feature - Feature *f = new Feature(i->id, i->source, i->reflection, pos, q); + Feature *f = new Feature(i->id, i->source, i->reflection, pos, q, z); if (!f->sane()) { delete f; continue; |