Skip to content
Snippets Groups Projects
Commit 8ac94b73 authored by Joan Vallvé Navarro's avatar Joan Vallvé Navarro
Browse files

set id and add orientation

parent b4e1a2ba
No related branches found
No related tags found
1 merge request!462Resolve "Subscriber&processor for landmark external detections"
Pipeline #13780 passed
......@@ -151,6 +151,7 @@ FactorBasePtr ProcessorTrackerFeatureLandmarkExternal::emplaceFactor(FeatureBase
"LandmarkRelativePosition2d",
std::make_shared<StatePoint2d>(lmk_p),
nullptr);
lmk->setId(_feature_ptr->landmarkId());
}
// emplace factor
......@@ -178,6 +179,17 @@ FactorBasePtr ProcessorTrackerFeatureLandmarkExternal::emplaceFactor(FeatureBase
"LandmarkRelativePose2d",
std::make_shared<StatePoint2d>(lmk_p),
std::make_shared<StateAngle>(lmk_o));
lmk->setId(_feature_ptr->landmarkId());
}
// no orientation, add it
else if (not lmk->getO())
{
double frm_o = _feature_ptr->getCapture()->getFrame()->getO()->getState()(0);
double sen_o = _feature_ptr->getCapture()->getO()->getState()(0);
double lmk_o = frm_o + sen_o + _feature_ptr->getMeasurement()(2);
lmk->addStateBlock('O', std::make_shared<StateAngle>(lmk_o), getProblem());
}
// emplace factor
......@@ -206,6 +218,7 @@ FactorBasePtr ProcessorTrackerFeatureLandmarkExternal::emplaceFactor(FeatureBase
"LandmarkRelativePosition3d",
std::make_shared<StatePoint3d>(lmk_p),
nullptr);
lmk->setId(_feature_ptr->landmarkId());
}
// emplace factor
......@@ -233,6 +246,17 @@ FactorBasePtr ProcessorTrackerFeatureLandmarkExternal::emplaceFactor(FeatureBase
"LandmarkRelativePose3d",
std::make_shared<StatePoint3d>(lmk_p),
std::make_shared<StateQuaternion>(lmk_o));
lmk->setId(_feature_ptr->landmarkId());
}
// no orientation, add it
else if (not lmk->getO())
{
Quaterniond frm_o = Quaterniond(Vector4d(_feature_ptr->getCapture()->getFrame()->getO()->getState()));
Quaterniond sen_o = Quaterniond(Vector4d(_feature_ptr->getCapture()->getO()->getState()));
Quaterniond lmk_o = frm_o * sen_o * Quaterniond(_feature_ptr->getMeasurement().tail<4>());
lmk->addStateBlock('O', std::make_shared<StateQuaternion>(lmk_o), getProblem());
}
// emplace factor
......
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