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

[skip ci] working on gtests

parent 6701ddc4
No related branches found
No related tags found
1 merge request!448Draft: Resolve "Implementation of new nodes creation"
Pipeline #12109 skipped
Showing
with 201 additions and 39 deletions
problem:
follow: Poblem.schema
map:
follow: Map.schema
solver:
follow: Solver.schema
sensors:
yaml_type: sequence
mandatory: true
doc: A sequence of all the sensors.
processors:
yaml_type: sequence
mandatory: true
doc: A sequence of all the processors.
type:
mandatory: false
type: string
yaml_type: scalar
default: MapBase
doc: Type of the Map used in the problem.
type:
mandatory: false
type: string
yaml_type: scalar
default: core
doc: Name of the wolf plugin where the map type is implemented.
\ No newline at end of file
tree_manager: problem:
tree_manager:
type: derived
yaml_type: scalar
mandatory: true
doc: Tree manager parameters
frame_structure:
yaml_type: scalar
type: string
mandatory: true
doc: The keys of the default frames in problems
dimension:
yaml_type: scalar
type: int
mandatory: true
options: [2, 3]
doc: Dimension of the problem. '2' for 2D or '3' for 3D
#prior:
map:
type: derived
yaml_type: scalar yaml_type: scalar
type: string mandatory: false
doc: The map used in the wolf problem.
solver:
follow: Solver.schema
sensors:
yaml_type: sequence
type: derived
mandatory: true mandatory: true
doc: Tree manager parameters doc: A sequence of all the sensors.
frame_structure: processors:
yaml_type: scalar yaml_type: sequence
type: string type: derived
mandatory: true
doc: The keys of the default frames in problems
dimension:
yaml_type: scalar
type: int
mandatory: true mandatory: true
options: [2, 3] doc: A sequence of all the processors.
doc: Dimension of the problem: '2' for 2D or '3' for 3D
#prior:
\ No newline at end of file
state_getter:
mandatory: true
yaml_type: scalar
type: bool
doc: If the processor is used by the problem as provider of state.
state_priority:
mandatory: false
yaml_type: scalar
type: double
doc: The priority of this processor when problem gets the state (only used if state_getter = true). Two processors cannot have the same priority (if so, when installing the second is increased).
\ No newline at end of file
...@@ -2,4 +2,35 @@ name: ...@@ -2,4 +2,35 @@ name:
mandatory: true mandatory: true
type: string type: string
yaml_type: scalar yaml_type: scalar
doc: The processor's name. It has to be unique. doc: The processor's name. It has to be unique.
\ No newline at end of file
type:
mandatory: true
type: string
yaml_type: scalar
doc: The processor's class name.
plugin:
mandatory: true
type: string
yaml_type: scalar
doc: The name of the wolf plugin where the processor is implemented.
time_tolerance:
mandatory: true
type: double
yaml_type: scalar
doc: The time tolerance for joining captures into frames [s].
keyframe_vote:
voting_active:
mandatory: true
type: bool
yaml_type: scalar
doc: If the processor is allowed to decide to create a frame.
apply_loss_function:
mandatory: true
type: bool
yaml_type: scalar
doc: If the factors created by the processor have loss function.
\ No newline at end of file
follow: ProcessorBase.schema
follow: MotionProvider.schema
keyframe_vote:
max_time_span:
mandatory: true
yaml_type: scalar
type: double
doc: Time threshold to create a new frame [s].
max_buff_length:
mandatory: true
yaml_type: scalar
type: unsigned int
doc: Maximum size of the buffer of motions.
dist_traveled:
mandatory: true
yaml_type: scalar
type: double
doc: Threshold of distance traveled to create a new frame [m].
angle_turned:
mandatory: true
yaml_type: scalar
type: double
doc: Threshold of angle turned to create a new frame [rad].
unmeasured_perturbation_std:
mandatory: true
yaml_type: scalar
type: double
doc: Noise (standard deviation) of the integrated movement in the not observed directions.
\ No newline at end of file
follow: ProcessorMotion.schema
\ No newline at end of file
follow: ProcessorBase.schema follow: ProcessorBase.schema
min_features_for_keyframe: keyframe_vote:
mandatory: true min_features_for_keyframe:
type: unsigned int mandatory: true
yaml_type: scalar type: unsigned int
doc: Minimum number of features to vote for keyframe. yaml_type: scalar
doc: Minimum number of features to vote for keyframe.
max_new_features: max_new_features:
mandatory: true mandatory: true
......
...@@ -2,4 +2,16 @@ name: ...@@ -2,4 +2,16 @@ name:
mandatory: true mandatory: true
type: string type: string
yaml_type: scalar yaml_type: scalar
doc: The sensor's name. It has to be unique. doc: The sensor's name. It has to be unique.
\ No newline at end of file
type:
mandatory: true
type: string
yaml_type: scalar
doc: The sensor's class name.
plugin:
mandatory: true
type: string
yaml_type: scalar
doc: The name of the wolf plugin where the sensor is implemented.
\ No newline at end of file
follow: SensorBase.schema follow: SensorBase.schema
type:
mandatory: false
type: string
yaml_type: scalar
default: SensorDiffDrive
options: [SensorDiffDrive]
doc: The sensor's class name.
plugin:
mandatory: false
type: string
yaml_type: scalar
default: core
options: [core]
doc: The name of the wolf plugin where the sensor is implemented.
ticks_per_wheel_revolution: ticks_per_wheel_revolution:
mandatory: true mandatory: true
type: double type: double
yaml_type: scalar yaml_type: scalar
doc: ratio of displacement variance to displacement, for odometry noise calculation. doc: ratio of displacement variance to displacement, for odometry noise calculation.
ticks_std_factor: ticks_std_factor:
mandatory: true mandatory: true
type: double type: double
......
follow: SensorBase.schema follow: SensorBase.schema
k_disp_to_disp: k_disp_to_disp:
mandatory: true mandatory: true
type: double type: double
yaml_type: scalar yaml_type: scalar
doc: ratio of displacement variance to displacement, for odometry noise calculation. doc: ratio of displacement variance to displacement, for odometry noise calculation.
k_disp_to_rot: k_disp_to_rot:
mandatory: true mandatory: true
type: double type: double
yaml_type: scalar yaml_type: scalar
doc: ratio of displacement variance to rotation, for odometry noise calculation. doc: ratio of displacement variance to rotation, for odometry noise calculation.
k_rot_to_rot: k_rot_to_rot:
mandatory: true mandatory: true
type: double type: double
yaml_type: scalar yaml_type: scalar
doc: ratio of rotation variance to rotation, for odometry noise calculation. doc: ratio of rotation variance to rotation, for odometry noise calculation.
min_disp_var: min_disp_var:
mandatory: true mandatory: true
type: double type: double
yaml_type: scalar yaml_type: scalar
doc: minimum displacement variance, for odometry noise calculation. doc: minimum displacement variance, for odometry noise calculation.
min_rot_var: min_rot_var:
mandatory: true mandatory: true
type: double type: double
......
follow: SensorBase.schema follow: SensorBase.schema
type:
mandatory: false
type: string
yaml_type: scalar
default: SensorOdom3d
options: [SensorOdom3d]
doc: The sensor's class name.
plugin:
mandatory: false
type: string
yaml_type: scalar
default: core
options: [core]
doc: The name of the wolf plugin where the sensor is implemented.
k_disp_to_disp: k_disp_to_disp:
mandatory: true mandatory: true
type: double type: double
yaml_type: scalar yaml_type: scalar
doc: ratio of displacement variance to displacement, for odometry noise calculation. doc: ratio of displacement variance to displacement, for odometry noise calculation.
k_disp_to_rot: k_disp_to_rot:
mandatory: true mandatory: true
type: double type: double
yaml_type: scalar yaml_type: scalar
doc: ratio of displacement variance to rotation, for odometry noise calculation. doc: ratio of displacement variance to rotation, for odometry noise calculation.
k_rot_to_rot: k_rot_to_rot:
mandatory: true mandatory: true
type: double type: double
yaml_type: scalar yaml_type: scalar
doc: ratio of rotation variance to rotation, for odometry noise calculation. doc: ratio of rotation variance to rotation, for odometry noise calculation.
min_disp_var: min_disp_var:
mandatory: true mandatory: true
type: double type: double
yaml_type: scalar yaml_type: scalar
doc: minimum displacement variance, for odometry noise calculation. doc: minimum displacement variance, for odometry noise calculation.
min_rot_var: min_rot_var:
mandatory: true mandatory: true
type: double type: double
yaml_type: scalar yaml_type: scalar
doc: minimum rotation variance, for odometry noise calculation. doc: minimum rotation variance, for odometry noise calculation.
states: states:
P: P:
follow: PriorP3d.schema follow: PriorP3d.schema
......
...@@ -120,26 +120,33 @@ ProblemPtr Problem::autoSetup(const std::string& _input_yaml_file, const std::ve ...@@ -120,26 +120,33 @@ ProblemPtr Problem::autoSetup(const std::string& _input_yaml_file, const std::ve
schema_folders.push_back(_WOLF_SCHEMAS_DIR); schema_folders.push_back(_WOLF_SCHEMAS_DIR);
// Create yaml server // Create yaml server
WOLF_INFO("Loading yaml file");
auto server = yaml_schema_cpp::YamlServer(schema_folders, _input_yaml_file); auto server = yaml_schema_cpp::YamlServer(schema_folders, _input_yaml_file);
WOLF_INFO("loaded node:\n", server.getNode());
// Validate agains schema files // Validate agains schema files
WOLF_INFO("Applying schema");
if (not server.applySchema("Problem.schema")) if (not server.applySchema("Problem.schema"))
{ {
WOLF_ERROR(server.getLog().str()); WOLF_ERROR(server.getLog().str());
return nullptr; return nullptr;
} }
WOLF_INFO("schema applied");
// Get param node // Get param node
YAML::Node param_node = server.getNode(); YAML::Node param_node = server.getNode();
// PROBLEM =============================================================================== // PROBLEM ===============================================================================
// structure and dimension // structure and dimension
WOLF_INFO("Loading problem parameters");
YAML::Node problem_node = param_node["problem"]; YAML::Node problem_node = param_node["problem"];
std::string frame_structure = problem_node["frame_structure"].as<std::string>(); std::string frame_structure = problem_node["frame_structure"].as<std::string>();
int dim = problem_node["dimension"].as<int>(); int dim = problem_node["dimension"].as<int>();
auto problem = Problem::create(frame_structure, dim, nullptr); auto problem = Problem::create(frame_structure, dim, nullptr);
// Tree manager // Tree manager
WOLF_INFO("Loading tree manager parameters");
YAML::Node tree_manager_node = problem_node["tree_manager"]; YAML::Node tree_manager_node = problem_node["tree_manager"];
std::string tree_manager_type = tree_manager_node["type"].as<std::string>(); std::string tree_manager_type = tree_manager_node["type"].as<std::string>();
problem->setTreeManager(FactoryTreeManager::create(tree_manager_type, tree_manager_node)); problem->setTreeManager(FactoryTreeManager::create(tree_manager_type, tree_manager_node));
...@@ -167,6 +174,7 @@ ProblemPtr Problem::autoSetup(const std::string& _input_yaml_file, const std::ve ...@@ -167,6 +174,7 @@ ProblemPtr Problem::autoSetup(const std::string& _input_yaml_file, const std::ve
// SENSORS =============================================================================== // SENSORS ===============================================================================
// load plugin if sensor is not registered // load plugin if sensor is not registered
WOLF_INFO("Loading sensors parameters");
YAML::Node sensors_node = param_node["sensors"]; YAML::Node sensors_node = param_node["sensors"];
for (auto sensor_n : sensors_node) for (auto sensor_n : sensors_node)
{ {
...@@ -180,6 +188,7 @@ ProblemPtr Problem::autoSetup(const std::string& _input_yaml_file, const std::ve ...@@ -180,6 +188,7 @@ ProblemPtr Problem::autoSetup(const std::string& _input_yaml_file, const std::ve
// PROCESSORS =============================================================================== // PROCESSORS ===============================================================================
// load plugin if processor is not registered // load plugin if processor is not registered
WOLF_INFO("Loading processors parameters");
YAML::Node processors_node = param_node["processors"]; YAML::Node processors_node = param_node["processors"];
for (auto processor_n : processors_node) for (auto processor_n : processors_node)
{ {
...@@ -193,6 +202,7 @@ ProblemPtr Problem::autoSetup(const std::string& _input_yaml_file, const std::ve ...@@ -193,6 +202,7 @@ ProblemPtr Problem::autoSetup(const std::string& _input_yaml_file, const std::ve
// MAP (optional) =============================================================================== // MAP (optional) ===============================================================================
// Default MapBase // Default MapBase
WOLF_INFO("Loading map parameters");
if (not param_node["map"]) if (not param_node["map"])
{ {
param_node["map"]["type"] = "MapBase"; param_node["map"]["type"] = "MapBase";
......
...@@ -38,7 +38,9 @@ struct ParamsProcessorTrackerFeatureDummy : public ParamsProcessorTrackerFeature ...@@ -38,7 +38,9 @@ struct ParamsProcessorTrackerFeatureDummy : public ParamsProcessorTrackerFeature
ParamsProcessorTrackerFeatureDummy(const YAML::Node& _n): ParamsProcessorTrackerFeatureDummy(const YAML::Node& _n):
ParamsProcessorTrackerFeature(_n) ParamsProcessorTrackerFeature(_n)
{ {
WOLF_INFO("ParamsProcessorTrackerFeatureDummy input node:\n", _n);
n_tracks_lost = _n["n_tracks_lost"].as<unsigned int>(); n_tracks_lost = _n["n_tracks_lost"].as<unsigned int>();
WOLF_INFO("ParamsProcessorTrackerFeatureDummy loaded");
} }
}; };
......
...@@ -18,7 +18,7 @@ config: ...@@ -18,7 +18,7 @@ config:
plugin: "core" plugin: "core"
sensors: sensors:
- -
type: "SensorOdom" type: "SensorOdom3d"
name: "odom" name: "odom"
plugin: "core" plugin: "core"
k_disp_to_disp: 0.1 k_disp_to_disp: 0.1
......
...@@ -15,7 +15,7 @@ config: ...@@ -15,7 +15,7 @@ config:
type: "None" type: "None"
sensors: sensors:
- -
type: "SensorOdom" type: "SensorOdom3d"
name: "odom" name: "odom"
plugin: "core" plugin: "core"
k_disp_to_disp: 0.1 k_disp_to_disp: 0.1
......
name: a cool processor odom 3d
time_tolerance: 0.01 # seconds time_tolerance: 0.01 # seconds
keyframe_vote: keyframe_vote:
......
name: cool dummy processor name: cool dummy processor
min_features_for_keyframe: 1 time_tolerance: 0.1
keyframe_vote:
voting_active: true
min_features_for_keyframe: 1
apply_loss_function: false
max_new_features: 0 max_new_features: 0
n_tracks_lost: 1 n_tracks_lost: 1
\ No newline at end of file
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