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

Remove Problem::getMotionProvider()

parent d91e64b5
No related branches found
No related tags found
3 merge requests!436Release to start wolf public,!433After 2nd RA-L submission,!428Resolve "Rename IsMotion --> StateProvider"
This commit is part of merge request !428. Comments created here will be created in the context of that merge request.
......@@ -144,7 +144,7 @@ int main()
// APPLY PRIOR and SET PROCESSOR ODOM ORIGIN ===================================================
TimeStamp t(0.0);
FrameBasePtr KF1 = problem->applyPriorOptions(t);
std::static_pointer_cast<ProcessorMotion>(problem->getMotionProvider())->setOrigin(KF1);
std::static_pointer_cast<ProcessorMotion>(problem->getMotionProviderMap().begin()->second)->setOrigin(KF1);
// SELF CALIBRATION ===================================================
// These few lines control whether we calibrate some sensor parameters or not.
......
......@@ -13,7 +13,7 @@ config:
$sigma:
P: [0.31, 0.31]
O: [0.31]
time_tolerance: 0.1
time_tolerance: 0.5
tree_manager:
type: "none"
......
......@@ -198,7 +198,7 @@ class Problem : public std::enable_shared_from_this<Problem>
void removeMotionProvider(MotionProviderPtr proc);
public:
MotionProviderPtr getMotionProvider();
// MotionProviderPtr getMotionProvider();
std::map<int,MotionProviderPtr>& getMotionProviderMap();
const std::map<int,MotionProviderPtr>& getMotionProviderMap() const;
......@@ -449,12 +449,12 @@ inline bool Problem::isPriorSet() const
return prior_options_ == nullptr;
}
inline MotionProviderPtr Problem::getMotionProvider()
{
if (not motion_provider_map_.empty())
return motion_provider_map_.begin()->second;
return nullptr;
}
//inline MotionProviderPtr Problem::getMotionProvider()
//{
// if (not motion_provider_map_.empty())
// return motion_provider_map_.begin()->second;
// return nullptr;
//}
inline std::map<int,MotionProviderPtr>& Problem::getMotionProviderMap()
{
......
......@@ -85,7 +85,7 @@ TEST(Problem, Processor)
ProblemPtr P = Problem::create("PO", 3);
// check motion processor is null
ASSERT_FALSE(P->getMotionProvider());
ASSERT_TRUE(P->getMotionProviderMap().empty());
// add a motion sensor and processor
auto Sm = SensorBase::emplace<SensorOdom3d>(P->getHardware(), (Eigen::Vector7d()<<0,0,0, 0,0,0,1).finished(), ParamsSensorOdom3d());
......@@ -94,7 +94,7 @@ TEST(Problem, Processor)
auto Pm = ProcessorBase::emplace<ProcessorOdom3d>(Sm, std::make_shared<ParamsProcessorOdom3d>());
// check motion processor IS NOT by emplace
ASSERT_EQ(P->getMotionProvider(), Pm);
ASSERT_EQ(P->getMotionProviderMap().begin()->second, Pm);
}
TEST(Problem, Installers)
......@@ -109,16 +109,16 @@ TEST(Problem, Installers)
auto pt = P->installProcessor("ProcessorTrackerFeatureDummy", "dummy", "odometer");
// check motion processor IS NOT set
ASSERT_FALSE(P->getMotionProvider());
ASSERT_TRUE(P->getMotionProviderMap().empty());
// install processor motion
ProcessorBasePtr pm = P->installProcessor("ProcessorOdom3d", "odom integrator", "odometer", wolf_root + "/test/yaml/processor_odom_3d.yaml");
// check motion processor is set
ASSERT_TRUE(P->getMotionProvider() != nullptr);
ASSERT_FALSE(P->getMotionProviderMap().empty());
// check motion processor is correct
ASSERT_EQ(std::dynamic_pointer_cast<ProcessorMotion>(P->getMotionProvider()), pm);
ASSERT_EQ(std::dynamic_pointer_cast<ProcessorMotion>(P->getMotionProviderMap().begin()->second), pm);
}
TEST(Problem, SetOrigin_PO_2d)
......
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