diff --git a/hello_wolf/hello_wolf_config.yaml b/hello_wolf/hello_wolf_config.yaml index 13472f71bde49c1e5f46272ea248274f8e77a4aa..be03ef1618d7a622b07d2740b76b091d349be02b 100644 --- a/hello_wolf/hello_wolf_config.yaml +++ b/hello_wolf/hello_wolf_config.yaml @@ -1,45 +1,54 @@ config: problem: - frame structure: "PO" + frame_structure: "PO" dimension: 2 - prior timestamp: 0.0 - prior state: [0,0,0] - prior cov: [[3,3],.01,0,0,0,.01,0,0,0,.01] - prior time tolerance: 0.1 + prior: + timestamp: 0.0 + state: [0,0,0] + cov: [[3,3],.01,0,0,0,.01,0,0,0,.01] + time_tolerance: 0.1 - sensors: - type: "ODOM 2D" name: "odom" + k_disp_to_disp: 0.1 + k_rot_to_rot: 0.1 + extrinsic: + pose: [0,0,0] - type: "RANGE BEARING" name: "rb" - noise range metres std: 0.1 - noise bearing degrees std: 0.5 - + noise_range_metres_std: 0.1 + noise_bearing_degrees_std: 0.5 + processors: - type: "ODOM 2D" name: "odom" - sensor name: "odom" - voting active: true - time tolerance: 0.1 - max time span: 999 + sensor_name: "odom" + voting_active: true + voting_aux_active: false + time_tolerance: 0.1 + max_time_span: 999 dist_traveled: 0.95 angle_turned: 999 - cov_det: 999 + max_buff_length: 999 unmeasured_perturbation_std: 0.001 + cov_det: 999 - type: "RANGE BEARING" name: "rb" - sensor name: "rb" + sensor_name: "rb" + voting_active: false + voting_aux_active: false + time_tolerance: 0.1 files: -# - "/Users/jsola/dev/wolf_lib/core/lib/libhellowolf.dylib" +# - "/Users/jsola/dev/wolf lib/core/lib/libhellowolf.dylib" \ No newline at end of file diff --git a/include/core/yaml/parser_yaml.hpp b/include/core/yaml/parser_yaml.hpp index 3af5c1630da3e1bbeba9ec0ec4c6cc8ab5c63cfb..837d47ddabe2c52a88720ce2dd8570d2091b8e42 100644 --- a/include/core/yaml/parser_yaml.hpp +++ b/include/core/yaml/parser_yaml.hpp @@ -297,7 +297,7 @@ void ParserYAML::parseFirstLevel(std::string file){ _paramsSens.push_back(pSensor); } for(const auto& kv : n_config["processors"]){ - ParamsInitProcessor pProc = {kv["type"].Scalar(), kv["name"].Scalar(), kv["sensor name"].Scalar(), kv}; + ParamsInitProcessor pProc = {kv["type"].Scalar(), kv["name"].Scalar(), kv["sensor_name"].Scalar(), kv}; _paramsProc.push_back(pProc); } for(const auto& kv : n_config["callbacks"]){ diff --git a/src/problem/problem.cpp b/src/problem/problem.cpp index a9044802917df11f6c7e7609b06add76a2c01021..19b594237b58a303f0f320fc2635c7d8c73d9f62 100644 --- a/src/problem/problem.cpp +++ b/src/problem/problem.cpp @@ -107,10 +107,10 @@ ProblemPtr Problem::autoSetup(ParamsServer &_server) } // Prior - Eigen::VectorXs prior_state = _server.getParam<Eigen::VectorXs>("problem/prior state"); - Eigen::MatrixXs prior_cov = _server.getParam<Eigen::MatrixXs>("problem/prior cov"); - Scalar prior_time_tolerance = _server.getParam<Scalar>("problem/prior time tolerance"); - Scalar prior_ts = _server.getParam<Scalar>("problem/prior timestamp"); + Eigen::VectorXs prior_state = _server.getParam<Eigen::VectorXs>("problem/prior/state"); + Eigen::MatrixXs prior_cov = _server.getParam<Eigen::MatrixXs>("problem/prior/cov"); + Scalar prior_time_tolerance = _server.getParam<Scalar>("problem/prior/time_tolerance"); + Scalar prior_ts = _server.getParam<Scalar>("problem/prior/timestamp"); WOLF_TRACE("prior timestamp:\n" , prior_ts); WOLF_TRACE("prior state:\n" , prior_state.transpose()); diff --git a/test/gtest_parser_yaml.cpp b/test/gtest_parser_yaml.cpp index 5102157d05185f93874e9ec0e89e9141feaf230e..7dc34e134fa96361c698e61f03a227ff8d1e8125 100644 --- a/test/gtest_parser_yaml.cpp +++ b/test/gtest_parser_yaml.cpp @@ -22,7 +22,7 @@ TEST(ParserYAML, RegularParse) // for(auto it : params) // cout << it.first << " %% " << it.second << endl; EXPECT_EQ(params["odom/intrinsic/k_rot_to_rot"], "0.1"); - EXPECT_EQ(params["processor1/sensor name"], "odom"); + EXPECT_EQ(params["processor1/sensor_name"], "odom"); } TEST(ParserYAML, ParseMap) { @@ -34,14 +34,14 @@ TEST(ParserYAML, JumpFile) { auto parser = parse("test/yaml/params3.yaml", wolf_root); auto params = parser.getParams(); - EXPECT_EQ(params["my_proc_test/extern params/max_buff_length"], "100"); - EXPECT_EQ(params["my_proc_test/extern params/voting_active"], "false"); + EXPECT_EQ(params["my_proc_test/extern_params/max_buff_length"], "100"); + EXPECT_EQ(params["my_proc_test/extern_params/voting_active"], "false"); } TEST(ParserYAML, ProblemConfig) { auto parser = parse("test/yaml/params2.yaml", wolf_root); auto params = parser.getParams(); - EXPECT_EQ(params["problem/frame structure"], "POV"); + EXPECT_EQ(params["problem/frame_structure"], "POV"); EXPECT_EQ(params["problem/dimension"], "2"); } int main(int argc, char **argv) diff --git a/test/yaml/params1.yaml b/test/yaml/params1.yaml index d7d066b53a333d6beb27b20d7eef7468b29f505e..e23b1a484986615060eff7a8d3ad05c2d7116d6d 100644 --- a/test/yaml/params1.yaml +++ b/test/yaml/params1.yaml @@ -1,6 +1,6 @@ config: problem: - frame structure: "POV" + frame_structure: "POV" dimension: 3 sensors: - @@ -10,7 +10,7 @@ config: k_disp_to_disp: 0.1 k_rot_to_rot: 0.1 extrinsic: - pos: [1,2,3] + pose: [1,2,3] - type: "RANGE BEARING" name: "rb" @@ -18,15 +18,15 @@ config: - type: "ODOM 2D" name: "processor1" - sensor name: "odom" + sensor_name: "odom" - type: "RANGE BEARING" name: "rb_processor" - sensor name: "rb" + sensor_name: "rb" - type: "ODOM 2D" name: "my_proc_test" - sensor name: "odom" + sensor_name: "odom" follow: "test/yaml/params3.1.yaml" files: - "/home/jcasals/workspace/wip/wolf/lib/libsensor_odo.so" diff --git a/test/yaml/params2.yaml b/test/yaml/params2.yaml index 7830e8cb85f9fef0acea46e81fa293ed7528fc5c..5825166a88c5383b3d7cc4e3264cf51e9605aa5e 100644 --- a/test/yaml/params2.yaml +++ b/test/yaml/params2.yaml @@ -1,6 +1,6 @@ config: problem: - frame structure: "POV" + frame_structure: "POV" dimension: 2 sensors: - @@ -10,7 +10,7 @@ config: k_disp_to_disp: 0.1 k_rot_to_rot: 0.1 extrinsic: - pos: [1,2,3] + pose: [1,2,3] - type: "RANGE BEARING" name: "rb" @@ -18,7 +18,7 @@ config: - type: "ODOM 2D" name: "processor1" - sensor name: "odom" + sensor_name: "odom" $mymap: k1: v1 k2: v2 @@ -26,11 +26,11 @@ config: - type: "RANGE BEARING" name: "rb_processor" - sensor name: "rb" + sensor_name: "rb" - type: "ODOM 2D" name: "my_proc_test" - sensor name: "odom" + sensor_name: "odom" files: - "/home/jcasals/workspace/wip/wolf/lib/libsensor_odo.so" - "/home/jcasals/workspace/wip/wolf/lib/librange_bearing.so" \ No newline at end of file diff --git a/test/yaml/params3.yaml b/test/yaml/params3.yaml index 3e0d7a40f9fce04d9f6976518fe3bb900dabdbf9..222fd91b45a9846d0f6b571db36f2f8b680591ae 100644 --- a/test/yaml/params3.yaml +++ b/test/yaml/params3.yaml @@ -1,6 +1,6 @@ config: # problem: - # frame structure: "POV" + # frame_structure: "POV" # dimension: 2 sensors: - @@ -10,10 +10,10 @@ config: k_disp_to_disp: 0.1 k_rot_to_rot: 0.1 extrinsic: - pos: [1,2,3] + pose: [1,2,3] processors: - type: "ODOM 2D" name: "my_proc_test" - sensor name: "odom" - extern params: "@test/yaml/params3.1.yaml" \ No newline at end of file + sensor_name: "odom" + extern_params: "@test/yaml/params3.1.yaml" \ No newline at end of file diff --git a/test/yaml/processor_odom_3D.yaml b/test/yaml/processor_odom_3D.yaml index 7929a29801c25a22667c3278d26c5a4f910eb755..7df9dd0218f3910c48a8559f5ee6af504989ed7b 100644 --- a/test/yaml/processor_odom_3D.yaml +++ b/test/yaml/processor_odom_3D.yaml @@ -1,7 +1,8 @@ -time tolerance: 0.01 # seconds -keyframe vote: - max time span: 0.2 # seconds - max buffer length: 10 # motion deltas - dist traveled: 0.5 # meters - angle turned: 0.1 # radians (1 rad approx 57 deg, approx 60 deg)type: "ODOM 3D" # This must match the KEY used in the SensorFactory. Otherwise it is an error. +type: "ODOM 3D" # This must match the KEY used in the SensorFactory. Otherwise it is an error. name: "Main odometer" # This is ignored. The name provided to the SensorFactory prevails +time_tolerance: 0.01 # seconds +keyframe_vote: + max_time_span: 0.2 # seconds + max_buffer_length: 10 # motion deltas + dist_traveled: 0.5 # meters + angle_turned: 0.1 # radians (1 rad approx 57 deg, approx 60 deg) \ No newline at end of file diff --git a/test/yaml/sensor_odom_3D.yaml b/test/yaml/sensor_odom_3D.yaml index 4cc241e8476dcdc672fb188d5f0de31651700269..075681ffb8b8162936d5d16301776e15f27a6a84 100644 --- a/test/yaml/sensor_odom_3D.yaml +++ b/test/yaml/sensor_odom_3D.yaml @@ -1,6 +1,6 @@ -motion variances: type: "ODOM 3D" # This must match the KEY used in the SensorFactory. Otherwise it is an error. name: "Main odometer" # This is ignored. The name provided to the SensorFactory prevails +motion_variances: disp_to_disp: 0.02 # m^2 / m disp_to_rot: 0.02 # rad^2 / m rot_to_rot: 0.01 # rad^2 / rad