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

fixed tests

parent 6712cf00
No related branches found
No related tags found
1 merge request!448Draft: Resolve "Implementation of new nodes creation"
Pipeline #21203 failed
...@@ -32,6 +32,7 @@ class ProcessorTrackerFeatureDummy : public ProcessorTrackerFeature ...@@ -32,6 +32,7 @@ class ProcessorTrackerFeatureDummy : public ProcessorTrackerFeature
{ {
protected: protected:
unsigned int n_tracks_lost_; ///< number of tracks lost each time track is called (the first ones) unsigned int n_tracks_lost_; ///< number of tracks lost each time track is called (the first ones)
unsigned int dim_; ///< dimension of the problem
public: public:
ProcessorTrackerFeatureDummy(const YAML::Node& _params); ProcessorTrackerFeatureDummy(const YAML::Node& _params);
...@@ -40,7 +41,7 @@ class ProcessorTrackerFeatureDummy : public ProcessorTrackerFeature ...@@ -40,7 +41,7 @@ class ProcessorTrackerFeatureDummy : public ProcessorTrackerFeature
// Factory method for high level API // Factory method for high level API
WOLF_PROCESSOR_CREATE(ProcessorTrackerFeatureDummy); WOLF_PROCESSOR_CREATE(ProcessorTrackerFeatureDummy);
void configure(SensorBasePtr _sensor) override{}; void configure(SensorBasePtr _sensor) override {};
/** \brief Track provided features in \b _capture /** \brief Track provided features in \b _capture
* \param _features_in input list of features in \b last to track * \param _features_in input list of features in \b last to track
...@@ -166,8 +167,12 @@ class ProcessorTrackerFeatureDummy : public ProcessorTrackerFeature ...@@ -166,8 +167,12 @@ class ProcessorTrackerFeatureDummy : public ProcessorTrackerFeature
}; };
inline ProcessorTrackerFeatureDummy::ProcessorTrackerFeatureDummy(const YAML::Node& _params) inline ProcessorTrackerFeatureDummy::ProcessorTrackerFeatureDummy(const YAML::Node& _params)
: ProcessorTrackerFeature("ProcessorTrackerFeatureDummy", {{'P', "StatePoint2d"}, {'O', "StateAngle"}}, _params), : ProcessorTrackerFeature("ProcessorTrackerFeatureDummy",
n_tracks_lost_(_params["n_tracks_lost"].as<unsigned int>()) {{'P', _params["dimension"].as<unsigned int>() == 2 ? "StatePoint2d" : "StatePoint3d"},
{'O', _params["dimension"].as<unsigned int>() == 2 ? "StateAngle" : "StateQuaternion"}},
_params),
n_tracks_lost_(_params["n_tracks_lost"].as<unsigned int>()),
dim_(_params["dimension"].as<unsigned int>())
{ {
// //
} }
......
...@@ -2,4 +2,9 @@ follow: ProcessorTrackerFeature.schema ...@@ -2,4 +2,9 @@ follow: ProcessorTrackerFeature.schema
n_tracks_lost: n_tracks_lost:
_mandatory: true _mandatory: true
_type: unsigned int _type: unsigned int
_doc: dummy parameter. _doc: dummy parameter.
\ No newline at end of file dimension:
_mandatory: true
_type: unsigned int
_doc: dimension of the problem representation.
_options: [2, 3]
\ No newline at end of file
...@@ -69,7 +69,7 @@ TEST(Problem, Installers) ...@@ -69,7 +69,7 @@ TEST(Problem, Installers)
SensorBasePtr S = P->installSensor(wolf_dir + "/test/yaml/sensor_odom_3d.yaml", {wolf_dir}); SensorBasePtr S = P->installSensor(wolf_dir + "/test/yaml/sensor_odom_3d.yaml", {wolf_dir});
// install processor tracker (dummy installation under an Odometry sensor -- it's OK for this test) // install processor tracker (dummy installation under an Odometry sensor -- it's OK for this test)
auto pt = P->installProcessor(S, wolf_dir + "/test/yaml/processor_tracker_feature_dummy.yaml", {wolf_dir}); auto pt = P->installProcessor(S, wolf_dir + "/test/yaml/processor_tracker_feature_dummy_3d.yaml", {wolf_dir});
// check motion processor IS NOT set // check motion processor IS NOT set
ASSERT_TRUE(P->getMotionProviderMap().empty()); ASSERT_TRUE(P->getMotionProviderMap().empty());
...@@ -252,7 +252,7 @@ TEST(Problem, StateBlocks) ...@@ -252,7 +252,7 @@ TEST(Problem, StateBlocks)
SensorBasePtr Sm = P->installSensor(wolf_dir + "/test/yaml/sensor_odom_3d.yaml", {wolf_dir}); SensorBasePtr Sm = P->installSensor(wolf_dir + "/test/yaml/sensor_odom_3d.yaml", {wolf_dir});
ASSERT_EQ(P->getStateBlockNotificationMapSize(), (SizeStd)2); ASSERT_EQ(P->getStateBlockNotificationMapSize(), (SizeStd)2);
auto pt = P->installProcessor(Sm, wolf_dir + "/test/yaml/processor_tracker_feature_dummy.yaml", {wolf_dir}); auto pt = P->installProcessor(Sm, wolf_dir + "/test/yaml/processor_tracker_feature_dummy_3d.yaml", {wolf_dir});
auto pm = P->installProcessor(Sm, wolf_dir + "/test/yaml/processor_odom_3d.yaml", {wolf_dir}); auto pm = P->installProcessor(Sm, wolf_dir + "/test/yaml/processor_odom_3d.yaml", {wolf_dir});
// 2 state blocks, estimated // 2 state blocks, estimated
...@@ -310,7 +310,7 @@ TEST(Problem, Covariances) ...@@ -310,7 +310,7 @@ TEST(Problem, Covariances)
SensorBasePtr Sm = P->installSensor(wolf_dir + "/test/yaml/sensor_odom_3d.yaml", {wolf_dir}); SensorBasePtr Sm = P->installSensor(wolf_dir + "/test/yaml/sensor_odom_3d.yaml", {wolf_dir});
SensorBasePtr St = P->installSensor(wolf_dir + "/test/yaml/sensor_odom_3d_other.yaml", {wolf_dir}); SensorBasePtr St = P->installSensor(wolf_dir + "/test/yaml/sensor_odom_3d_other.yaml", {wolf_dir});
auto pt = P->installProcessor(Sm, wolf_dir + "/test/yaml/processor_tracker_feature_dummy.yaml", {wolf_dir}); auto pt = P->installProcessor(Sm, wolf_dir + "/test/yaml/processor_tracker_feature_dummy_3d.yaml", {wolf_dir});
auto pm = P->installProcessor(St, wolf_dir + "/test/yaml/processor_odom_3d.yaml", {wolf_dir}); auto pm = P->installProcessor(St, wolf_dir + "/test/yaml/processor_odom_3d.yaml", {wolf_dir});
// 4 state blocks, estimated // 4 state blocks, estimated
...@@ -758,6 +758,6 @@ TEST(Problem, transform) ...@@ -758,6 +758,6 @@ TEST(Problem, transform)
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
testing::InitGoogleTest(&argc, argv); testing::InitGoogleTest(&argc, argv);
// testing::GTEST_FLAG(filter) = "Problem.autoSetupNoMap"; // testing::GTEST_FLAG(filter) = "Problem.Installers";
return RUN_ALL_TESTS(); return RUN_ALL_TESTS();
} }
...@@ -47,7 +47,7 @@ TEST(ProcessorBase, MotionProvider) ...@@ -47,7 +47,7 @@ TEST(ProcessorBase, MotionProvider)
// Install tracker (sensor and processor) // Install tracker (sensor and processor)
auto sens_trk = problem->installSensor(wolf_dir + "/test/yaml/sensor_dummy_2d.yaml", {wolf_dir}); auto sens_trk = problem->installSensor(wolf_dir + "/test/yaml/sensor_dummy_2d.yaml", {wolf_dir});
auto proc_trk = auto proc_trk =
problem->installProcessor(sens_trk, wolf_dir + "/test/yaml/processor_tracker_feature_dummy.yaml", {wolf_dir}); problem->installProcessor(sens_trk, wolf_dir + "/test/yaml/processor_tracker_feature_dummy_2d.yaml", {wolf_dir});
// Install odometer (sensor and processor) // Install odometer (sensor and processor)
auto sens_odo = problem->installSensor(wolf_dir + "/test/yaml/sensor_odom_2d.yaml", {wolf_dir}); auto sens_odo = problem->installSensor(wolf_dir + "/test/yaml/sensor_odom_2d.yaml", {wolf_dir});
...@@ -67,7 +67,7 @@ TEST(ProcessorBase, KeyFrameCallback) ...@@ -67,7 +67,7 @@ TEST(ProcessorBase, KeyFrameCallback)
// Install tracker (sensor and processor) // Install tracker (sensor and processor)
auto sens_trk = problem->installSensor(wolf_dir + "/test/yaml/sensor_dummy_2d.yaml", {wolf_dir}); auto sens_trk = problem->installSensor(wolf_dir + "/test/yaml/sensor_dummy_2d.yaml", {wolf_dir});
auto proc_trk = auto proc_trk =
problem->installProcessor(sens_trk, wolf_dir + "/test/yaml/processor_tracker_feature_dummy.yaml", {wolf_dir}); problem->installProcessor(sens_trk, wolf_dir + "/test/yaml/processor_tracker_feature_dummy_2d.yaml", {wolf_dir});
proc_trk->setVotingActive(false); proc_trk->setVotingActive(false);
// Install odometer (sensor and processor) // Install odometer (sensor and processor)
......
...@@ -48,7 +48,7 @@ class ProcessorTrackerFeatureDummyTest : public testing::Test ...@@ -48,7 +48,7 @@ class ProcessorTrackerFeatureDummyTest : public testing::Test
// Install processor // Install processor
processor = std::static_pointer_cast<ProcessorTrackerFeatureDummy>(problem->installProcessor( processor = std::static_pointer_cast<ProcessorTrackerFeatureDummy>(problem->installProcessor(
sensor, wolf_dir + "/test/yaml/processor_tracker_feature_dummy.yaml", {wolf_dir})); sensor, wolf_dir + "/test/yaml/processor_tracker_feature_dummy_2d.yaml", {wolf_dir}));
} }
}; };
......
...@@ -3,6 +3,7 @@ type: ProcessorTrackerFeatureDummy ...@@ -3,6 +3,7 @@ type: ProcessorTrackerFeatureDummy
plugin: core plugin: core
sensor_name: whatever sensor_name: whatever
dimension: 2
time_tolerance: 0.25 time_tolerance: 0.25
keyframe_vote: keyframe_vote:
voting_active: true voting_active: true
......
name: cool dummy processor
type: ProcessorTrackerFeatureDummy
plugin: core
sensor_name: whatever
dimension: 3
time_tolerance: 0.25
keyframe_vote:
voting_active: true
min_features_for_keyframe: 7
apply_loss_function: false
max_new_features: 10
n_tracks_lost: 1
\ No newline at end of file
...@@ -3,6 +3,7 @@ type: ProcessorTrackerFeatureDummy ...@@ -3,6 +3,7 @@ type: ProcessorTrackerFeatureDummy
plugin: core plugin: core
sensor_name: whatever sensor_name: whatever
dimension: 2
time_tolerance: 0.5 time_tolerance: 0.5
keyframe_vote: keyframe_vote:
voting_active: true voting_active: true
......
...@@ -3,6 +3,7 @@ type: ProcessorTrackerFeatureDummy ...@@ -3,6 +3,7 @@ type: ProcessorTrackerFeatureDummy
plugin: core plugin: core
sensor_name: whatever sensor_name: whatever
dimension: 2
time_tolerance: 0.5 time_tolerance: 0.5
keyframe_vote: keyframe_vote:
voting_active: true voting_active: true
......
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