Skip to content
Snippets Groups Projects
Commit 342db765 authored by Joan Solà Ortega's avatar Joan Solà Ortega
Browse files

Merge branch '30-multiple-processors-per-sensor-2' into 'devel'

Resolve "multiple processors per sensor"

Closes #30

See merge request !43
parents 356531e2 f1f49804
No related branches found
No related tags found
2 merge requests!44Devel,!43Resolve "multiple processors per sensor"
...@@ -434,7 +434,7 @@ void ProcessorVisualOdometry::establishFactors() ...@@ -434,7 +434,7 @@ void ProcessorVisualOdometry::establishFactors()
LandmarkBasePtr associated_lmk = nullptr; LandmarkBasePtr associated_lmk = nullptr;
for (auto lmk: getProblem()->getMap()->getLandmarkList()) for (auto lmk: getProblem()->getMap()->getLandmarkList())
{ {
if (lmk->id() == feat_pi->trackId()){ if (lmk->trackId() == feat_pi->trackId()){
associated_lmk = lmk; associated_lmk = lmk;
} }
} }
...@@ -444,11 +444,14 @@ void ProcessorVisualOdometry::establishFactors() ...@@ -444,11 +444,14 @@ void ProcessorVisualOdometry::establishFactors()
if (associated_lmk) if (associated_lmk)
{ {
LandmarkHpPtr associated_lmk_hp = std::dynamic_pointer_cast<LandmarkHp>(associated_lmk); LandmarkHpPtr associated_lmk_hp = std::dynamic_pointer_cast<LandmarkHp>(associated_lmk);
FactorBase::emplace<FactorPixelHp>(feat_pi,
feat_pi, if (associated_lmk_hp) {
associated_lmk_hp, FactorBase::emplace<FactorPixelHp>(feat_pi,
shared_from_this(), feat_pi,
params_visual_odometry_->apply_loss_function); associated_lmk_hp,
shared_from_this(),
params_visual_odometry_->apply_loss_function);
}
} }
// 2) create landmark if track is not associated with one and has enough length // 2) create landmark if track is not associated with one and has enough length
...@@ -456,7 +459,6 @@ void ProcessorVisualOdometry::establishFactors() ...@@ -456,7 +459,6 @@ void ProcessorVisualOdometry::establishFactors()
{ {
// std::cout << "NEW valid track \\o/" << std::endl; // std::cout << "NEW valid track \\o/" << std::endl;
LandmarkBasePtr lmk = emplaceLandmark(feat_pi); LandmarkBasePtr lmk = emplaceLandmark(feat_pi);
lmk->setId(feat_pi->trackId());
// Add factors from all KFs of this track to the new lmk // Add factors from all KFs of this track to the new lmk
Track track_kf = track_matrix_.trackAtKeyframes(feat->trackId()); Track track_kf = track_matrix_.trackAtKeyframes(feat->trackId());
...@@ -513,8 +515,8 @@ LandmarkBasePtr ProcessorVisualOdometry::emplaceLandmark(FeatureBasePtr _feat) ...@@ -513,8 +515,8 @@ LandmarkBasePtr ProcessorVisualOdometry::emplaceLandmark(FeatureBasePtr _feat)
// Set all IDs equal to track ID // Set all IDs equal to track ID
size_t track_id = _feat->trackId(); size_t track_id = _feat->trackId();
lmk_hp_ptr->setId(track_id); lmk_hp_ptr->setTrackId(track_id);
_feat->setLandmarkId(track_id); _feat->setLandmarkId(lmk_hp_ptr->id());
return lmk_hp_ptr; return lmk_hp_ptr;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment