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

Fix some processor pointers in Constraint constructors

parent ac63dbcd
No related branches found
No related tags found
1 merge request!125add processor_ptr_ in ConstraintBase
This commit is part of merge request !125. Comments created here will be created in the context of that merge request.
...@@ -43,7 +43,7 @@ int main() ...@@ -43,7 +43,7 @@ int main()
// PROCESSOR // PROCESSOR
// one-liner API // one-liner API
wolf_problem_ptr_->installProcessor("IMAGE LANDMARK", "ORB", "PinHole", wolf_root + "/src/examples/processor_image_ORB.yaml"); ProcessorBasePtr processor_ptr = wolf_problem_ptr_->installProcessor("IMAGE LANDMARK", "ORB", "PinHole", wolf_root + "/src/examples/processor_image_ORB.yaml");
// create the current frame // create the current frame
...@@ -118,7 +118,7 @@ int main() ...@@ -118,7 +118,7 @@ int main()
// Create the constraint // Create the constraint
ConstraintAHPPtr constraint_ptr = std::make_shared<ConstraintAHP>(feat_point_image_ptr, std::static_pointer_cast<LandmarkAHP>(landmark)); ConstraintAHPPtr constraint_ptr = std::make_shared<ConstraintAHP>(processor_ptr, feat_point_image_ptr, std::static_pointer_cast<LandmarkAHP>(landmark));
feat_point_image_ptr->addConstraint(constraint_ptr); feat_point_image_ptr->addConstraint(constraint_ptr);
std::cout << "Constraint AHP created" << std::endl; std::cout << "Constraint AHP created" << std::endl;
......
...@@ -159,11 +159,11 @@ int main(int argc, char** argv) ...@@ -159,11 +159,11 @@ int main(int argc, char** argv)
std::cout << "Landmark 1: " << lmk_1->point().transpose() << std::endl; std::cout << "Landmark 1: " << lmk_1->point().transpose() << std::endl;
// Constraints------------------ // Constraints------------------
ConstraintAHPPtr ctr_0 = ConstraintAHP::create(feat_0, lmk_1 ); ConstraintAHPPtr ctr_0 = ConstraintAHP::create(nullptr, feat_0, lmk_1 );
feat_0->addConstraint(ctr_0); feat_0->addConstraint(ctr_0);
ConstraintAHPPtr ctr_1 = ConstraintAHP::create(feat_1, lmk_1 ); ConstraintAHPPtr ctr_1 = ConstraintAHP::create(nullptr, feat_1, lmk_1 );
feat_1->addConstraint(ctr_1); feat_1->addConstraint(ctr_1);
ConstraintAHPPtr ctr_2 = ConstraintAHP::create(feat_2, lmk_1 ); ConstraintAHPPtr ctr_2 = ConstraintAHP::create(nullptr, feat_2, lmk_1 );
feat_2->addConstraint(ctr_2); feat_2->addConstraint(ctr_2);
// Projections---------------------------- // Projections----------------------------
...@@ -210,9 +210,9 @@ int main(int argc, char** argv) ...@@ -210,9 +210,9 @@ int main(int argc, char** argv)
std::cout << "Landmark 2: " << lmk_2->point().transpose() << std::endl; std::cout << "Landmark 2: " << lmk_2->point().transpose() << std::endl;
// New constraints from kf3 and kf4 // New constraints from kf3 and kf4
ConstraintAHPPtr ctr_3 = ConstraintAHP::create(feat_3, lmk_2 ); ConstraintAHPPtr ctr_3 = ConstraintAHP::create(nullptr, feat_3, lmk_2 );
feat_3->addConstraint(ctr_3); feat_3->addConstraint(ctr_3);
ConstraintAHPPtr ctr_4 = ConstraintAHP::create(feat_4, lmk_2 ); ConstraintAHPPtr ctr_4 = ConstraintAHP::create(nullptr, feat_4, lmk_2 );
feat_4->addConstraint(ctr_4); feat_4->addConstraint(ctr_4);
Eigen::Vector2s pix_3 = ctr_3->expectation(); Eigen::Vector2s pix_3 = ctr_3->expectation();
......
...@@ -185,7 +185,7 @@ inline bool ProcessorImageFeature::voteForKeyFrame() ...@@ -185,7 +185,7 @@ inline bool ProcessorImageFeature::voteForKeyFrame()
inline ConstraintBasePtr ProcessorImageFeature::createConstraint(FeatureBasePtr _feature_ptr, FeatureBasePtr _feature_other_ptr) inline ConstraintBasePtr ProcessorImageFeature::createConstraint(FeatureBasePtr _feature_ptr, FeatureBasePtr _feature_other_ptr)
{ {
ConstraintEpipolarPtr const_epipolar_ptr = std::make_shared<ConstraintEpipolar>(_feature_ptr, _feature_other_ptr); ConstraintEpipolarPtr const_epipolar_ptr = std::make_shared<ConstraintEpipolar>(shared_from_this(), _feature_ptr, _feature_other_ptr);
// _feature_ptr->addConstraint(const_epipolar_ptr); // _feature_ptr->addConstraint(const_epipolar_ptr);
// _feature_other_ptr->addConstrainedBy(const_epipolar_ptr); // _feature_other_ptr->addConstrainedBy(const_epipolar_ptr);
return const_epipolar_ptr; return const_epipolar_ptr;
......
...@@ -292,7 +292,7 @@ ConstraintBasePtr ProcessorImageLandmark::createConstraint(FeatureBasePtr _featu ...@@ -292,7 +292,7 @@ ConstraintBasePtr ProcessorImageLandmark::createConstraint(FeatureBasePtr _featu
LandmarkAHPPtr landmark_ahp = std::static_pointer_cast<LandmarkAHP>(_landmark_ptr); LandmarkAHPPtr landmark_ahp = std::static_pointer_cast<LandmarkAHP>(_landmark_ptr);
ConstraintAHPPtr constraint_ptr = ConstraintAHP::create(_feature_ptr, landmark_ahp, true); ConstraintAHPPtr constraint_ptr = ConstraintAHP::create(shared_from_this(), _feature_ptr, landmark_ahp, true);
return constraint_ptr; return constraint_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