├── .clang-format ├── .github └── workflows │ ├── cmake_debug.yml │ ├── cmake_release.yml │ └── doxygen.yml ├── .gitignore ├── AUTHORS ├── CMakeLists.txt ├── LICENSE ├── README.md ├── cmake ├── BoostConfig.cmake ├── CheckTemplate.cmake ├── ClangTidy.cmake ├── CompileOptions.cmake ├── ComponentInstall.cmake ├── Cppcheck.cmake ├── Custom.cmake ├── EigenConfig.cmake ├── FindASSIMP.cmake ├── FindEGL.cmake ├── FindFFMPEG.cmake ├── FindGLESv2.cmake ├── FindGLEW.cmake ├── FindHIDAPI.cmake ├── Findclang_tidy.cmake ├── Findcppcheck.cmake ├── Findnodejs.cmake ├── Findyaml-cpp.cmake ├── GenerateTemplateExportHeader.cmake ├── GetGitRevisionDescription.cmake ├── GetGitRevisionDescription.cmake.in ├── HealthCheck.cmake ├── RuntimeDependencies.cmake ├── SophusConfig.cmake └── kindrConfig.cmake ├── configure ├── data └── README.md ├── deploy ├── CMakeLists.txt ├── images │ ├── logo.bmp │ ├── logo.ico │ └── logo.png ├── packages │ └── pack-mars_lib.cmake ├── scripts │ └── docker_application_test.sh └── ubuntu-ppa │ ├── debian │ ├── changelog │ ├── compat │ ├── control │ ├── copyright │ ├── rules │ └── source │ │ └── format │ └── recipe.txt ├── dockerfile ├── docs ├── CMakeLists.txt └── api-docs │ ├── CMakeLists.txt │ └── doxyfile.in ├── mars_lib-config.cmake ├── resources ├── a-astro-space-font.zip ├── buffer_structure.png ├── buffer_structure.svg ├── cov_segmentation.png ├── cov_segmentation.svg ├── mars_logo.png ├── mars_logo.svg ├── modification_levels.png ├── modification_levels.svg ├── simple_class_structure.png ├── simple_class_structure.svg └── uml │ ├── seq_initialization.md │ ├── seq_initialization.png │ ├── seq_propagation_routine.md │ ├── seq_propagation_routine.png │ ├── seq_sensor_update.md │ ├── seq_sensor_update.png │ ├── uml_prototype.md │ └── uml_prototype.png └── source ├── CMakeLists.txt ├── codegeneration ├── mars_api.h.in └── mars_msvc_api.h.in ├── examples ├── CMakeLists.txt ├── mars_cmd │ ├── CMakeLists.txt │ └── main.cpp ├── mars_insane_dataset │ ├── CMakeLists.txt │ ├── data │ │ ├── insane_dataset.yaml │ │ ├── insane_dataset_klu.yaml │ │ └── insane_dataset_negev.yaml │ ├── include │ │ └── mars_insane_dataset.h │ ├── mars_insane_dataset.cpp │ └── mars_insane_dataset_settings.h.in └── mars_thl │ ├── CMakeLists.txt │ ├── mars_thl_example.cpp │ ├── sim_data │ └── thl │ │ ├── dataset_info.md │ │ ├── gps_position_1.csv │ │ ├── gps_velocity_1.csv │ │ ├── parameter.yaml │ │ ├── pose_sensor_1.csv │ │ ├── pose_sensor_2.csv │ │ ├── pose_sensor_3.csv │ │ ├── pose_sensor_4.csv │ │ ├── pressure_height_1.csv │ │ ├── pressure_height_2.csv │ │ └── traj.csv │ └── thl_example_data_settings.h.in ├── mars ├── CMakeLists.txt ├── include │ └── mars │ │ ├── buffer.h │ │ ├── core_logic.h │ │ ├── core_state.h │ │ ├── data_utils │ │ ├── filesystem.cpp │ │ ├── filesystem.h │ │ ├── read_baro_data.h │ │ ├── read_csv.h │ │ ├── read_gps_data.h │ │ ├── read_gps_w_vel_data.h │ │ ├── read_imu_data.h │ │ ├── read_mag_data.h │ │ ├── read_pose_data.h │ │ ├── read_position_data.h │ │ ├── read_sim_data.h │ │ ├── read_velocity_data.h │ │ ├── read_vision_data.h │ │ └── write_csv.h │ │ ├── ekf.h │ │ ├── general_functions │ │ ├── progress_indicator.cpp │ │ ├── progress_indicator.h │ │ └── utils.h │ │ ├── m_perf.h │ │ ├── nearest_cov.h │ │ ├── sensor_manager.h │ │ ├── sensors │ │ ├── attitude │ │ │ ├── attitude_conversion.h │ │ │ ├── attitude_measurement_type.h │ │ │ ├── attitude_sensor_class.h │ │ │ └── attitude_sensor_state_type.h │ │ ├── bind_sensor_data.h │ │ ├── bodyvel │ │ │ ├── bodyvel_measurement_type.h │ │ │ ├── bodyvel_sensor_class.h │ │ │ └── bodyvel_sensor_state_type.h │ │ ├── empty │ │ │ ├── empty_measurement_type.h │ │ │ ├── empty_sensor_class.h │ │ │ └── empty_sensor_state_type.h │ │ ├── gps │ │ │ ├── gps_conversion.cpp │ │ │ ├── gps_conversion.h │ │ │ ├── gps_measurement_type.h │ │ │ ├── gps_sensor_class.h │ │ │ ├── gps_sensor_state_type.h │ │ │ ├── gps_utils.cpp │ │ │ └── gps_utils.h │ │ ├── gps_w_vel │ │ │ ├── gps_w_vel_measurement_type.h │ │ │ ├── gps_w_vel_sensor_class.h │ │ │ └── gps_w_vel_sensor_state_type.h │ │ ├── imu │ │ │ ├── imu_measurement_type.h │ │ │ └── imu_sensor_class.h │ │ ├── mag │ │ │ ├── mag_measurement_type.h │ │ │ ├── mag_sensor_class.h │ │ │ ├── mag_sensor_state_type.h │ │ │ ├── mag_utils.cpp │ │ │ └── mag_utils.h │ │ ├── measurement_base_class.h │ │ ├── measurement_interface.h │ │ ├── pose │ │ │ ├── pose_measurement_type.cpp │ │ │ ├── pose_measurement_type.h │ │ │ ├── pose_sensor_class.cpp │ │ │ ├── pose_sensor_class.h │ │ │ ├── pose_sensor_state_type.cpp │ │ │ └── pose_sensor_state_type.h │ │ ├── position │ │ │ ├── position_measurement_type.h │ │ │ ├── position_sensor_class.h │ │ │ └── position_sensor_state_type.h │ │ ├── pressure │ │ │ ├── pressure_conversion.cpp │ │ │ ├── pressure_conversion.h │ │ │ ├── pressure_measurement_type.h │ │ │ ├── pressure_sensor_class.h │ │ │ ├── pressure_sensor_state_type.h │ │ │ ├── pressure_utils.cpp │ │ │ └── pressure_utils.h │ │ ├── sensor_abs_class.h │ │ ├── sensor_interface.h │ │ ├── update_sensor_abs_class.h │ │ ├── velocity │ │ │ ├── velocity_measurement_type.h │ │ │ ├── velocity_sensor_class.h │ │ │ └── velocity_sensor_state_type.h │ │ └── vision │ │ │ ├── vision_measurement_type.h │ │ │ ├── vision_sensor_class.h │ │ │ └── vision_sensor_state_type.h │ │ ├── time.h │ │ └── type_definitions │ │ ├── base_states.h │ │ ├── buffer_data_type.h │ │ ├── buffer_entry_type.h │ │ ├── core_state_type.h │ │ ├── core_type.h │ │ └── mars_types.h └── source │ ├── buffer.cpp │ ├── buffer_entry_type.cpp │ ├── core_logic.cpp │ ├── core_state.cpp │ ├── core_state_calc_q.cpp │ ├── ekf.cpp │ ├── m_perf.cpp │ ├── nearest_cov.cpp │ ├── sensor_abs_class.cpp │ ├── sensor_interface.cpp │ ├── sensor_manager.cpp │ ├── time.cpp │ └── utils.cpp ├── tests ├── CMakeLists.txt ├── README.md ├── googletest │ ├── .clang-format │ ├── .github │ │ ├── ISSUE_TEMPLATE │ │ │ ├── 00-bug_report.yml │ │ │ ├── 10-feature_request.yml │ │ │ └── config.yml │ │ └── workflows │ │ │ └── gtest-ci.yml │ ├── .gitignore │ ├── BUILD.bazel │ ├── CMakeLists.txt │ ├── CONTRIBUTING.md │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── README.md │ ├── RELEASE_1_13_0 │ ├── WORKSPACE │ ├── ci │ │ ├── linux-presubmit.sh │ │ ├── macos-presubmit.sh │ │ └── windows-presubmit.bat │ ├── docs │ │ ├── _config.yml │ │ ├── _data │ │ │ └── navigation.yml │ │ ├── _layouts │ │ │ └── default.html │ │ ├── _sass │ │ │ └── main.scss │ │ ├── advanced.md │ │ ├── assets │ │ │ └── css │ │ │ │ └── style.scss │ │ ├── community_created_documentation.md │ │ ├── faq.md │ │ ├── gmock_cheat_sheet.md │ │ ├── gmock_cook_book.md │ │ ├── gmock_faq.md │ │ ├── gmock_for_dummies.md │ │ ├── index.md │ │ ├── pkgconfig.md │ │ ├── platforms.md │ │ ├── primer.md │ │ ├── quickstart-bazel.md │ │ ├── quickstart-cmake.md │ │ ├── reference │ │ │ ├── actions.md │ │ │ ├── assertions.md │ │ │ ├── matchers.md │ │ │ ├── mocking.md │ │ │ └── testing.md │ │ └── samples.md │ ├── googlemock │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── cmake │ │ │ ├── gmock.pc.in │ │ │ └── gmock_main.pc.in │ │ ├── docs │ │ │ └── README.md │ │ ├── include │ │ │ └── gmock │ │ │ │ ├── gmock-actions.h │ │ │ │ ├── gmock-cardinalities.h │ │ │ │ ├── gmock-function-mocker.h │ │ │ │ ├── gmock-matchers.h │ │ │ │ ├── gmock-more-actions.h │ │ │ │ ├── gmock-more-matchers.h │ │ │ │ ├── gmock-nice-strict.h │ │ │ │ ├── gmock-spec-builders.h │ │ │ │ ├── gmock.h │ │ │ │ └── internal │ │ │ │ ├── custom │ │ │ │ ├── README.md │ │ │ │ ├── gmock-generated-actions.h │ │ │ │ ├── gmock-matchers.h │ │ │ │ └── gmock-port.h │ │ │ │ ├── gmock-internal-utils.h │ │ │ │ ├── gmock-port.h │ │ │ │ └── gmock-pp.h │ │ ├── src │ │ │ ├── gmock-all.cc │ │ │ ├── gmock-cardinalities.cc │ │ │ ├── gmock-internal-utils.cc │ │ │ ├── gmock-matchers.cc │ │ │ ├── gmock-spec-builders.cc │ │ │ ├── gmock.cc │ │ │ └── gmock_main.cc │ │ └── test │ │ │ ├── BUILD.bazel │ │ │ ├── gmock-actions_test.cc │ │ │ ├── gmock-cardinalities_test.cc │ │ │ ├── gmock-function-mocker_test.cc │ │ │ ├── gmock-internal-utils_test.cc │ │ │ ├── gmock-matchers-arithmetic_test.cc │ │ │ ├── gmock-matchers-comparisons_test.cc │ │ │ ├── gmock-matchers-containers_test.cc │ │ │ ├── gmock-matchers-misc_test.cc │ │ │ ├── gmock-matchers_test.h │ │ │ ├── gmock-more-actions_test.cc │ │ │ ├── gmock-nice-strict_test.cc │ │ │ ├── gmock-port_test.cc │ │ │ ├── gmock-pp-string_test.cc │ │ │ ├── gmock-pp_test.cc │ │ │ ├── gmock-spec-builders_test.cc │ │ │ ├── gmock_all_test.cc │ │ │ ├── gmock_ex_test.cc │ │ │ ├── gmock_leak_test.py │ │ │ ├── gmock_leak_test_.cc │ │ │ ├── gmock_link2_test.cc │ │ │ ├── gmock_link_test.cc │ │ │ ├── gmock_link_test.h │ │ │ ├── gmock_output_test.py │ │ │ ├── gmock_output_test_.cc │ │ │ ├── gmock_output_test_golden.txt │ │ │ ├── gmock_stress_test.cc │ │ │ ├── gmock_test.cc │ │ │ └── gmock_test_utils.py │ └── googletest │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── cmake │ │ ├── Config.cmake.in │ │ ├── gtest.pc.in │ │ ├── gtest_main.pc.in │ │ ├── internal_utils.cmake │ │ └── libgtest.la.in │ │ ├── docs │ │ └── README.md │ │ ├── include │ │ └── gtest │ │ │ ├── gtest-assertion-result.h │ │ │ ├── gtest-death-test.h │ │ │ ├── gtest-matchers.h │ │ │ ├── gtest-message.h │ │ │ ├── gtest-param-test.h │ │ │ ├── gtest-printers.h │ │ │ ├── gtest-spi.h │ │ │ ├── gtest-test-part.h │ │ │ ├── gtest-typed-test.h │ │ │ ├── gtest.h │ │ │ ├── gtest_pred_impl.h │ │ │ ├── gtest_prod.h │ │ │ └── internal │ │ │ ├── custom │ │ │ ├── README.md │ │ │ ├── gtest-port.h │ │ │ ├── gtest-printers.h │ │ │ └── gtest.h │ │ │ ├── gtest-death-test-internal.h │ │ │ ├── gtest-filepath.h │ │ │ ├── gtest-internal.h │ │ │ ├── gtest-param-util.h │ │ │ ├── gtest-port-arch.h │ │ │ ├── gtest-port.h │ │ │ ├── gtest-string.h │ │ │ └── gtest-type-util.h │ │ ├── samples │ │ ├── prime_tables.h │ │ ├── sample1.cc │ │ ├── sample1.h │ │ ├── sample10_unittest.cc │ │ ├── sample1_unittest.cc │ │ ├── sample2.cc │ │ ├── sample2.h │ │ ├── sample2_unittest.cc │ │ ├── sample3-inl.h │ │ ├── sample3_unittest.cc │ │ ├── sample4.cc │ │ ├── sample4.h │ │ ├── sample4_unittest.cc │ │ ├── sample5_unittest.cc │ │ ├── sample6_unittest.cc │ │ ├── sample7_unittest.cc │ │ ├── sample8_unittest.cc │ │ └── sample9_unittest.cc │ │ ├── src │ │ ├── gtest-all.cc │ │ ├── gtest-assertion-result.cc │ │ ├── gtest-death-test.cc │ │ ├── gtest-filepath.cc │ │ ├── gtest-internal-inl.h │ │ ├── gtest-matchers.cc │ │ ├── gtest-port.cc │ │ ├── gtest-printers.cc │ │ ├── gtest-test-part.cc │ │ ├── gtest-typed-test.cc │ │ ├── gtest.cc │ │ └── gtest_main.cc │ │ └── test │ │ ├── BUILD.bazel │ │ ├── googletest-break-on-failure-unittest.py │ │ ├── googletest-break-on-failure-unittest_.cc │ │ ├── googletest-catch-exceptions-test.py │ │ ├── googletest-catch-exceptions-test_.cc │ │ ├── googletest-color-test.py │ │ ├── googletest-color-test_.cc │ │ ├── googletest-death-test-test.cc │ │ ├── googletest-death-test_ex_test.cc │ │ ├── googletest-env-var-test.py │ │ ├── googletest-env-var-test_.cc │ │ ├── googletest-failfast-unittest.py │ │ ├── googletest-failfast-unittest_.cc │ │ ├── googletest-filepath-test.cc │ │ ├── googletest-filter-unittest.py │ │ ├── googletest-filter-unittest_.cc │ │ ├── googletest-global-environment-unittest.py │ │ ├── googletest-global-environment-unittest_.cc │ │ ├── googletest-json-outfiles-test.py │ │ ├── googletest-json-output-unittest.py │ │ ├── googletest-list-tests-unittest.py │ │ ├── googletest-list-tests-unittest_.cc │ │ ├── googletest-listener-test.cc │ │ ├── googletest-message-test.cc │ │ ├── googletest-options-test.cc │ │ ├── googletest-output-test-golden-lin.txt │ │ ├── googletest-output-test.py │ │ ├── googletest-output-test_.cc │ │ ├── googletest-param-test-invalid-name1-test.py │ │ ├── googletest-param-test-invalid-name1-test_.cc │ │ ├── googletest-param-test-invalid-name2-test.py │ │ ├── googletest-param-test-invalid-name2-test_.cc │ │ ├── googletest-param-test-test.cc │ │ ├── googletest-param-test-test.h │ │ ├── googletest-param-test2-test.cc │ │ ├── googletest-port-test.cc │ │ ├── googletest-printers-test.cc │ │ ├── googletest-setuptestsuite-test.py │ │ ├── googletest-setuptestsuite-test_.cc │ │ ├── googletest-shuffle-test.py │ │ ├── googletest-shuffle-test_.cc │ │ ├── googletest-test-part-test.cc │ │ ├── googletest-throw-on-failure-test.py │ │ ├── googletest-throw-on-failure-test_.cc │ │ ├── googletest-uninitialized-test.py │ │ ├── googletest-uninitialized-test_.cc │ │ ├── gtest-typed-test2_test.cc │ │ ├── gtest-typed-test_test.cc │ │ ├── gtest-typed-test_test.h │ │ ├── gtest-unittest-api_test.cc │ │ ├── gtest_all_test.cc │ │ ├── gtest_assert_by_exception_test.cc │ │ ├── gtest_dirs_test.cc │ │ ├── gtest_environment_test.cc │ │ ├── gtest_help_test.py │ │ ├── gtest_help_test_.cc │ │ ├── gtest_json_test_utils.py │ │ ├── gtest_list_output_unittest.py │ │ ├── gtest_list_output_unittest_.cc │ │ ├── gtest_main_unittest.cc │ │ ├── gtest_no_test_unittest.cc │ │ ├── gtest_pred_impl_unittest.cc │ │ ├── gtest_premature_exit_test.cc │ │ ├── gtest_prod_test.cc │ │ ├── gtest_repeat_test.cc │ │ ├── gtest_skip_check_output_test.py │ │ ├── gtest_skip_environment_check_output_test.py │ │ ├── gtest_skip_in_environment_setup_test.cc │ │ ├── gtest_skip_test.cc │ │ ├── gtest_sole_header_test.cc │ │ ├── gtest_stress_test.cc │ │ ├── gtest_test_macro_stack_footprint_test.cc │ │ ├── gtest_test_utils.py │ │ ├── gtest_testbridge_test.py │ │ ├── gtest_testbridge_test_.cc │ │ ├── gtest_throw_on_failure_ex_test.cc │ │ ├── gtest_unittest.cc │ │ ├── gtest_xml_outfile1_test_.cc │ │ ├── gtest_xml_outfile2_test_.cc │ │ ├── gtest_xml_outfiles_test.py │ │ ├── gtest_xml_output_unittest.py │ │ ├── gtest_xml_output_unittest_.cc │ │ ├── gtest_xml_test_utils.py │ │ ├── production.cc │ │ └── production.h ├── mars-e2e-test │ ├── CMakeLists.txt │ ├── main.cpp │ ├── mars_e2e_imu_pose_ooo_rework.cpp │ ├── mars_e2e_imu_pose_outlier.cpp │ ├── mars_e2e_imu_pose_update.cpp │ ├── mars_e2e_imu_pose_update_perf.cpp │ ├── mars_e2e_imu_prop.cpp │ └── mars_e2e_imu_prop_empty_updates.cpp ├── mars-test │ ├── CMakeLists.txt │ ├── eigen_runtime_test.cpp │ ├── main.cpp │ ├── mars_attitude_sensor.cpp │ ├── mars_bind_sensor_data.cpp │ ├── mars_bodyvel_sensor.cpp │ ├── mars_buffer.cpp │ ├── mars_buffer_type.cpp │ ├── mars_class_handle_inheritance.cpp │ ├── mars_core_logic.cpp │ ├── mars_core_state.cpp │ ├── mars_ekf.cpp │ ├── mars_gps_conversion.cpp │ ├── mars_gps_sensor.cpp │ ├── mars_gps_utils.cpp │ ├── mars_imu_sensor.cpp │ ├── mars_m_perf.cpp │ ├── mars_nearest_cov.cpp │ ├── mars_pose_sensor.cpp │ ├── mars_position_sensor.cpp │ ├── mars_pressure_sensor.cpp │ ├── mars_read_csv.cpp │ ├── mars_time.cpp │ ├── mars_type_erasure.cpp │ ├── mars_utils.cpp │ ├── mars_velocity_sensor.cpp │ ├── mars_vision_sensor.cpp │ └── mars_write_csv.cpp ├── test_data.tar.gz └── test_data_settings.h.in └── version.h.in /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | BasedOnStyle: Google 3 | AccessModifierOffset: -2 4 | ConstructorInitializerIndentWidth: 2 5 | AlignEscapedNewlinesLeft: false 6 | AlignTrailingComments: true 7 | AllowAllParametersOfDeclarationOnNextLine: false 8 | AllowShortIfStatementsOnASingleLine: false 9 | AllowShortLoopsOnASingleLine: false 10 | AllowShortFunctionsOnASingleLine: None 11 | AlwaysBreakTemplateDeclarations: true 12 | AlwaysBreakBeforeMultilineStrings: false 13 | BreakBeforeBinaryOperators: false 14 | BreakBeforeTernaryOperators: false 15 | BreakConstructorInitializersBeforeComma: true 16 | BinPackParameters: true 17 | ColumnLimit: 120 18 | ConstructorInitializerAllOnOneLineOrOnePerLine: true 19 | DerivePointerBinding: false 20 | PointerBindsToType: true 21 | ExperimentalAutoDetectBinPacking: false 22 | IndentCaseLabels: true 23 | MaxEmptyLinesToKeep: 1 24 | NamespaceIndentation: None 25 | ObjCSpaceBeforeProtocolList: true 26 | PenaltyBreakBeforeFirstCallParameter: 19 27 | PenaltyBreakComment: 60 28 | PenaltyBreakString: 1 29 | PenaltyBreakFirstLessLess: 1000 30 | PenaltyExcessCharacter: 1000 31 | PenaltyReturnTypeOnItsOwnLine: 90 32 | SpacesBeforeTrailingComments: 2 33 | Cpp11BracedListStyle: false 34 | Standard: Auto 35 | IndentWidth: 2 36 | TabWidth: 2 37 | UseTab: Never 38 | IndentFunctionDeclarationAfterType: false 39 | SpacesInParentheses: false 40 | SpacesInAngles: false 41 | SpaceInEmptyParentheses: false 42 | SpacesInCStyleCastParentheses: false 43 | SpaceAfterControlStatementKeyword: true 44 | SpaceBeforeAssignmentOperators: true 45 | ContinuationIndentWidth: 4 46 | SortIncludes: true 47 | IncludeBlocks: Merge 48 | SpaceAfterCStyleCast: false 49 | 50 | # Configure each individual brace in BraceWrapping 51 | BreakBeforeBraces: Custom 52 | 53 | # Control of individual brace wrapping cases 54 | BraceWrapping: { 55 | AfterClass: 'true' 56 | AfterControlStatement: 'true' 57 | AfterEnum : 'true' 58 | AfterFunction : 'true' 59 | AfterNamespace : 'true' 60 | AfterStruct : 'true' 61 | AfterUnion : 'true' 62 | BeforeCatch : 'true' 63 | BeforeElse : 'true' 64 | IndentBraces : 'false' 65 | } 66 | ... 67 | -------------------------------------------------------------------------------- /.github/workflows/cmake_debug.yml: -------------------------------------------------------------------------------- 1 | name: CMake-Debug 2 | 3 | on: 4 | push: 5 | branches: [ "main", "development"] 6 | pull_request: 7 | branches: [ "main", "development"] 8 | 9 | env: 10 | BUILD_TYPE: Debug 11 | 12 | jobs: 13 | build: 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v4 18 | 19 | - name: Configure CMake 20 | run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} 21 | 22 | - name: Build 23 | run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} 24 | 25 | - name: Test Individual 26 | working-directory: ${{github.workspace}}/build 27 | run: make test mars-test 28 | 29 | - name: Test End to End 30 | working-directory: ${{github.workspace}}/build 31 | run: make test mars-e2e-test 32 | -------------------------------------------------------------------------------- /.github/workflows/cmake_release.yml: -------------------------------------------------------------------------------- 1 | name: CMake-Release 2 | 3 | on: 4 | push: 5 | branches: [ "main", "development"] 6 | pull_request: 7 | branches: [ "main", "development"] 8 | 9 | env: 10 | BUILD_TYPE: Release 11 | 12 | jobs: 13 | build: 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v4 18 | 19 | - name: Configure CMake 20 | run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} 21 | 22 | - name: Build 23 | run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} 24 | 25 | - name: Test Individual 26 | working-directory: ${{github.workspace}}/build 27 | run: make test mars-test 28 | 29 | - name: Test End to End 30 | working-directory: ${{github.workspace}}/build 31 | run: make test mars-e2e-test 32 | -------------------------------------------------------------------------------- /.github/workflows/doxygen.yml: -------------------------------------------------------------------------------- 1 | # Workflow for building and deploying a Doxygen site to GitHub Pages 2 | name: Deploy Doxygen site to Pages 3 | 4 | on: 5 | # Runs on pushes targeting the default branch 6 | push: 7 | branches: 8 | - main 9 | 10 | # Allows you to run this workflow manually from the Actions tab 11 | workflow_dispatch: 12 | 13 | # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages 14 | permissions: 15 | contents: read 16 | pages: write 17 | id-token: write 18 | 19 | # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. 20 | # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. 21 | concurrency: 22 | group: "pages" 23 | cancel-in-progress: false 24 | 25 | # Default to bash 26 | defaults: 27 | run: 28 | shell: bash 29 | 30 | jobs: 31 | # Build job 32 | build: 33 | runs-on: ubuntu-latest 34 | env: 35 | DOXYGEN_VERSION: 0 36 | steps: 37 | - name: Install Doxygen 38 | run: sudo apt install cmake doxygen graphviz 39 | - name: Checkout 40 | uses: actions/checkout@v4 41 | with: 42 | submodules: recursive 43 | fetch-depth: 0 44 | - name: Configure CMake 45 | run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Debug 46 | - name: Build Doxygen Page 47 | run: cmake --build ${{github.workspace}}/build 48 | - name: Setup Pages 49 | uses: actions/configure-pages@v5 50 | - name: Upload artifact 51 | uses: actions/upload-pages-artifact@v3 52 | with: 53 | path: ./build/docs/api-docs/html 54 | 55 | # Deployment job 56 | deploy: 57 | environment: 58 | name: github-pages 59 | url: ${{ steps.deployment.outputs.page_url }} 60 | runs-on: ubuntu-latest 61 | needs: build 62 | steps: 63 | - name: Deploy to GitHub Pages 64 | id: deployment 65 | uses: actions/deploy-pages@v4 66 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | 6 | # Compiled Dynamic libraries 7 | *.so 8 | *.dylib 9 | 10 | # Compiled Static libraries 11 | *.lai 12 | *.la 13 | *.a 14 | 15 | # Build dir 16 | build* 17 | debug_build 18 | release_build 19 | /bin 20 | /lib 21 | /install 22 | 23 | # Local folder 24 | **/include_local 25 | 26 | # Qt cache 27 | CMakeLists.txt.user 28 | CMakeLists.txt.user.* 29 | 30 | # IDE project files 31 | *.sublime-project 32 | *.sublime-workspace 33 | 34 | # Local config windows 35 | _configure.bat 36 | _open-project.bat 37 | _start-cmake-gui.bat 38 | _start-cmd.bat 39 | 40 | # Local config unix 41 | .localconfig 42 | 43 | # Wiki 44 | wiki 45 | 46 | # Raw test-data 47 | source/tests/test_data 48 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | 2 | Christian Brommer 3 | 4 | 5 | Thanks to all Contributors -------------------------------------------------------------------------------- /cmake/BoostConfig.cmake: -------------------------------------------------------------------------------- 1 | if(NOT BOOST_VERSION) 2 | set( BOOST_VERSION "1.74.0" ) 3 | endif() 4 | 5 | string(REPLACE "." "_" BOOST_VERSION_UNDERSCORE ${BOOST_VERSION}) 6 | 7 | set( boost_URL "https://archives.boost.io/release/${BOOST_VERSION}/source/boost_${BOOST_VERSION_UNDERSCORE}.tar.gz") 8 | set( boost_install_DIR ${CMAKE_BINARY_DIR}/boost ) 9 | 10 | 11 | if (NOT TARGET Boost) 12 | include(ExternalProject) 13 | ExternalProject_Add(boost-ext 14 | PREFIX ${CMAKE_BINARY_DIR}/boost 15 | URL ${boost_URL} 16 | 17 | CONFIGURE_COMMAND ./bootstrap.sh 18 | --with-libraries=math 19 | #--with-libraries=filesystem 20 | #--with-libraries=system 21 | #--with-libraries=date_time 22 | --prefix=${boost_install_DIR} 23 | BUILD_COMMAND ./b2 link=static variant=release threading=multi runtime-link=static install 24 | BUILD_IN_SOURCE true 25 | INSTALL_COMMAND "" 26 | INSTALL_DIR ${boost_install_DIR} 27 | ) 28 | 29 | add_library(Boost STATIC IMPORTED GLOBAL) 30 | add_dependencies(Boost boost-ext) 31 | file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/boost/include) 32 | set_property(TARGET Boost PROPERTY INTERFACE_INCLUDE_DIRECTORIES 33 | ${CMAKE_BINARY_DIR}/boost/include 34 | ) 35 | 36 | 37 | set_target_properties(Boost PROPERTIES IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/boost/lib/libboost_math_c99.a) 38 | #${CMAKE_BINARY_DIR}/boost/lib/${CMAKE_STATIC_LIBRARY_PREFIX}boost${CMAKE_STATIC_LIBRARY_SUFFIX}) 39 | endif() 40 | 41 | set(BOOST_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/boost/include) 42 | -------------------------------------------------------------------------------- /cmake/CheckTemplate.cmake: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # Get cmake-init latest commit SHA on master 4 | # 5 | 6 | file(DOWNLOAD 7 | "https://api.github.com/repos/cginternals/cmake-init/commits/master" 8 | "${PROJECT_BINARY_DIR}/cmake-init.github.data" 9 | ) 10 | file(READ 11 | "${PROJECT_BINARY_DIR}/cmake-init.github.data" 12 | CMAKE_INIT_INFO 13 | ) 14 | 15 | string(REGEX MATCH 16 | "\"sha\": \"([0-9a-f]+)\"," 17 | CMAKE_INIT_SHA 18 | ${CMAKE_INIT_INFO}) 19 | 20 | string(SUBSTRING 21 | ${CMAKE_INIT_SHA} 22 | 8 23 | 40 24 | CMAKE_INIT_SHA 25 | ) 26 | 27 | # 28 | # Get latest cmake-init commit on this repository 29 | # 30 | 31 | # APPLIED_CMAKE_INIT_SHA can be set by parent script 32 | if(NOT APPLIED_CMAKE_INIT_SHA) 33 | # [TODO]: Get from git commit list (see cmake_init/source/scripts/check_template.sh) 34 | set(APPLIED_CMAKE_INIT_SHA "") 35 | endif () 36 | 37 | if("${APPLIED_CMAKE_INIT_SHA}" STREQUAL "") 38 | message(WARNING 39 | "No cmake-init version detected, could not verify up-to-dateness. " 40 | "Set the cmake-init version by defining a META_CMAKE_INIT_SHA for your project." 41 | ) 42 | return() 43 | endif() 44 | 45 | if(${APPLIED_CMAKE_INIT_SHA} STREQUAL ${CMAKE_INIT_SHA}) 46 | message(STATUS "cmake-init template is up-to-date (${CMAKE_INIT_SHA})") 47 | else() 48 | message(STATUS "cmake-init template needs an update https://github.com/cginternals/cmake-init/compare/${APPLIED_CMAKE_INIT_SHA}...master") 49 | endif() 50 | -------------------------------------------------------------------------------- /cmake/ClangTidy.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Function to register a target for clang-tidy 3 | function(perform_clang_tidy check_target target) 4 | set(includes "$") 5 | 6 | add_custom_target( 7 | ${check_target} 8 | COMMAND 9 | ${clang_tidy_EXECUTABLE} 10 | -p\t${PROJECT_BINARY_DIR} 11 | ${ARGN} 12 | -checks=* 13 | "$<$>:--\t$<$:-I$>>" 14 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 15 | ) 16 | 17 | set_target_properties(${check_target} 18 | PROPERTIES 19 | FOLDER "Maintenance" 20 | EXCLUDE_FROM_DEFAULT_BUILD 1 21 | ) 22 | 23 | add_dependencies(${check_target} ${target}) 24 | endfunction() 25 | -------------------------------------------------------------------------------- /cmake/ComponentInstall.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Execute cmake_install.cmake wrapper that allows to pass both DESTDIR and COMPONENT environment variable 3 | 4 | execute_process( 5 | COMMAND ${CMAKE_COMMAND} -DCOMPONENT=$ENV{COMPONENT} -P cmake_install.cmake 6 | ) 7 | -------------------------------------------------------------------------------- /cmake/Cppcheck.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Function to register a target for cppcheck 3 | function(perform_cppcheck check_target target) 4 | set(includes "$") 5 | 6 | add_custom_target( 7 | ${check_target} 8 | COMMAND 9 | ${cppcheck_EXECUTABLE} 10 | "$<$:-I$>" 11 | --enable=all 12 | --std=c++11 13 | --verbose 14 | --suppress=missingIncludeSystem 15 | ${ARGN} 16 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 17 | ) 18 | 19 | set_target_properties(${check_target} 20 | PROPERTIES 21 | FOLDER "Maintenance" 22 | EXCLUDE_FROM_DEFAULT_BUILD 1 23 | ) 24 | 25 | add_dependencies(${check_target} ${target}) 26 | endfunction() 27 | -------------------------------------------------------------------------------- /cmake/Custom.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Set policy if policy is available 3 | function(set_policy POL VAL) 4 | 5 | if(POLICY ${POL}) 6 | cmake_policy(SET ${POL} ${VAL}) 7 | endif() 8 | 9 | endfunction(set_policy) 10 | 11 | 12 | # Define function "source_group_by_path with three mandatory arguments (PARENT_PATH, REGEX, GROUP, ...) 13 | # to group source files in folders (e.g. for MSVC solutions). 14 | # 15 | # Example: 16 | # source_group_by_path("${CMAKE_CURRENT_SOURCE_DIR}/src" "\\\\.h$|\\\\.inl$|\\\\.cpp$|\\\\.c$|\\\\.ui$|\\\\.qrc$" "Source Files" ${sources}) 17 | function(source_group_by_path PARENT_PATH REGEX GROUP) 18 | 19 | foreach (FILENAME ${ARGN}) 20 | 21 | get_filename_component(FILEPATH "${FILENAME}" REALPATH) 22 | file(RELATIVE_PATH FILEPATH ${PARENT_PATH} ${FILEPATH}) 23 | get_filename_component(FILEPATH "${FILEPATH}" DIRECTORY) 24 | 25 | string(REPLACE "/" "\\" FILEPATH "${FILEPATH}") 26 | 27 | source_group("${GROUP}\\${FILEPATH}" REGULAR_EXPRESSION "${REGEX}" FILES ${FILENAME}) 28 | 29 | endforeach() 30 | 31 | endfunction(source_group_by_path) 32 | 33 | 34 | # Function that extract entries matching a given regex from a list. 35 | # ${OUTPUT} will store the list of matching filenames. 36 | function(list_extract OUTPUT REGEX) 37 | 38 | foreach(FILENAME ${ARGN}) 39 | if(${FILENAME} MATCHES "${REGEX}") 40 | list(APPEND ${OUTPUT} ${FILENAME}) 41 | endif() 42 | endforeach() 43 | 44 | set(${OUTPUT} ${${OUTPUT}} PARENT_SCOPE) 45 | 46 | endfunction(list_extract) 47 | -------------------------------------------------------------------------------- /cmake/EigenConfig.cmake: -------------------------------------------------------------------------------- 1 | #include(${CMAKE_CURRENT_LIST_DIR}/CrossCompile.cmake) 2 | include(ExternalProject) 3 | 4 | if(NOT Eigen_VERSION) 5 | set( Eigen_VERSION "3.3.7" ) 6 | endif() 7 | 8 | if (NOT TARGET Eigen) 9 | include(ExternalProject) 10 | externalproject_add(Eigen-ext 11 | PREFIX ${CMAKE_BINARY_DIR}/Eigen 12 | URL https://gitlab.com/libeigen/eigen/-/archive/${Eigen_VERSION}/eigen-${Eigen_VERSION}.tar 13 | CMAKE_ARGS 14 | ${CROSS_COMPILE} 15 | -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/Eigen 16 | -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} 17 | ) 18 | add_library(Eigen INTERFACE IMPORTED GLOBAL) 19 | add_dependencies(Eigen Eigen-ext) 20 | file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Eigen/include/eigen3) 21 | set_property(TARGET Eigen PROPERTY INTERFACE_INCLUDE_DIRECTORIES 22 | ${CMAKE_BINARY_DIR}/Eigen/include/eigen3 23 | ) 24 | endif() 25 | 26 | set(EIGEN3_INCLUDE_DIR ${CMAKE_BINARY_DIR}/Eigen/include/eigen3) 27 | # for g2on 28 | set(EIGEN_INCLUDE_DIR ${CMAKE_BINARY_DIR}/Eigen/include/eigen3) 29 | -------------------------------------------------------------------------------- /cmake/FindEGL.cmake: -------------------------------------------------------------------------------- 1 | 2 | # EGL::EGL 3 | # EGL_FOUND 4 | # EGL_INCLUDE_DIR 5 | # EGL_LIBRARY 6 | 7 | include(FindPackageHandleStandardArgs) 8 | 9 | find_path(EGL_INCLUDE_DIR EGL/egl.h 10 | 11 | PATHS 12 | $ENV{EGL_DIR} 13 | /usr 14 | /usr/local 15 | /sw 16 | /opt/local 17 | 18 | PATH_SUFFIXES 19 | /include 20 | 21 | DOC "The directory where EGL/egl.h resides") 22 | 23 | find_library(EGL_LIBRARY NAMES EGL 24 | 25 | PATHS 26 | $ENV{EGL_DIR} 27 | /usr 28 | /usr/local 29 | /sw 30 | /opt/local 31 | 32 | # authors prefered choice for development 33 | 34 | PATH_SUFFIXES 35 | /lib 36 | /lib64 37 | /lib/x86_64-linux-gnu 38 | 39 | DOC "The EGL library") 40 | 41 | add_library(EGL::EGL SHARED IMPORTED) 42 | 43 | set_target_properties(EGL::EGL PROPERTIES 44 | INTERFACE_INCLUDE_DIRECTORIES "${EGL_INCLUDE_DIR}" 45 | INTERFACE_LINK_LIBRARIES "${EGL_LIBRARY}" 46 | ) 47 | 48 | set_property(TARGET EGL::EGL APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) 49 | set_target_properties(EGL::EGL PROPERTIES 50 | IMPORTED_LOCATION_RELEASE "${EGL_LIBRARY}" 51 | ) 52 | 53 | find_package_handle_standard_args(EGL REQUIRED_VARS EGL_INCLUDE_DIR EGL_LIBRARY) 54 | mark_as_advanced(EGL_INCLUDE_DIR EGL_LIBRARY) 55 | 56 | -------------------------------------------------------------------------------- /cmake/FindGLESv2.cmake: -------------------------------------------------------------------------------- 1 | 2 | # GLESv2::GLESv2 3 | # GLESv2_FOUND 4 | # GLESv2_INCLUDE_DIR 5 | # GLESv2_LIBRARY 6 | 7 | include(FindPackageHandleStandardArgs) 8 | 9 | find_path(GLESv2_INCLUDE_DIR GLES2/gl2.h 10 | 11 | PATHS 12 | $ENV{GLESv2_DIR} 13 | /usr 14 | /usr/local 15 | /sw 16 | /opt/local 17 | 18 | PATH_SUFFIXES 19 | /include 20 | 21 | DOC "The directory where GLESv2/GLESv2.h resides") 22 | 23 | find_library(GLESv2_LIBRARY NAMES GLESv2 24 | 25 | PATHS 26 | $ENV{GLESv2_DIR} 27 | /usr 28 | /usr/local 29 | /sw 30 | /opt/local 31 | 32 | # authors prefered choice for development 33 | 34 | PATH_SUFFIXES 35 | /lib 36 | /lib64 37 | /lib/x86_64-linux-gnu 38 | 39 | DOC "The GLESv2 library") 40 | 41 | add_library(GLESv2::GLESv2 SHARED IMPORTED) 42 | 43 | set_target_properties(GLESv2::GLESv2 PROPERTIES 44 | INTERFACE_INCLUDE_DIRECTORIES "${GLESv2_INCLUDE_DIR}" 45 | INTERFACE_LINK_LIBRARIES "${GLESv2_LIBRARY}" 46 | ) 47 | 48 | set_property(TARGET GLESv2::GLESv2 APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) 49 | set_target_properties(GLESv2::GLESv2 PROPERTIES 50 | IMPORTED_LOCATION_RELEASE "${GLESv2_LIBRARY}" 51 | ) 52 | 53 | find_package_handle_standard_args(GLESv2 REQUIRED_VARS GLESv2_INCLUDE_DIR GLESv2_LIBRARY) 54 | mark_as_advanced(GLESv2_INCLUDE_DIR GLESv2_LIBRARY) 55 | 56 | -------------------------------------------------------------------------------- /cmake/FindGLEW.cmake: -------------------------------------------------------------------------------- 1 | 2 | # GLEW_FOUND 3 | # GLEW_INCLUDE_DIR 4 | # GLEW_LIBRARY 5 | 6 | # GLEW_BINARY (win32 only) 7 | 8 | include(FindPackageHandleStandardArgs) 9 | 10 | find_path(GLEW_INCLUDE_DIR GL/glew.h 11 | 12 | PATHS 13 | $ENV{GLEW_DIR} 14 | /usr 15 | /usr/local 16 | /sw 17 | /opt/local 18 | 19 | PATH_SUFFIXES 20 | /include 21 | 22 | DOC "The directory where GL/glew.h resides") 23 | 24 | if (X64) 25 | set(GLEW_BUILD_DIR Release/x64) 26 | else() 27 | set(GLEW_BUILD_DIR Release/Win32) 28 | endif() 29 | 30 | find_library(GLEW_LIBRARY NAMES GLEW glew glew32 glew32s 31 | 32 | PATHS 33 | $ENV{GLEW_DIR} 34 | /usr 35 | /usr/local 36 | /sw 37 | /opt/local 38 | 39 | # authors prefered choice for development 40 | /build 41 | /build-release 42 | /build-debug 43 | $ENV{GLEW_DIR}/build 44 | $ENV{GLEW_DIR}/build-release 45 | $ENV{GLEW_DIR}/build-debug 46 | 47 | PATH_SUFFIXES 48 | /lib 49 | /lib64 50 | /lib/${GLEW_BUILD_DIR} 51 | 52 | DOC "The GLEW library") 53 | 54 | if(WIN32) 55 | 56 | find_file(GLEW_BINARY NAMES glew32.dll glew32s.dll 57 | 58 | HINTS 59 | ${GLEW_INCLUDE_DIR}/.. 60 | 61 | PATHS 62 | $ENV{GLEW_DIR} 63 | 64 | PATH_SUFFIXES 65 | /bin 66 | /bin/${GLEW_BUILD_DIR} 67 | 68 | DOC "The GLEW binary") 69 | 70 | endif() 71 | 72 | find_package_handle_standard_args(GLEW REQUIRED_VARS GLEW_INCLUDE_DIR GLEW_LIBRARY) 73 | mark_as_advanced(GLEW_INCLUDE_DIR GLEW_LIBRARY) 74 | -------------------------------------------------------------------------------- /cmake/FindHIDAPI.cmake: -------------------------------------------------------------------------------- 1 | 2 | # HIDAPI_FOUND 3 | # HIDAPI_INCLUDE_DIRS 4 | # HIDAPI_LIBRARIES 5 | 6 | include(FindPackageHandleStandardArgs) 7 | 8 | find_path(HIDAPI_INCLUDE_DIRS 9 | NAMES hidapi/hidapi.h 10 | /usr/include 11 | /usr/local/include 12 | /sw/include 13 | /opt/local/include 14 | DOC "The directory where hidapi/hidapi.h resides") 15 | 16 | find_library(HIDAPI_LIBRARIES 17 | NAMES hidapi-hidraw hidapi-libusb 18 | PATHS 19 | /usr/lib64 20 | /usr/local/lib64 21 | /sw/lib64 22 | /opt/loca/lib64 23 | /usr/lib 24 | /usr/local/lib 25 | /sw/lib 26 | /opt/local/lib 27 | DOC "The hidapi library") 28 | 29 | 30 | find_package_handle_standard_args(HIDAPI REQUIRED_VARS HIDAPI_LIBRARIES HIDAPI_INCLUDE_DIRS) 31 | 32 | mark_as_advanced(HIDAPI_INCLUDE_DIR HIDAPI_LIBRARY) 33 | 34 | -------------------------------------------------------------------------------- /cmake/Findclang_tidy.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Findclang_tidy results: 3 | # clang_tidy_FOUND 4 | # clang_tidy_EXECUTABLE 5 | 6 | include(FindPackageHandleStandardArgs) 7 | 8 | find_program(clang_tidy_EXECUTABLE 9 | NAMES 10 | clang-tidy-3.5 11 | clang-tidy-3.6 12 | clang-tidy-3.7 13 | clang-tidy-3.8 14 | clang-tidy-3.9 15 | clang-tidy-4.0 16 | clang-tidy 17 | PATHS 18 | "${CLANG_TIDY_DIR}" 19 | ) 20 | 21 | find_package_handle_standard_args(clang_tidy 22 | FOUND_VAR 23 | clang_tidy_FOUND 24 | REQUIRED_VARS 25 | clang_tidy_EXECUTABLE 26 | ) 27 | 28 | mark_as_advanced(clang_tidy_EXECUTABLE) -------------------------------------------------------------------------------- /cmake/Findcppcheck.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Findcppcheck results: 3 | # cppcheck_FOUND 4 | # cppcheck_EXECUTABLE 5 | 6 | include(FindPackageHandleStandardArgs) 7 | 8 | # work around CMP0053, see http://public.kitware.com/pipermail/cmake/2014-November/059117.html 9 | set(PROGRAMFILES_x86_ENV "PROGRAMFILES(x86)") 10 | 11 | find_program(cppcheck_EXECUTABLE 12 | NAMES 13 | cppcheck 14 | PATHS 15 | "${CPPCHECK_DIR}" 16 | "$ENV{CPPCHECK_DIR}" 17 | "$ENV{PROGRAMFILES}/Cppcheck" 18 | "$ENV{${PROGRAMFILES_x86_ENV}}/Cppcheck" 19 | ) 20 | 21 | find_package_handle_standard_args(cppcheck 22 | FOUND_VAR 23 | cppcheck_FOUND 24 | REQUIRED_VARS 25 | cppcheck_EXECUTABLE 26 | ) 27 | 28 | mark_as_advanced(cppcheck_EXECUTABLE) 29 | -------------------------------------------------------------------------------- /cmake/Findnodejs.cmake: -------------------------------------------------------------------------------- 1 | 2 | # NODEJS_FOUND 3 | # NODEJS_INCLUDE_DIRS 4 | # NODEJS_INCLUDE_DIR 5 | # NODEJS_LIBUV_INCLUDE_DIR 6 | 7 | include(FindPackageHandleStandardArgs) 8 | 9 | find_path(NODEJS_INCLUDE_DIR node.h 10 | $ENV{NODEJS_HOME} 11 | $ENV{NODEJSDIR} 12 | $ENV{NODEJS_HOME}/src 13 | $ENV{NODEJSDIR}/src 14 | /usr/include/nodejs/src 15 | /usr/local/include/nodejs/src 16 | /usr/include 17 | /usr/local/include 18 | /sw/include 19 | /usr/local/include/node 20 | /opt/local/include 21 | DOC "The directory where node.h resides.") 22 | 23 | find_path(NODEJS_LIBUV_INCLUDE_DIR uv.h 24 | $ENV{NODEJS_HOME} 25 | $ENV{NODEJSDIR} 26 | $ENV{NODEJS_HOME}/src 27 | $ENV{NODEJSDIR}/src 28 | $ENV{NODEJS_HOME}/deps/uv/include 29 | $ENV{NODEJSDIR}/deps/uv/include 30 | /usr/include/nodejs/deps/uv/include 31 | /usr/local/include/nodejs/deps/uv/include 32 | /usr/include 33 | /usr/local/include 34 | /sw/include 35 | /opt/local/include 36 | /usr/local/include/node 37 | DOC "The directory where uv.h resides.") 38 | 39 | find_path(NODEJS_LIBV8_INCLUDE_DIR v8.h 40 | $ENV{NODEJS_HOME} 41 | $ENV{NODEJSDIR} 42 | $ENV{NODEJS_HOME}/src 43 | $ENV{NODEJSDIR}/src 44 | $ENV{NODEJS_HOME}/deps/v8/include 45 | $ENV{NODEJSDIR}/deps/v8/include 46 | /usr/include/nodejs/deps/uv/include 47 | /usr/local/include/nodejs/deps/uv/include 48 | /usr/include 49 | /usr/local/include 50 | /sw/include 51 | /opt/local/include 52 | /usr/local/include/node 53 | DOC "The directory where v8.h resides.") 54 | 55 | set(NODEJS_INCLUDE_DIRS ${NODEJS_INCLUDE_DIR} ${NODEJS_LIBUV_INCLUDE_DIR} ${NODEJS_LIBV8_INCLUDE_DIR}) 56 | 57 | find_package_handle_standard_args(NODEJS REQUIRED_VARS NODEJS_INCLUDE_DIRS) 58 | mark_as_advanced(NODEJS_INCLUDE_DIRS) 59 | -------------------------------------------------------------------------------- /cmake/Findyaml-cpp.cmake: -------------------------------------------------------------------------------- 1 | #include(${CMAKE_CURRENT_LIST_DIR}/CrossCompile.cmake) 2 | include(ExternalProject) 3 | 4 | if(NOT YAML_CPP_VERSION) 5 | set( YAML_CPP_VERSION "0.6.3" ) 6 | endif() 7 | 8 | if (NOT TARGET yaml-cpp) 9 | include(ExternalProject) 10 | ExternalProject_Add(yaml-cpp-ext 11 | PREFIX ${CMAKE_BINARY_DIR}/yaml_cpp 12 | URL https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-${YAML_CPP_VERSION}.tar.gz 13 | CMAKE_ARGS 14 | ${CROSS_COMPILE} 15 | -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/yaml-cpp 16 | -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} 17 | -DYAML_CPP_BUILD_TESTS=OFF 18 | ) 19 | add_library(yaml-cpp STATIC IMPORTED GLOBAL) 20 | add_dependencies(yaml-cpp yaml-cpp-ext) 21 | file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/yaml-cpp/include) 22 | set_property(TARGET yaml-cpp PROPERTY INTERFACE_INCLUDE_DIRECTORIES 23 | ${CMAKE_BINARY_DIR}/yaml-cpp/include 24 | ) 25 | 26 | set_target_properties(yaml-cpp PROPERTIES 27 | IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/yaml-cpp/lib/${CMAKE_STATIC_LIBRARY_PREFIX}yaml-cpp${CMAKE_STATIC_LIBRARY_SUFFIX}) 28 | endif() 29 | 30 | set(YAML_CPP_INCLUDE_DIR ${CMAKE_BINARY_DIR}/yaml-cpp/include) 31 | -------------------------------------------------------------------------------- /cmake/GenerateTemplateExportHeader.cmake: -------------------------------------------------------------------------------- 1 | 2 | # Creates an export header similar to generate_export_header, but for templates. 3 | # The main difference is that for MSVC, templates must not get exported. 4 | # When the file ${export_file} is included in source code, the macro ${target_id}_TEMPLATE_API 5 | # may get used to define public visibility for templates on GCC and Clang platforms. 6 | function(generate_template_export_header target target_id export_file) 7 | if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC") 8 | configure_file(${PROJECT_SOURCE_DIR}/source/codegeneration/mars_msvc_api.h.in ${CMAKE_CURRENT_BINARY_DIR}/${export_file}) 9 | else() 10 | configure_file(${PROJECT_SOURCE_DIR}/source/codegeneration/mars_api.h.in ${CMAKE_CURRENT_BINARY_DIR}/${export_file}) 11 | endif() 12 | endfunction() 13 | -------------------------------------------------------------------------------- /cmake/GetGitRevisionDescription.cmake.in: -------------------------------------------------------------------------------- 1 | # 2 | # Internal file for GetGitRevisionDescription.cmake 3 | # 4 | # Requires CMake 2.6 or newer (uses the 'function' command) 5 | # 6 | # Original Author: 7 | # 2009-2010 Ryan Pavlik 8 | # http://academic.cleardefinition.com 9 | # Iowa State University HCI Graduate Program/VRAC 10 | # 11 | # Copyright Iowa State University 2009-2010. 12 | # Distributed under the Boost Software License, Version 1.0. 13 | # (See accompanying file LICENSE_1_0.txt or copy at 14 | # http://www.boost.org/LICENSE_1_0.txt) 15 | 16 | set(HEAD_HASH) 17 | set(HEAD_REF) 18 | 19 | if (NOT EXISTS "@HEAD_FILE@") 20 | return() 21 | endif() 22 | 23 | file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024) 24 | 25 | string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS) 26 | if(HEAD_CONTENTS MATCHES "ref") 27 | # named branch 28 | string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}") 29 | if(EXISTS "@GIT_DIR@/${HEAD_REF}") 30 | configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) 31 | elseif(EXISTS "@GIT_DIR@/packed-refs") 32 | configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY) 33 | file(READ "@GIT_DATA@/packed-refs" PACKED_REFS) 34 | if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}") 35 | set(HEAD_HASH "${CMAKE_MATCH_1}") 36 | endif() 37 | endif() 38 | else() 39 | # detached HEAD 40 | configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY) 41 | endif() 42 | 43 | if(NOT HEAD_HASH AND EXISTS "@GIT_DATA@/head-ref") 44 | file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024) 45 | string(STRIP "${HEAD_HASH}" HEAD_HASH) 46 | endif() 47 | -------------------------------------------------------------------------------- /cmake/RuntimeDependencies.cmake: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # Default dependencies for the runtime-package 4 | # 5 | 6 | # Install 3rd-party runtime dependencies into runtime-component 7 | # install(FILES ... COMPONENT runtime) 8 | 9 | 10 | # 11 | # Full dependencies for self-contained packages 12 | # 13 | 14 | if(OPTION_SELF_CONTAINED) 15 | 16 | # Install 3rd-party runtime dependencies into runtime-component 17 | # install(FILES ... COMPONENT runtime) 18 | 19 | endif() 20 | -------------------------------------------------------------------------------- /cmake/SophusConfig.cmake: -------------------------------------------------------------------------------- 1 | #include(${CMAKE_CURRENT_LIST_DIR}/CrossCompile.cmake) 2 | include(ExternalProject) 3 | 4 | if(NOT Sophus_VERSION) 5 | set( Sophus_VERSION "1.0.0" ) 6 | endif() 7 | 8 | #if (NOT TARGET Kindr) 9 | include(ExternalProject) 10 | externalproject_add(Sophus-ext 11 | PREFIX ${CMAKE_BINARY_DIR}/Sophus 12 | GIT_REPOSITORY "https://github.com/strasdat/Sophus.git" 13 | GIT_TAG "13fb3288311485dc94e3226b69c9b59cd06ff94e" 14 | UPDATE_COMMAND "" 15 | PATCH_COMMAND "" 16 | CMAKE_ARGS 17 | ${CROSS_COMPILE} 18 | -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/Sophus 19 | -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} 20 | ) 21 | 22 | 23 | add_library(Sophus INTERFACE IMPORTED GLOBAL) 24 | add_dependencies(Sophus Sophus-ext) 25 | file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Sophus/include) 26 | set_property(TARGET Sophus PROPERTY INTERFACE_INCLUDE_DIRECTORIES 27 | ${CMAKE_BINARY_DIR}/Sophus/include 28 | ) 29 | #endif() 30 | 31 | set(SOPHUS_INCLUDE_DIR ${CMAKE_BINARY_DIR}/Sophus/include) 32 | 33 | -------------------------------------------------------------------------------- /cmake/kindrConfig.cmake: -------------------------------------------------------------------------------- 1 | #include(${CMAKE_CURRENT_LIST_DIR}/CrossCompile.cmake) 2 | include(ExternalProject) 3 | 4 | if(NOT kindr_VERSION) 5 | set( kindr_VERSION "1.0" ) 6 | endif() 7 | 8 | #if (NOT TARGET Kindr) 9 | include(ExternalProject) 10 | externalproject_add(kindr-ext 11 | PREFIX ${CMAKE_BINARY_DIR}/kindr 12 | GIT_REPOSITORY "https://github.com/ethz-asl/kindr.git" 13 | GIT_TAG "1639d2c85cfb088f96b1c9be2e628fafcaa87607" 14 | UPDATE_COMMAND "" 15 | PATCH_COMMAND "" 16 | CMAKE_ARGS 17 | ${CROSS_COMPILE} 18 | -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/kindr 19 | -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} 20 | ) 21 | 22 | 23 | add_library(kindr INTERFACE IMPORTED GLOBAL) 24 | add_dependencies(kindr kindr-ext) 25 | file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/kindr/include) 26 | set_property(TARGET kindr PROPERTY INTERFACE_INCLUDE_DIRECTORIES 27 | ${CMAKE_BINARY_DIR}/kindr/include 28 | ) 29 | #endif() 30 | 31 | set(KINDR_INCLUDE_DIR ${CMAKE_BINARY_DIR}/kindr/include) 32 | 33 | -------------------------------------------------------------------------------- /data/README.md: -------------------------------------------------------------------------------- 1 | This is the runtime data folder for your project. 2 | 3 | Use it only for data that is needed and loaded at runtime by your application. It is installed and shipped during packaging of your application. 4 | 5 | Other data files such as desktop icons, init scripts, or files needed for packaging, belong into the deploy directory. 6 | 7 | Have a look at the cmake-init documentation to learn how your application is able to locate its data folder at runtime. 8 | -------------------------------------------------------------------------------- /deploy/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # Target 'pack' 4 | # 5 | 6 | add_custom_target(pack) 7 | set_target_properties(pack PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD 1) 8 | 9 | 10 | # Install additional runtime dependencies 11 | include(${PROJECT_SOURCE_DIR}/cmake/RuntimeDependencies.cmake) 12 | 13 | 14 | # 15 | # Packages 16 | # 17 | 18 | include(packages/pack-mars_lib.cmake) 19 | 20 | 21 | # 22 | # Target 'component_install' 23 | # 24 | 25 | add_custom_target( 26 | component_install 27 | COMMAND make preinstall 28 | COMMAND ${CMAKE_COMMAND} -P ${PROJECT_SOURCE_DIR}/cmake/ComponentInstall.cmake 29 | WORKING_DIRECTORY ${PROJECT_BINARY_DIR} 30 | ) 31 | -------------------------------------------------------------------------------- /deploy/images/logo.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aau-cns/mars_lib/2abe2576fe7ff79cd574be6c5c6d7b56a10ead38/deploy/images/logo.bmp -------------------------------------------------------------------------------- /deploy/images/logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aau-cns/mars_lib/2abe2576fe7ff79cd574be6c5c6d7b56a10ead38/deploy/images/logo.ico -------------------------------------------------------------------------------- /deploy/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aau-cns/mars_lib/2abe2576fe7ff79cd574be6c5c6d7b56a10ead38/deploy/images/logo.png -------------------------------------------------------------------------------- /deploy/scripts/docker_application_test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "Copy Source Files..." 3 | cp -r source/ test/ 4 | cd test 5 | echo "Delete temporary test files to enforce unzip of original data..." 6 | rm -rf source/tests/test_data 7 | echo "Building the Appliaction..." 8 | rm -rf build 9 | mkdir build && cd build 10 | cmake ../ && make -j 11 | echo "Running Google Tests" 12 | make test 13 | -------------------------------------------------------------------------------- /deploy/ubuntu-ppa/debian/changelog: -------------------------------------------------------------------------------- 1 | 2 | cmake-init (2.0.0-0) UNRELEASED; urgency=low 3 | 4 | * Initial release. 5 | 6 | -- Willy Scheibel Tue, 31 Jan 2017 13:30:00 +0100 7 | -------------------------------------------------------------------------------- /deploy/ubuntu-ppa/debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /deploy/ubuntu-ppa/debian/control: -------------------------------------------------------------------------------- 1 | Source: cmake-init 2 | Section: misc 3 | Priority: optional 4 | Maintainer: Willy Scheibel 5 | Build-Depends: build-essential, cmake, qtbase5-dev, doxygen, graphviz 6 | Standards-Version: 3.8.0 7 | 8 | Package: libcmake-init 9 | Architecture: any 10 | Depends: 11 | Homepage: https://github.com/cginternals/cmake-init 12 | Description: Template for reliable, cross-platform C++ project setup using cmake. 13 | 14 | Package: libcmake-init-dev 15 | Architecture: any 16 | Depends: libcmake-init 17 | Homepage: https://github.com/cginternals/cmake-init 18 | Description: Template for reliable, cross-platform C++ project setup using cmake. 19 | 20 | Package: libcmake-init-examples-data 21 | Architecture: any 22 | Homepage: https://github.com/cginternals/cmake-init 23 | Description: Template for reliable, cross-platform C++ project setup using cmake. 24 | 25 | Package: libcmake-init-examples 26 | Architecture: any 27 | Depends: libcmake-init, libcmake-init-examples-data, libqt5core5a 28 | Homepage: https://github.com/cginternals/cmake-init 29 | Description: Template for reliable, cross-platform C++ project setup using cmake. 30 | 31 | Package: libcmake-init-docs 32 | Architecture: any 33 | Homepage: https://github.com/cginternals/cmake-init 34 | Description: Template for reliable, cross-platform C++ project setup using cmake. 35 | 36 | Package: libcmake-init-dbg 37 | Architecture: any 38 | Depends: libcmake-init, libcmake-init-dev 39 | Homepage: https://github.com/cginternals/cmake-init 40 | Description: Template for reliable, cross-platform C++ project setup using cmake. 41 | 42 | Package: libcmake-init-all 43 | Architecture: any 44 | Depends: libcmake-init, libcmake-init-dev, libcmake-init-docs, libcmake-init-examples 45 | Homepage: https://github.com/cginternals/cmake-init 46 | Description: Template for reliable, cross-platform C++ project setup using cmake. -------------------------------------------------------------------------------- /deploy/ubuntu-ppa/debian/copyright: -------------------------------------------------------------------------------- 1 | This package was debianised by Willy Scheibel on 2 | Tue, 31 Jan 2017 13:30:00 +0100 3 | 4 | It was downloaded from: 5 | 6 | https://github.com/cginternals/cmake-init 7 | 8 | Upstream Author: 9 | 10 | CG Internals 11 | 12 | Copyright: 13 | 14 | Copyright (c) 2015-2017 CG Internals GmbH and Computer Graphics Systems Group at the Hasso-Plattner-Institute, Germany. 15 | 16 | License: 17 | 18 | This software is available to you under the terms of the MIT license, see "https://github.com/cginternals/cmake-init/blob/master/LICENSE". 19 | -------------------------------------------------------------------------------- /deploy/ubuntu-ppa/debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /deploy/ubuntu-ppa/recipe.txt: -------------------------------------------------------------------------------- 1 | # git-build-recipe format 0.4 deb-version {debupstream}+{revno} 2 | lp:cmake-init 3 | nest-part packaging lp:cmake-init deploy/ubuntu-ppa/debian debian master 4 | -------------------------------------------------------------------------------- /dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:22.04 2 | 3 | LABEL maintainer="Christian Brommer " 4 | LABEL description="Mars Test Environment" 5 | 6 | ENV DEBIAN_FRONTEND noninteractive 7 | 8 | RUN apt-get update && apt-get install --no-install-recommends -y \ 9 | vim \ 10 | g++ \ 11 | build-essential \ 12 | cmake \ 13 | libgtest-dev \ 14 | git \ 15 | doxygen \ 16 | graphviz \ 17 | && rm -rf /var/lib/apt/lists/* 18 | 19 | COPY ./deploy/scripts/docker_application_test.sh / 20 | 21 | CMD /docker_application_test.sh 22 | -------------------------------------------------------------------------------- /docs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # Target 'docs' 4 | # 5 | 6 | if(NOT OPTION_BUILD_DOCS) 7 | return() 8 | endif() 9 | 10 | add_custom_target(docs) 11 | 12 | 13 | # 14 | # Documentation 15 | # 16 | 17 | add_subdirectory(api-docs) 18 | 19 | -------------------------------------------------------------------------------- /docs/api-docs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # Find doxygen 4 | # 5 | 6 | find_package(Doxygen) 7 | if(NOT DOXYGEN_FOUND) 8 | message(STATUS "Disabled generation of doxygen documentation (missing doxygen).") 9 | return() 10 | endif() 11 | 12 | 13 | # 14 | # Target name 15 | # 16 | 17 | set(target api-docs) 18 | message(STATUS "Doc ${target}") 19 | 20 | set(DEPENDENCIES "${META_PROJECT_NAME}::mars") 21 | # 22 | # Input file 23 | # 24 | 25 | set(doxyfile_in doxyfile.in) 26 | 27 | 28 | # 29 | # Create documentation 30 | # 31 | 32 | # Set project variables 33 | set(doxyfile "${CMAKE_CURRENT_BINARY_DIR}/doxyfile") 34 | set(doxyfile_directory "${CMAKE_CURRENT_BINARY_DIR}/html") 35 | set(doxyfile_html "${doxyfile_directory}/index.html") 36 | 37 | # Get filename and path of doxyfile 38 | get_filename_component(name ${doxyfile_in} NAME) 39 | get_filename_component(path ${doxyfile_in} PATH) 40 | if(NOT path) 41 | set(path ${CMAKE_CURRENT_SOURCE_DIR}) 42 | endif() 43 | 44 | # Configure doxyfile (if it is a real doxyfile already, it should simply copy the file) 45 | set(DOXYGEN_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) 46 | configure_file(${doxyfile_in} ${doxyfile}) 47 | 48 | # Invoke doxygen 49 | add_custom_command( 50 | OUTPUT ${doxyfile_html} 51 | DEPENDS ${doxyfile} ${DEPENDENCIES} 52 | WORKING_DIRECTORY ${path} 53 | COMMAND ${CMAKE_COMMAND} -E copy_directory ${path} ${doxyfile_directory} # ToDO, configure doxygen to use source as is 54 | COMMAND ${DOXYGEN} \"${doxyfile}\" 55 | COMMENT "Creating doxygen documentation." 56 | ) 57 | 58 | # Declare target 59 | add_custom_target(${target} ALL DEPENDS ${doxyfile_html}) 60 | add_dependencies(docs ${target}) 61 | 62 | 63 | # 64 | # Deployment 65 | # 66 | 67 | install( 68 | DIRECTORY ${doxyfile_directory} 69 | DESTINATION ${INSTALL_DOC} 70 | COMPONENT docs 71 | ) 72 | -------------------------------------------------------------------------------- /mars_lib-config.cmake: -------------------------------------------------------------------------------- 1 | 2 | # This config script tries to locate the project either in its source tree 3 | # or from an install location. 4 | # 5 | # Please adjust the list of submodules to search for. 6 | 7 | 8 | # List of modules 9 | set(MODULE_NAMES 10 | mars 11 | ) 12 | 13 | 14 | # Macro to search for a specific module 15 | macro(find_module FILENAME) 16 | if(EXISTS "${FILENAME}") 17 | set(MODULE_FOUND TRUE) 18 | include("${FILENAME}") 19 | endif() 20 | endmacro() 21 | 22 | # Macro to search for all modules 23 | macro(find_modules PREFIX) 24 | foreach(module_name ${MODULE_NAMES}) 25 | if(TARGET ${module_name}) 26 | set(MODULE_FOUND TRUE) 27 | else() 28 | find_module("${CMAKE_CURRENT_LIST_DIR}/${PREFIX}/${module_name}/${module_name}-export.cmake") 29 | endif() 30 | endforeach(module_name) 31 | endmacro() 32 | 33 | 34 | # Try install location 35 | set(MODULE_FOUND FALSE) 36 | find_modules("cmake") 37 | 38 | if(MODULE_FOUND) 39 | return() 40 | endif() 41 | 42 | # Try common build locations 43 | if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") 44 | find_modules("build-debug/cmake") 45 | find_modules("build/cmake") 46 | else() 47 | find_modules("build/cmake") 48 | find_modules("build-debug/cmake") 49 | endif() 50 | 51 | # Signal success/failure to CMake 52 | set(template_FOUND ${MODULE_FOUND}) 53 | -------------------------------------------------------------------------------- /resources/a-astro-space-font.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aau-cns/mars_lib/2abe2576fe7ff79cd574be6c5c6d7b56a10ead38/resources/a-astro-space-font.zip -------------------------------------------------------------------------------- /resources/buffer_structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aau-cns/mars_lib/2abe2576fe7ff79cd574be6c5c6d7b56a10ead38/resources/buffer_structure.png -------------------------------------------------------------------------------- /resources/cov_segmentation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aau-cns/mars_lib/2abe2576fe7ff79cd574be6c5c6d7b56a10ead38/resources/cov_segmentation.png -------------------------------------------------------------------------------- /resources/mars_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aau-cns/mars_lib/2abe2576fe7ff79cd574be6c5c6d7b56a10ead38/resources/mars_logo.png -------------------------------------------------------------------------------- /resources/modification_levels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aau-cns/mars_lib/2abe2576fe7ff79cd574be6c5c6d7b56a10ead38/resources/modification_levels.png -------------------------------------------------------------------------------- /resources/simple_class_structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aau-cns/mars_lib/2abe2576fe7ff79cd574be6c5c6d7b56a10ead38/resources/simple_class_structure.png -------------------------------------------------------------------------------- /resources/uml/seq_initialization.md: -------------------------------------------------------------------------------- 1 | 2 | ```plantuml 3 | @startuml 4 | 5 | skinparam monochrome true 6 | title Initialization by Propagation Sensor 7 | 8 | actor PropSensor 9 | participant MeasurementCB 10 | actor InitCB 11 | participant Core 12 | participant Buffer 13 | participant BufferPrior 14 | participant CoreStates 15 | 16 | PropSensor->MeasurementCB: Measurement 17 | MeasurementCB->>Core: ProcessMeasurement 18 | 19 | activate Core 20 | 21 | Core->>Core: CoreInitialized? 22 | 23 | alt if not initialized 24 | Core->>BufferPrior: Store Measurement 25 | end 26 | 27 | deactivate Core 28 | 29 | InitCB->>Core: Initialize Core 30 | activate Core 31 | 32 | Core->>BufferPrior ++: GetLastEntry 33 | BufferPrior->>Core --: LatestEntry 34 | 35 | opt pre process data 36 | Core->>CoreStates ++: PreProcessData 37 | CoreStates->>Core --: PreProcessedSystemInput 38 | end 39 | 40 | Core->>Buffer: StoreMeasurement 41 | Core->>CoreStates ++: InitializeState 42 | CoreStates->>Core --: InitializedState 43 | Core->>CoreStates ++: InitializeCov 44 | CoreStates->>Core --: InitializedCov 45 | Core->>Buffer: Store InitState 46 | Core->>Core: Set Core to initialized 47 | 48 | deactivate Core 49 | 50 | @enduml 51 | ``` 52 | -------------------------------------------------------------------------------- /resources/uml/seq_initialization.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aau-cns/mars_lib/2abe2576fe7ff79cd574be6c5c6d7b56a10ead38/resources/uml/seq_initialization.png -------------------------------------------------------------------------------- /resources/uml/seq_propagation_routine.md: -------------------------------------------------------------------------------- 1 | 2 | ```plantuml 3 | @startuml 4 | 5 | skinparam monochrome true 6 | title Propagation Routine 7 | 8 | actor PropSensor 9 | participant MeasurementCB 10 | participant Core 11 | participant Buffer 12 | participant CoreStates 13 | 14 | PropSensor->MeasurementCB: Measurement 15 | MeasurementCB->>Core: ProcessMeasurement 16 | activate Core 17 | 18 | opt check meas 19 | Core->>Buffer++: get_oldest_state 20 | Buffer->>Core--: oldest_tate 21 | Core->>Buffer++: get_latest_state 22 | Buffer->>Core--: latest_state 23 | Core->>Buffer++: get_latest_entry 24 | Buffer->>Core--: latest_entry 25 | 26 | Core->>Core: Compare Timestamps 27 | end 28 | 29 | alt not using meas 30 | Core->>Core: return 31 | else use meas 32 | Core->>Buffer: add_measurement 33 | Core->>Core: Check for out of order 34 | Core->>Core: Check for propagation sensor 35 | Core->>Buffer++: get_latest_state 36 | Buffer->>Core--: latest_state 37 | Core->>Core: perform_core_state_propagation 38 | 39 | activate Core 40 | Core->>CoreStates++: PropagateMean 41 | CoreStates->>Core--: new_mean 42 | Core->>CoreStates++: PropagateCovariance 43 | CoreStates->>Core--: new_covariance 44 | Core->>Buffer: add NewCoreState 45 | Core->>Core: return 46 | deactivate Core 47 | end 48 | 49 | 'opt Normal Sensor 50 | ' Core->>Sensor: Process Measurement 51 | 'end 52 | ' opt Propagation Sensor 53 | ' Core->>CoreStates: Process Measurement 54 | 'end 55 | 56 | @enduml 57 | ``` 58 | -------------------------------------------------------------------------------- /resources/uml/seq_propagation_routine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aau-cns/mars_lib/2abe2576fe7ff79cd574be6c5c6d7b56a10ead38/resources/uml/seq_propagation_routine.png -------------------------------------------------------------------------------- /resources/uml/seq_sensor_update.md: -------------------------------------------------------------------------------- 1 | 2 | ```plantuml 3 | @startuml 4 | 5 | skinparam monochrome true 6 | title Update Sensor Initialization 7 | 8 | participant EKF 9 | actor Sensor 10 | participant MeasurementCB 11 | participant CoreLogic 12 | participant Buffer 13 | 14 | Sensor->MeasurementCB: Measurement 15 | MeasurementCB->>CoreLogic: ProcessMeasurement 16 | 17 | activate CoreLogic 18 | 19 | opt check meas 20 | CoreLogic->>Buffer++: get_oldest_state 21 | Buffer->>CoreLogic--: oldest_tate 22 | CoreLogic->>Buffer++: get_latest_state 23 | Buffer->>CoreLogic--: latest_state 24 | CoreLogic->>Buffer++: get_latest_entry 25 | Buffer->>CoreLogic--: latest_entry 26 | CoreLogic->>CoreLogic: Compare Timestamps 27 | end 28 | 29 | alt do not use measurement 30 | CoreLogic->>CoreLogic: return 31 | else use measurement 32 | CoreLogic->>CoreLogic: Check for OutOfOrder 33 | CoreLogic->>Buffer: add_measurement 34 | CoreLogic->>CoreLogic: Check for propagation sensor 35 | CoreLogic->>Buffer++: get_closest_state 36 | Buffer->>CoreLogic--: closest_state 37 | CoreLogic->>Sensor++: is_initialized? 38 | Sensor->>CoreLogic--: init_status 39 | 40 | alt sensor is initialized 41 | CoreLogic->>Sensor++: perform_sensor_update 42 | 43 | Sensor->>EKF++: calculate_correction 44 | EKF->>Sensor--: state_correction 45 | Sensor->>EKF++: calculate_cov_update 46 | EKF->>Sensor--: updated_cov 47 | 48 | Sensor->>CoreLogic--: corrected_state_and_cov 49 | CoreLogic->>Buffer: add_state_sorted 50 | 51 | else sensor is not initialized 52 | CoreLogic->>Sensor++: Initialize 53 | Sensor->>CoreLogic--: Initialized_state_and_cov 54 | CoreLogic->>Buffer: add_state_sorted 55 | end 56 | 57 | deactivate CoreLogic 58 | end 59 | 60 | @enduml 61 | ``` 62 | -------------------------------------------------------------------------------- /resources/uml/seq_sensor_update.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aau-cns/mars_lib/2abe2576fe7ff79cd574be6c5c6d7b56a10ead38/resources/uml/seq_sensor_update.png -------------------------------------------------------------------------------- /resources/uml/uml_prototype.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aau-cns/mars_lib/2abe2576fe7ff79cd574be6c5c6d7b56a10ead38/resources/uml/uml_prototype.png -------------------------------------------------------------------------------- /source/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # Configuration for all sub-projects 4 | # 5 | 6 | # Generate version-header 7 | configure_file(version.h.in ${CMAKE_CURRENT_BINARY_DIR}/include/${META_PROJECT_NAME}/${META_PROJECT_NAME}-version.h) 8 | 9 | # 10 | # Configuration of basic libraries 11 | # 12 | find_package(Boost REQUIRED) 13 | find_package(Eigen REQUIRED) 14 | find_package(yaml-cpp REQUIRED) 15 | #find_package(kindr REQUIRED) 16 | #find_package(Sophus REQUIRED) 17 | 18 | message(" **************************************") 19 | message(" --- Main Dependencies:") 20 | message(" * Eigen: ${EIGEN3_INCLUDE_DIR}, ${Eigen_VERSION} ") 21 | message(" * YAML_CPP: ${YAML_CPP_INCLUDE_DIR}, ${YAML_CPP_VERSION} ") 22 | message(" * Boost: ${BOOST_INCLUDE_DIRS}, ${BOOST_VERSION} ") 23 | #message(" * kindr: ${KINDR_INCLUDE_DIR}, ${kindr_VERSION} ") 24 | #message(" * Sophus: ${SOPHUS_INCLUDE_DIR}, ${Sophus_VERSION} ") 25 | message(" **************************************") 26 | # 27 | # Sub-projects 28 | # 29 | 30 | # Libraries 31 | set(IDE_FOLDER "") 32 | add_subdirectory(mars) 33 | 34 | # Examples 35 | set(IDE_FOLDER "Examples") 36 | add_subdirectory(examples) 37 | 38 | # Tests 39 | if(OPTION_BUILD_TESTS) 40 | set(IDE_FOLDER "Tests") 41 | add_subdirectory(tests) 42 | endif() 43 | 44 | 45 | # 46 | # Deployment 47 | # 48 | 49 | # Deploy generated headers 50 | install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/${META_PROJECT_NAME} DESTINATION include COMPONENT dev) 51 | -------------------------------------------------------------------------------- /source/codegeneration/mars_api.h.in: -------------------------------------------------------------------------------- 1 | 2 | #ifndef ${target_id}_MARS_API_H 3 | #define ${target_id}_MARS_API_H 4 | 5 | #include <${target}/${target}_export.h> 6 | 7 | #ifdef ${target_id}_STATIC_DEFINE 8 | # define ${target_id}_MARS_API 9 | #else 10 | # ifndef ${target_id}_MARS_API 11 | # ifdef ${target_id}_EXPORTS 12 | /* We are building this library */ 13 | # define ${target_id}_MARS_API __attribute__((visibility("default"))) 14 | # else 15 | /* We are using this library */ 16 | # define ${target_id}_MARS_API __attribute__((visibility("default"))) 17 | # endif 18 | # endif 19 | 20 | #endif 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /source/codegeneration/mars_msvc_api.h.in: -------------------------------------------------------------------------------- 1 | 2 | #ifndef ${target_id}_MARS_API_H 3 | #define ${target_id}_MARS_API_H 4 | 5 | #include <${target}/${target}_export.h> 6 | 7 | #ifdef ${target_id}_STATIC_DEFINE 8 | # define ${target_id}_MARS_API 9 | #else 10 | # ifndef ${target_id}_MARS_API 11 | # ifdef ${target_id}_EXPORTS 12 | /* We are building this library */ 13 | # define ${target_id}_MARS_API 14 | # else 15 | /* We are using this library */ 16 | # define ${target_id}_MARS_API 17 | # endif 18 | # endif 19 | 20 | #endif 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /source/examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | # Check if examples are enabled 3 | if(NOT OPTION_BUILD_EXAMPLES) 4 | return() 5 | endif() 6 | 7 | # Example applications 8 | add_subdirectory(mars_cmd) 9 | add_subdirectory(mars_thl) 10 | add_subdirectory(mars_insane_dataset) 11 | -------------------------------------------------------------------------------- /source/examples/mars_cmd/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # External dependencies 4 | # 5 | 6 | # find_package(THIRDPARTY REQUIRED) 7 | 8 | 9 | # 10 | # Executable name and options 11 | # 12 | 13 | # Target name 14 | set(target mars_cmd) 15 | 16 | # Exit here if required dependencies are not met 17 | message(STATUS "Example ${target}") 18 | 19 | 20 | # 21 | # Sources 22 | # 23 | 24 | set(sources 25 | main.cpp 26 | ) 27 | 28 | 29 | # 30 | # Create executable 31 | # 32 | 33 | # Build executable 34 | add_executable(${target} 35 | MACOSX_BUNDLE 36 | ${sources} 37 | ) 38 | 39 | # Create namespaced alias 40 | add_executable(${META_PROJECT_NAME}::${target} ALIAS ${target}) 41 | 42 | 43 | # 44 | # Project options 45 | # 46 | 47 | set_target_properties(${target} 48 | PROPERTIES 49 | ${DEFAULT_PROJECT_OPTIONS} 50 | FOLDER "${IDE_FOLDER}" 51 | ) 52 | 53 | 54 | # 55 | # Include directories 56 | # 57 | 58 | target_include_directories(${target} 59 | PRIVATE 60 | ${DEFAULT_INCLUDE_DIRECTORIES} 61 | ${PROJECT_BINARY_DIR}/source/include 62 | ) 63 | 64 | 65 | # 66 | # Libraries 67 | # 68 | 69 | target_link_libraries(${target} 70 | PRIVATE 71 | ${DEFAULT_LIBRARIES} 72 | ${META_PROJECT_NAME}::mars 73 | ) 74 | 75 | 76 | # 77 | # Compile definitions 78 | # 79 | 80 | target_compile_definitions(${target} 81 | PRIVATE 82 | ${DEFAULT_COMPILE_DEFINITIONS} 83 | ) 84 | 85 | 86 | # 87 | # Compile options 88 | # 89 | 90 | target_compile_options(${target} 91 | PRIVATE 92 | ${DEFAULT_COMPILE_OPTIONS} 93 | ) 94 | 95 | 96 | # 97 | # Linker options 98 | # 99 | 100 | target_link_libraries(${target} 101 | PRIVATE 102 | ${DEFAULT_LINKER_OPTIONS} 103 | ) 104 | 105 | 106 | # 107 | # Target Health 108 | # 109 | 110 | perform_health_checks( 111 | ${target} 112 | ${sources} 113 | ) 114 | 115 | 116 | # 117 | # Deployment 118 | # 119 | 120 | # Executable 121 | install(TARGETS ${target} 122 | RUNTIME DESTINATION ${INSTALL_BIN} COMPONENT examples 123 | BUNDLE DESTINATION ${INSTALL_BIN} COMPONENT examples 124 | ) 125 | -------------------------------------------------------------------------------- /source/examples/mars_cmd/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2020 Christian Brommer, Control of Networked Systems, Universit?t Klagenfurt, Austria 2 | // You can contact the author at 3 | // 4 | // All rights reserved. 5 | // 6 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 7 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 8 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 9 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 10 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 11 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 12 | // DEALINGS IN THE SOFTWARE. 13 | 14 | #include 15 | 16 | int main(int /*argc*/, char** /*argv[]*/) 17 | { 18 | // Print library info 19 | // mars::Vector3_t v; 20 | 21 | // Calculate and print fibonacci number 22 | std::cout << "MaRS library" << std::endl; 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /source/examples/mars_insane_dataset/mars_insane_dataset_settings.h.in: -------------------------------------------------------------------------------- 1 | #define ${META_PROJECT_ID}_INSANE_DATASET_DATA_PATH "@INSANE_DATASET_DATA_DIR@" 2 | -------------------------------------------------------------------------------- /source/examples/mars_thl/sim_data/thl/parameter.yaml: -------------------------------------------------------------------------------- 1 | traj_file_name: "traj.csv" # the files need to be placed in source/examples/mars_thl/sim_data/thl 2 | pose_file_name: "pose_sensor_1.csv" 3 | imu_n_w: [0.013, 0.013, 0.013] # Noise STD [rad/s] 4 | imu_n_bw: [0.0013, 0.0013, 0.0013] 5 | imu_n_a: [0.083, 0.083, 0.083] # Noise STD [m/s^2] 6 | imu_n_ba: [0.0083, 0.0083, 0.0083] 7 | -------------------------------------------------------------------------------- /source/examples/mars_thl/thl_example_data_settings.h.in: -------------------------------------------------------------------------------- 1 | #define ${META_PROJECT_ID}_THL_EXAMPLE_DATA_PATH "@THL_EXAMPLE_DATA_DIR@" 2 | -------------------------------------------------------------------------------- /source/mars/include/mars/data_utils/filesystem.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #include "filesystem.h" 12 | #include 13 | #include 14 | #include 15 | 16 | namespace mars 17 | { 18 | filesystem::filesystem() = default; 19 | 20 | bool filesystem::IsDir(const std::string& name) 21 | { 22 | struct stat info 23 | { 24 | }; 25 | 26 | if (stat(name.c_str(), &info) != 0) 27 | { 28 | return false; 29 | } 30 | else if (info.st_mode & S_IFDIR) // Directory 31 | { 32 | return true; 33 | } 34 | 35 | return false; 36 | } 37 | 38 | bool filesystem::IsFile(const std::string& name) 39 | { 40 | struct stat info 41 | { 42 | }; 43 | 44 | if (stat(name.c_str(), &info) != 0) 45 | { 46 | return false; 47 | } 48 | else if (info.st_mode & S_IFREG) // Regular file 49 | { 50 | return true; 51 | } 52 | 53 | return false; 54 | } 55 | 56 | bool filesystem::MakeDir(const std::string& name) 57 | { 58 | mode_t mode = 0755; 59 | 60 | if (IsDir(name)) 61 | { 62 | std::cout << "[Info] Directory " << name << " already exists" << std::endl; 63 | return true; 64 | } 65 | else 66 | { 67 | int ret = mkdir(name.c_str(), mode); 68 | 69 | if (ret == 0) 70 | { 71 | std::cout << "[Info] Created directory " << name << std::endl; 72 | return true; 73 | } 74 | else 75 | { 76 | std::cout << "[Warning] Could not created directory " << name << " error code " << ret << std::endl; 77 | return false; 78 | } 79 | } 80 | } 81 | } // namespace mars 82 | -------------------------------------------------------------------------------- /source/mars/include/mars/data_utils/filesystem.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef FILESYSTEM_H 12 | #define FILESYSTEM_H 13 | 14 | #include 15 | 16 | namespace mars 17 | { 18 | /// 19 | /// \brief The filesystem class implements a wrapper for file or directory interaction 20 | /// 21 | /// If needed, adaptations to a specific OS can be made here. 22 | /// 23 | class filesystem 24 | { 25 | public: 26 | filesystem(); 27 | 28 | /// 29 | /// \brief filesystem::IsFile Check if the given path results in a file 30 | /// \param name string containing the absolute file path 31 | /// \return true if file, false if not a file 32 | /// 33 | static bool IsFile(const std::string& name); 34 | 35 | /// 36 | /// \brief filesystem::IsDir Check if the given path results in an directory 37 | /// \param name string containing the absolute directory path 38 | /// \return true if directory, false if not a directory 39 | /// 40 | static bool IsDir(const std::string& name); 41 | 42 | /// 43 | /// \brief filesystem::MakeDir Create a directory if it does not exist 44 | /// \param name string containing the absolute directory path 45 | /// \return true if folder was created or already existed, false if it could not be created 46 | /// 47 | static bool MakeDir(const std::string& name); 48 | }; 49 | } // namespace mars 50 | 51 | #endif // FILESYSTEM_H 52 | -------------------------------------------------------------------------------- /source/mars/include/mars/data_utils/read_baro_data.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef READ_BAROMETER_DATA_H 12 | #define READ_BAROMETER_DATA_H 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | namespace mars 23 | { 24 | class ReadBarometerData 25 | { 26 | public: 27 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW 28 | 29 | ReadBarometerData(std::vector* data_out, std::shared_ptr sensor, 30 | const std::string& file_path, const double& time_offset = 0) 31 | { 32 | std::vector expect_entry = { "t", "p" }; 33 | CsvDataType csv_data; 34 | ReadCsv(&csv_data, file_path); 35 | 36 | unsigned long number_of_datapoints = csv_data["t"].size(); 37 | data_out->resize(number_of_datapoints); 38 | 39 | double temperature = 293.15; // Sea level standard temperature in [k] 40 | 41 | for (size_t k = 0; k < number_of_datapoints; k++) 42 | { 43 | Time time = csv_data["t"][k] + time_offset; 44 | 45 | double pressure(csv_data["p"][k]); 46 | 47 | BufferDataType data; 48 | data.set_measurement(std::make_shared(pressure, temperature)); 49 | 50 | BufferEntryType current_entry(time, data, sensor); 51 | data_out->at(k) = current_entry; 52 | } 53 | } 54 | }; 55 | } // namespace mars 56 | 57 | #endif // READ_BAROMETER_DATA_H 58 | -------------------------------------------------------------------------------- /source/mars/include/mars/data_utils/read_gps_data.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef READ_GPS_DATA_H 12 | #define READ_GPS_DATA_H 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | namespace mars 23 | { 24 | class ReadGpsData 25 | { 26 | public: 27 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW 28 | 29 | ReadGpsData(std::vector* data_out, std::shared_ptr sensor, 30 | const std::string& file_path, const double& time_offset = 0) 31 | { 32 | std::vector expect_entry = { "t", "lat", "long", "alt" }; 33 | 34 | CsvDataType csv_data; 35 | ReadCsv(&csv_data, file_path); 36 | 37 | unsigned long number_of_datapoints = csv_data["t"].size(); 38 | data_out->resize(number_of_datapoints); 39 | 40 | for (size_t k = 0; k < number_of_datapoints; k++) 41 | { 42 | Time time = csv_data["t"][k] + time_offset; 43 | 44 | BufferDataType data; 45 | data.set_measurement( 46 | std::make_shared(csv_data["lat"][k], csv_data["long"][k], csv_data["alt"][k])); 47 | 48 | BufferEntryType current_entry(time, data, sensor); 49 | data_out->at(k) = current_entry; 50 | } 51 | } 52 | }; 53 | } // namespace mars 54 | 55 | #endif // READ_GPS_DATA_H 56 | -------------------------------------------------------------------------------- /source/mars/include/mars/data_utils/read_gps_w_vel_data.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef READ_GPS_W_VEL_DATA_H 12 | #define READ_GPS_W_VEL_DATA_H 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | namespace mars 23 | { 24 | class ReadGpsWithVelData 25 | { 26 | public: 27 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW 28 | 29 | ReadGpsWithVelData(std::vector* data_out, std::shared_ptr sensor, 30 | const std::string& file_path, const double& time_offset = 0) 31 | { 32 | std::vector expect_entry = { "t", "lat", "long", "alt", "v_x", "v_y", "v_z" }; 33 | 34 | CsvDataType csv_data; 35 | ReadCsv(&csv_data, file_path); 36 | 37 | unsigned long number_of_datapoints = csv_data["t"].size(); 38 | data_out->resize(number_of_datapoints); 39 | 40 | for (size_t k = 0; k < number_of_datapoints; k++) 41 | { 42 | Time time = csv_data["t"][k] + time_offset; 43 | 44 | BufferDataType data; 45 | data.set_measurement(std::make_shared(csv_data["lat"][k], csv_data["long"][k], 46 | csv_data["alt"][k], csv_data["v_x"][k], 47 | csv_data["v_y"][k], csv_data["v_z"][k])); 48 | 49 | BufferEntryType current_entry(time, data, sensor); 50 | data_out->at(k) = current_entry; 51 | } 52 | } 53 | }; 54 | } // namespace mars 55 | 56 | #endif // READ_GPS_W_VEL_DATA_H 57 | -------------------------------------------------------------------------------- /source/mars/include/mars/data_utils/read_imu_data.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef READ_IMU_DATA_H 12 | #define READ_IMU_DATA_H 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | namespace mars 23 | { 24 | class ReadImuData 25 | { 26 | public: 27 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW 28 | 29 | ReadImuData(std::vector* data_out, std::shared_ptr sensor, 30 | const std::string& file_path, const double& time_offset = 0) 31 | { 32 | std::vector expect_entry = { "t", "a_x", "a_y", "a_z", "w_x", "w_y", "w_z" }; 33 | 34 | CsvDataType csv_data; 35 | ReadCsv(&csv_data, file_path); 36 | 37 | unsigned long number_of_datapoints = csv_data["t"].size(); 38 | data_out->resize(number_of_datapoints); 39 | 40 | for (size_t k = 0; k < number_of_datapoints; k++) 41 | { 42 | Time time = csv_data["t"][k] + time_offset; 43 | 44 | Eigen::Vector3d linear_acceleration(csv_data["a_x"][k], csv_data["a_y"][k], csv_data["a_z"][k]); 45 | Eigen::Vector3d angular_velocity(csv_data["w_x"][k], csv_data["w_y"][k], csv_data["w_z"][k]); 46 | 47 | BufferDataType data; 48 | data.set_measurement(std::make_shared(linear_acceleration, angular_velocity)); 49 | 50 | BufferEntryType current_entry(time, data, sensor); 51 | data_out->at(k) = current_entry; 52 | } 53 | } 54 | }; 55 | } // namespace mars 56 | 57 | #endif // READ_IMU_DATA_H 58 | -------------------------------------------------------------------------------- /source/mars/include/mars/data_utils/read_mag_data.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef READ_MAG_DATA_H 12 | #define READ_MAG_DATA_H 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | namespace mars 23 | { 24 | class ReadMagData 25 | { 26 | public: 27 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW 28 | 29 | ReadMagData(std::vector* data_out, std::shared_ptr sensor, 30 | const std::string& file_path, const double& time_offset = 0) 31 | 32 | { 33 | std::vector expect_entry = { "t", "cart_x", "cart_y", "cart_z" }; 34 | 35 | CsvDataType csv_data; 36 | ReadCsv(&csv_data, file_path); 37 | 38 | unsigned long number_of_datapoints = csv_data["t"].size(); 39 | data_out->resize(number_of_datapoints); 40 | 41 | for (size_t k = 0; k < number_of_datapoints; k++) 42 | { 43 | Time time = csv_data["t"][k] + time_offset; 44 | 45 | Eigen::Vector3d mag_vec(csv_data["cart_x"][k], csv_data["cart_y"][k], csv_data["cart_z"][k]); 46 | 47 | BufferDataType data; 48 | data.set_measurement(std::make_shared(mag_vec)); 49 | 50 | BufferEntryType current_entry(time, data, sensor); 51 | data_out->at(k) = current_entry; 52 | } 53 | } 54 | }; 55 | } // namespace mars 56 | 57 | #endif // READ_MAG_DATA_H 58 | -------------------------------------------------------------------------------- /source/mars/include/mars/data_utils/read_pose_data.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef READ_POSE_DATA_H 12 | #define READ_POSE_DATA_H 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | namespace mars 24 | { 25 | class ReadPoseData 26 | { 27 | public: 28 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW 29 | 30 | ReadPoseData(std::vector* data_out, std::shared_ptr sensor, 31 | const std::string& file_path, const double& time_offset = 0) 32 | { 33 | std::vector expect_entry = { "t", "p_x", "p_y", "p_z", "q_w", "q_x", "q_y", "q_z" }; 34 | 35 | CsvDataType csv_data; 36 | ReadCsv(&csv_data, file_path); 37 | 38 | unsigned long number_of_datapoints = csv_data["t"].size(); 39 | data_out->resize(number_of_datapoints); 40 | 41 | for (size_t k = 0; k < number_of_datapoints; k++) 42 | { 43 | Time time = csv_data["t"][k] + time_offset; 44 | 45 | Eigen::Vector3d position(csv_data["p_x"][k], csv_data["p_y"][k], csv_data["p_z"][k]); 46 | Eigen::Quaterniond orientation(csv_data["q_w"][k], csv_data["q_x"][k], csv_data["q_y"][k], csv_data["q_z"][k]); 47 | orientation = Utils::NormalizeQuaternion(orientation, "pose csv reader"); 48 | 49 | BufferDataType data; 50 | data.set_measurement(std::make_shared(position, orientation)); 51 | 52 | BufferEntryType current_entry(time, data, sensor); 53 | data_out->at(k) = current_entry; 54 | } 55 | } 56 | }; 57 | } // namespace mars 58 | 59 | #endif // READ_POSE_DATA_H 60 | -------------------------------------------------------------------------------- /source/mars/include/mars/data_utils/read_position_data.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef READ_POSITION_DATA_H 12 | #define READ_POSITION_DATA_H 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | namespace mars 23 | { 24 | class ReadPositionData 25 | { 26 | public: 27 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW 28 | 29 | ReadPositionData(std::vector* data_out, std::shared_ptr sensor, 30 | const std::string& file_path, const double& time_offset = 0) 31 | { 32 | std::vector expect_entry = { "t", "p_x", "p_y", "p_z" }; 33 | 34 | CsvDataType csv_data; 35 | ReadCsv(&csv_data, file_path); 36 | 37 | unsigned long number_of_datapoints = csv_data["t"].size(); 38 | data_out->resize(number_of_datapoints); 39 | 40 | for (size_t k = 0; k < number_of_datapoints; k++) 41 | { 42 | Time time = csv_data["t"][k] + time_offset; 43 | Eigen::Vector3d position(csv_data["p_x"][k], csv_data["p_y"][k], csv_data["p_z"][k]); 44 | 45 | BufferDataType data; 46 | data.set_measurement(std::make_shared(position)); 47 | 48 | BufferEntryType current_entry(time, data, sensor); 49 | data_out->at(k) = current_entry; 50 | } 51 | } 52 | }; 53 | } // namespace mars 54 | 55 | #endif // READ_POSITION_DATA_H 56 | -------------------------------------------------------------------------------- /source/mars/include/mars/data_utils/read_velocity_data.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2024 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef READ_VELOCITY_DATA_H 12 | #define READ_VELOCITY_DATA_H 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | namespace mars 23 | { 24 | class ReadVelocityData 25 | { 26 | public: 27 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW 28 | 29 | ReadVelocityData(std::vector* data_out, std::shared_ptr sensor, 30 | const std::string& file_path, const double& time_offset = 0) 31 | { 32 | std::vector expect_entry = { "t", "v_x", "v_y", "v_z" }; 33 | 34 | CsvDataType csv_data; 35 | ReadCsv(&csv_data, file_path); 36 | 37 | unsigned long number_of_datapoints = csv_data["t"].size(); 38 | data_out->resize(number_of_datapoints); 39 | 40 | for (size_t k = 0; k < number_of_datapoints; k++) 41 | { 42 | Time time = csv_data["t"][k] + time_offset; 43 | Eigen::Vector3d velocity(csv_data["v_x"][k], csv_data["v_y"][k], csv_data["v_z"][k]); 44 | 45 | BufferDataType data; 46 | data.set_measurement(std::make_shared(velocity)); 47 | 48 | BufferEntryType current_entry(time, data, sensor); 49 | data_out->at(k) = current_entry; 50 | } 51 | } 52 | }; 53 | } // namespace mars 54 | 55 | #endif // READ_VELOCITY_DATA_H 56 | -------------------------------------------------------------------------------- /source/mars/include/mars/data_utils/read_vision_data.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef READ_VISION_DATA_H 12 | #define READ_VISION_DATA_H 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | namespace mars 23 | { 24 | class ReadVisionData 25 | { 26 | public: 27 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW 28 | 29 | ReadVisionData(std::vector* data_out, std::shared_ptr sensor, 30 | const std::string& file_path, const double& time_offset = 0) 31 | { 32 | std::vector expect_entry = { "t", "p_x", "p_y", "p_z", "q_w", "q_x", "q_y", "q_z" }; 33 | 34 | CsvDataType csv_data; 35 | ReadCsv(&csv_data, file_path); 36 | 37 | unsigned long number_of_datapoints = csv_data["t"].size(); 38 | data_out->resize(number_of_datapoints); 39 | 40 | for (size_t k = 0; k < number_of_datapoints; k++) 41 | { 42 | Time time = csv_data["t"][k] + time_offset; 43 | 44 | Eigen::Vector3d position(csv_data["p_x"][k], csv_data["p_y"][k], csv_data["p_z"][k]); 45 | Eigen::Quaterniond orientation(csv_data["q_w"][k], csv_data["q_x"][k], csv_data["q_y"][k], csv_data["q_z"][k]); 46 | orientation = Utils::NormalizeQuaternion(orientation, "vision csv reader"); 47 | 48 | BufferDataType data; 49 | data.set_measurement(std::make_shared(position, orientation)); 50 | 51 | BufferEntryType current_entry(time, data, sensor); 52 | data_out->at(k) = current_entry; 53 | } 54 | } 55 | }; 56 | } // namespace mars 57 | 58 | #endif // READ_VISION_DATA_H 59 | -------------------------------------------------------------------------------- /source/mars/include/mars/data_utils/write_csv.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef WRITE_CSV_H 12 | #define WRITE_CSV_H 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | namespace mars 19 | { 20 | class WriteCsv 21 | { 22 | public: 23 | inline static std::string vec_to_csv(const Eigen::VectorXd& a) 24 | { 25 | std::stringstream os; 26 | for (int k = 0; k < a.size(); k++) 27 | { 28 | os << ", " << a(k); 29 | } 30 | return os.str(); 31 | } 32 | 33 | /// 34 | /// \brief get_csv_state_with_cov_header_string generate string with state and upper triangular covariance 35 | /// \return 36 | /// 37 | inline static std::string cov_mat_to_csv(const Eigen::MatrixXd& cov) 38 | { 39 | if (cov.rows() != cov.cols()) 40 | { 41 | std::cout << "Cov Mat to CSV: Cov matrix non-squared. No line written." << std::endl; 42 | return std::string(""); 43 | } 44 | 45 | std::stringstream os; 46 | const int num_cov_state = static_cast(cov.rows()); 47 | 48 | for (int k = 0; k < num_cov_state; k++) 49 | { 50 | int row_count = k * num_cov_state + k; 51 | int col_count = num_cov_state - k; // Size relative to row_count 52 | os << vec_to_csv(Eigen::Map(cov.data() + row_count, col_count)); 53 | } 54 | 55 | return os.str(); 56 | } 57 | 58 | static std::string get_cov_header_string(const int& num_states) 59 | { 60 | std::stringstream os; 61 | 62 | const std::string var("p_"); 63 | for (int row = 1; row <= num_states; row++) 64 | { 65 | for (int col = row; col <= num_states; col++) 66 | { 67 | os << ", " << var << row << "_" << col; 68 | } 69 | } 70 | 71 | return os.str(); 72 | } 73 | }; 74 | } // namespace mars 75 | 76 | #endif // WRITE_CSV_H 77 | -------------------------------------------------------------------------------- /source/mars/include/mars/general_functions/progress_indicator.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #include "progress_indicator.h" 12 | namespace mars 13 | { 14 | ProgressIndicator::ProgressIndicator(const int& total_iterations, const int& step_width) 15 | : total_iterations_(total_iterations), step_width_(step_width) 16 | { 17 | } 18 | 19 | void ProgressIndicator::next_step() 20 | { 21 | current_iteration_++; 22 | const double prog = (current_iteration_ / total_iterations_) * 100; 23 | if (prog >= current_progress_) 24 | { 25 | std::cout << "Progress: [ "; 26 | std::cout << std::setprecision(2) << current_progress_; 27 | std::cout << "% ]" << std::endl; 28 | current_progress_ += step_width_; 29 | } 30 | } 31 | } // namespace mars 32 | -------------------------------------------------------------------------------- /source/mars/include/mars/general_functions/progress_indicator.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef PROGRESSINDICATOR_H 12 | #define PROGRESSINDICATOR_H 13 | 14 | #include 15 | #include 16 | 17 | namespace mars 18 | { 19 | class ProgressIndicator 20 | { 21 | public: 22 | ProgressIndicator(const int& total_iterations, const int& step_width); 23 | 24 | void next_step(); 25 | 26 | private: 27 | const double total_iterations_; 28 | const double step_width_; 29 | 30 | double current_progress_{ 0 }; 31 | int current_iteration_{ 0 }; 32 | }; 33 | } // namespace mars 34 | 35 | #endif // PROGRESSINDICATOR_H 36 | -------------------------------------------------------------------------------- /source/mars/include/mars/sensors/attitude/attitude_conversion.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Martin Scheiber, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef ATTITUDE_CONVERSION_H 12 | #define ATTITUDE_CONVERSION_H 13 | 14 | #include 15 | #include 16 | 17 | namespace mars 18 | { 19 | /// 20 | /// \brief The Attitude struct 21 | /// 22 | struct Attitude 23 | { 24 | Attitude() = default; 25 | Attitude(const Eigen::Quaterniond& quaternion) : quaternion_(quaternion) 26 | { 27 | } 28 | Attitude(const Eigen::Matrix3d& rotation_matrix) : quaternion_(rotation_matrix) 29 | { 30 | } 31 | Attitude(const Eigen::Vector3d& vec, const std::string& order = "XYZ") 32 | { 33 | // scoping 34 | using AAd = Eigen::AngleAxisd; 35 | using v3d = Eigen::Vector3d; 36 | 37 | /// \todo TODO other orders need to be implemented 38 | if (order == "XYZ") 39 | { 40 | quaternion_ = AAd(vec(0), v3d::UnitX()) * AAd(vec(1), v3d::UnitY()) * AAd(vec(2), v3d::UnitZ()); 41 | } 42 | else if (order == "ZYX") 43 | { 44 | quaternion_ = AAd(vec(2), v3d::UnitZ()) * AAd(vec(1), v3d::UnitY()) * AAd(vec(0), v3d::UnitX()); 45 | } 46 | } 47 | 48 | Eigen::Quaterniond quaternion_; 49 | 50 | Eigen::Matrix3d get_rotation_matrix() 51 | { 52 | return quaternion_.toRotationMatrix(); 53 | } 54 | 55 | Eigen::Vector2d get_rp() 56 | { 57 | Eigen::Vector3d rpy = mars::Utils::RPYFromRotMat(quaternion_.toRotationMatrix()); 58 | return { rpy(0), rpy(1) }; 59 | } 60 | 61 | friend std::ostream& operator<<(std::ostream& out, const Attitude& attitude); 62 | }; 63 | 64 | } // namespace mars 65 | #endif // ATTITUDE_CONVERSION_H 66 | -------------------------------------------------------------------------------- /source/mars/include/mars/sensors/attitude/attitude_sensor_state_type.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Martin Scheiber and Christian Brommer, Control of Networked Systems, University of Klagenfurt, 2 | // Austria. 3 | // 4 | // All rights reserved. 5 | // 6 | // This software is licensed under the terms of the BSD-2-Clause-License with 7 | // no commercial use allowed, the full terms of which are made available 8 | // in the LICENSE file. No license in patents is granted. 9 | // 10 | // You can contact the authors at 11 | // and . 12 | 13 | #ifndef ATTITUDE_SENSOR_STATE_TYPE_H 14 | #define ATTITUDE_SENSOR_STATE_TYPE_H 15 | 16 | #include 17 | #include 18 | 19 | namespace mars 20 | { 21 | class AttitudeSensorStateType : public BaseStates 22 | { 23 | public: 24 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW 25 | 26 | Eigen::Quaternion q_aw_; // calibration between world and attitude reference frame 27 | Eigen::Quaternion q_ib_; // calibration between IMU and attitude sensor 28 | 29 | AttitudeSensorStateType() : BaseStates(6) // BaseStates(6) // cov size 30 | { 31 | q_aw_.setIdentity(); 32 | q_ib_.setIdentity(); 33 | } 34 | 35 | static std::string get_csv_state_header_string() 36 | { 37 | std::stringstream os; 38 | os << "t, "; 39 | os << "q_aw_w, q_aw_x, q_aw_y, q_aw_z"; 40 | os << "q_ib_w, q_ib_x, q_ib_y, q_ib_z"; 41 | 42 | return os.str(); 43 | } 44 | 45 | std::string to_csv_string(const double& timestamp) const 46 | { 47 | std::stringstream os; 48 | os.precision(17); 49 | os << timestamp; 50 | 51 | os << ", " << q_aw_.w() << ", " << q_aw_.x() << ", " << q_aw_.y() << ", " << q_aw_.z(); 52 | os << ", " << q_ib_.w() << ", " << q_ib_.x() << ", " << q_ib_.y() << ", " << q_ib_.z(); 53 | 54 | return os.str(); 55 | } 56 | }; 57 | } // namespace mars 58 | #endif // ATTITUDE_SENSOR_STATE_TYPE_H 59 | -------------------------------------------------------------------------------- /source/mars/include/mars/sensors/bodyvel/bodyvel_measurement_type.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Martin Scheiber and Christian Brommer, Control of Networked Systems, University of Klagenfurt, 2 | // Austria. 3 | // 4 | // All rights reserved. 5 | // 6 | // This software is licensed under the terms of the BSD-2-Clause-License with 7 | // no commercial use allowed, the full terms of which are made available 8 | // in the LICENSE file. No license in patents is granted. 9 | // 10 | // You can contact the authors at 11 | // and . 12 | 13 | #ifndef BODYVELMEASUREMENTTYPE_H 14 | #define BODYVELMEASUREMENTTYPE_H 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | namespace mars 21 | { 22 | class BodyvelMeasurementType : public BaseMeas 23 | { 24 | public: 25 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW 26 | 27 | Eigen::Vector3d velocity_; ///< Velocity [x y z] 28 | 29 | BodyvelMeasurementType() = default; 30 | 31 | BodyvelMeasurementType(Eigen::Vector3d velocity) : velocity_(std::move(velocity)) 32 | { 33 | } 34 | 35 | static std::string get_csv_state_header_string() 36 | { 37 | std::stringstream os; 38 | os << "t, "; 39 | os << "v_x, v_y, v_z"; 40 | 41 | return os.str(); 42 | } 43 | 44 | std::string to_csv_string(const double& timestamp) const 45 | { 46 | std::stringstream os; 47 | os.precision(17); 48 | os << timestamp; 49 | 50 | os << ", " << velocity_.x() << ", " << velocity_.y() << ", " << velocity_.z(); 51 | 52 | return os.str(); 53 | } 54 | }; 55 | } // namespace mars 56 | #endif // BODYVELMEASUREMENTTYPE_H 57 | -------------------------------------------------------------------------------- /source/mars/include/mars/sensors/bodyvel/bodyvel_sensor_state_type.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Martin Scheiber and Christian Brommer, Control of Networked Systems, University of Klagenfurt, 2 | // Austria. 3 | // 4 | // All rights reserved. 5 | // 6 | // This software is licensed under the terms of the BSD-2-Clause-License with 7 | // no commercial use allowed, the full terms of which are made available 8 | // in the LICENSE file. No license in patents is granted. 9 | // 10 | // You can contact the authors at 11 | // and . 12 | 13 | #ifndef BODYVELSENSORSTATETYPE_H 14 | #define BODYVELSENSORSTATETYPE_H 15 | 16 | #include 17 | #include 18 | 19 | namespace mars 20 | { 21 | class BodyvelSensorStateType : public BaseStates 22 | { 23 | public: 24 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW 25 | 26 | Eigen::Vector3d p_ib_; 27 | Eigen::Quaternion q_ib_; 28 | 29 | BodyvelSensorStateType() : BaseStates(6) // size of covariance 30 | { 31 | p_ib_.setZero(); 32 | q_ib_.setIdentity(); 33 | } 34 | 35 | static std::string get_csv_state_header_string() 36 | { 37 | std::stringstream os; 38 | os << "t, "; 39 | os << "p_ib_x, p_ib_y, p_ib_z, "; 40 | os << "q_ib_w, q_ib_x, q_ib_y, q_ib_z"; 41 | 42 | return os.str(); 43 | } 44 | 45 | std::string to_csv_string(const double& timestamp) const 46 | { 47 | std::stringstream os; 48 | os.precision(17); 49 | os << timestamp; 50 | 51 | os << ", " << p_ib_(0) << ", " << p_ib_(1) << ", " << p_ib_(2); 52 | os << ", " << q_ib_.w() << ", " << q_ib_.x() << ", " << q_ib_.y() << ", " << q_ib_.z(); 53 | 54 | return os.str(); 55 | } 56 | }; 57 | } // namespace mars 58 | #endif // BODYVELSENSORSTATETYPE_H 59 | -------------------------------------------------------------------------------- /source/mars/include/mars/sensors/empty/empty_measurement_type.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef EMPTYMEASUREMENTTYPE_H 12 | #define EMPTYMEASUREMENTTYPE_H 13 | 14 | #include 15 | #include 16 | 17 | namespace mars 18 | { 19 | class EmptyMeasurementType : public BaseMeas 20 | { 21 | public: 22 | double value_; 23 | 24 | EmptyMeasurementType(const double& value) : value_(value) 25 | { 26 | } 27 | 28 | static std::string get_csv_state_header_string() 29 | { 30 | std::stringstream os; 31 | os << "t, "; 32 | os << "value"; 33 | 34 | return os.str(); 35 | } 36 | 37 | std::string to_csv_string(const double& timestamp) const 38 | { 39 | std::stringstream os; 40 | os.precision(17); 41 | os << timestamp; 42 | 43 | os << ", " << value_; 44 | 45 | return os.str(); 46 | } 47 | }; 48 | } // namespace mars 49 | #endif // EMPTYMEASUREMENTTYPE_H 50 | -------------------------------------------------------------------------------- /source/mars/include/mars/sensors/empty/empty_sensor_state_type.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef EMPTYSENSORSTATETYPE_H 12 | #define EMPTYSENSORSTATETYPE_H 13 | 14 | #include 15 | #include 16 | 17 | namespace mars 18 | { 19 | class EmptySensorStateType : public BaseStates 20 | { 21 | public: 22 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW 23 | 24 | Eigen::Vector3d value_; 25 | 26 | EmptySensorStateType() : BaseStates(3) // cov size 27 | { 28 | value_.setZero(); 29 | } 30 | 31 | static std::string get_csv_state_header_string() 32 | { 33 | std::stringstream os; 34 | os << "t, "; 35 | os << "value"; 36 | 37 | return os.str(); 38 | } 39 | 40 | /// 41 | /// \brief to_csv_string export state to single csv string 42 | /// \param timestamp 43 | /// \return string format [value] 44 | /// 45 | std::string to_csv_string(const double& timestamp) const 46 | { 47 | std::stringstream os; 48 | os.precision(17); 49 | os << timestamp; 50 | 51 | os << ", " << value_(0) << ", " << value_(1) << ", " << value_(2); 52 | return os.str(); 53 | } 54 | }; 55 | } // namespace mars 56 | #endif // EMPTYSENSORSTATETYPE_H 57 | -------------------------------------------------------------------------------- /source/mars/include/mars/sensors/gps/gps_measurement_type.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef GPSMEASUREMENTTYPE_H 12 | #define GPSMEASUREMENTTYPE_H 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | namespace mars 19 | { 20 | class GpsMeasurementType : public BaseMeas 21 | { 22 | public: 23 | GpsCoordinates coordinates_; 24 | 25 | GpsMeasurementType(double latitude, double longitude, double altitude) 26 | : coordinates_(std::move(latitude), std::move(longitude), std::move(altitude)) 27 | { 28 | } 29 | 30 | static std::string get_csv_state_header_string() 31 | { 32 | std::stringstream os; 33 | os << "t, "; 34 | os << "lat, lon, alt"; 35 | 36 | return os.str(); 37 | } 38 | 39 | std::string to_csv_string(const double& timestamp) const 40 | { 41 | std::stringstream os; 42 | os.precision(17); 43 | os << timestamp; 44 | 45 | os << ", " << coordinates_.latitude_ << ", " << coordinates_.longitude_ << ", " << coordinates_.altitude_; 46 | 47 | return os.str(); 48 | } 49 | }; 50 | } // namespace mars 51 | #endif // GPS_MEASUREMENTTYPE_H 52 | -------------------------------------------------------------------------------- /source/mars/include/mars/sensors/gps/gps_sensor_state_type.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef GPSSENSORSTATETYPE_H 12 | #define GPSSENSORSTATETYPE_H 13 | 14 | #include 15 | #include 16 | 17 | namespace mars 18 | { 19 | class GpsSensorStateType : public BaseStates 20 | { 21 | public: 22 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW 23 | 24 | Eigen::Vector3d p_ig_; 25 | Eigen::Vector3d p_gw_w_; 26 | Eigen::Quaterniond q_gw_w_; 27 | 28 | GpsSensorStateType() : BaseStates(9) // cov size 29 | { 30 | p_ig_.setZero(); 31 | p_gw_w_.setZero(); 32 | q_gw_w_.setIdentity(); 33 | } 34 | 35 | static std::string get_csv_state_header_string() 36 | { 37 | std::stringstream os; 38 | os << "t, "; 39 | os << "p_ig_x, p_ig_y, p_ig_z, "; 40 | os << "p_gw_w_x, p_gw_w_y, p_gw_w_z, "; 41 | os << "q_gw_w_w, q_gw_w_x, q_gw_w_y, q_gw_w_z"; 42 | 43 | return os.str(); 44 | } 45 | 46 | /// 47 | /// \brief to_csv_string export state to single csv string 48 | /// \param timestamp 49 | /// \return string format [p_ig p_gw_w q_gw_w] 50 | /// 51 | std::string to_csv_string(const double& timestamp) const 52 | { 53 | std::stringstream os; 54 | os.precision(17); 55 | os << timestamp; 56 | 57 | os << ", " << p_ig_(0) << ", " << p_ig_(1) << ", " << p_ig_(2); 58 | os << ", " << p_gw_w_(0) << ", " << p_gw_w_(1) << ", " << p_gw_w_(2); 59 | Eigen::Vector4d q_gw_w = q_gw_w_.coeffs(); // x y z w 60 | os << ", " << q_gw_w(3) << ", " << q_gw_w(0) << ", " << q_gw_w(1) << ", " << q_gw_w(2); 61 | 62 | return os.str(); 63 | } 64 | }; 65 | } // namespace mars 66 | #endif // GPSSENSORSTATETYPE_H 67 | -------------------------------------------------------------------------------- /source/mars/include/mars/sensors/gps_w_vel/gps_w_vel_measurement_type.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef GPSVELMEASUREMENTTYPE_H 12 | #define GPSVELMEASUREMENTTYPE_H 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | namespace mars 19 | { 20 | class GpsVelMeasurementType : public BaseMeas 21 | { 22 | public: 23 | GpsCoordinates coordinates_; 24 | Eigen::Vector3d velocity_; 25 | 26 | GpsVelMeasurementType(double latitude, double longitude, double altitude, double vel_x, double vel_y, double vel_z) 27 | : coordinates_(std::move(latitude), std::move(longitude), std::move(altitude)) 28 | , velocity_(std::move(vel_x), std::move(vel_y), std::move(vel_z)) 29 | { 30 | } 31 | 32 | static std::string get_csv_state_header_string() 33 | { 34 | std::stringstream os; 35 | os << "t, "; 36 | os << "lat, lon, alt, "; 37 | os << "vel_x, vel_y, vel_z"; 38 | 39 | return os.str(); 40 | } 41 | 42 | std::string to_csv_string(const double& timestamp) const 43 | { 44 | std::stringstream os; 45 | os.precision(17); 46 | os << timestamp; 47 | 48 | os << ", " << coordinates_.latitude_ << ", " << coordinates_.longitude_ << ", " << coordinates_.altitude_; 49 | os << ", " << velocity_.x() << ", " << velocity_.y() << ", " << velocity_.z(); 50 | 51 | return os.str(); 52 | } 53 | }; 54 | } // namespace mars 55 | #endif // GPSVELMEASUREMENTTYPE_H 56 | -------------------------------------------------------------------------------- /source/mars/include/mars/sensors/gps_w_vel/gps_w_vel_sensor_state_type.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef GPSVELSENSORSTATETYPE_H 12 | #define GPSVELSENSORSTATETYPE_H 13 | 14 | #include 15 | #include 16 | 17 | namespace mars 18 | { 19 | class GpsVelSensorStateType : public BaseStates 20 | { 21 | public: 22 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW 23 | 24 | Eigen::Vector3d p_ig_; 25 | Eigen::Vector3d p_gw_w_; 26 | Eigen::Quaterniond q_gw_w_; 27 | 28 | GpsVelSensorStateType() : BaseStates(9) // cov size 29 | { 30 | p_ig_.setZero(); 31 | p_gw_w_.setZero(); 32 | q_gw_w_.setIdentity(); 33 | } 34 | 35 | static std::string get_csv_state_header_string() 36 | { 37 | std::stringstream os; 38 | os << "t, "; 39 | os << "p_ig_x, p_ig_y, p_ig_z, "; 40 | os << "p_gw_w_x, p_gw_w_y, p_gw_w_z, "; 41 | os << "q_gw_w_w, q_gw_w_x, q_gw_w_y, q_gw_w_z"; 42 | 43 | return os.str(); 44 | } 45 | 46 | /// 47 | /// \brief to_csv_string export state to single csv string 48 | /// \param timestamp 49 | /// \return string format [p_ig p_gw_w q_gw_w] 50 | /// 51 | std::string to_csv_string(const double& timestamp) const 52 | { 53 | std::stringstream os; 54 | os.precision(17); 55 | os << timestamp; 56 | 57 | os << ", " << p_ig_(0) << ", " << p_ig_(1) << ", " << p_ig_(2); 58 | os << ", " << p_gw_w_(0) << ", " << p_gw_w_(1) << ", " << p_gw_w_(2); 59 | Eigen::Vector4d q_gw_w = q_gw_w_.coeffs(); // x y z w 60 | os << ", " << q_gw_w(3) << ", " << q_gw_w(0) << ", " << q_gw_w(1) << ", " << q_gw_w(2); 61 | 62 | return os.str(); 63 | } 64 | }; 65 | } // namespace mars 66 | #endif // GPSVELSENSORSTATETYPE_H 67 | -------------------------------------------------------------------------------- /source/mars/include/mars/sensors/imu/imu_measurement_type.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef IMU_MEASUREMENT_TYPE_H 12 | #define IMU_MEASUREMENT_TYPE_H 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | namespace mars 19 | { 20 | class IMUMeasurementType : public BaseMeas 21 | { 22 | public: 23 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW 24 | 25 | Eigen::Vector3d linear_acceleration_{ 0, 0, 0 }; 26 | Eigen::Vector3d angular_velocity_{ 0, 0, 0 }; 27 | 28 | IMUMeasurementType() = default; 29 | 30 | IMUMeasurementType(Eigen::Vector3d linear_acceleration, Eigen::Vector3d angular_velocity) 31 | : linear_acceleration_(std::move(linear_acceleration)), angular_velocity_(std::move(angular_velocity)) 32 | { 33 | } 34 | 35 | bool operator==(const IMUMeasurementType& rhs) const 36 | { 37 | return (linear_acceleration_ == rhs.linear_acceleration_ && angular_velocity_ == rhs.angular_velocity_); 38 | } 39 | 40 | bool operator!=(const IMUMeasurementType& rhs) const 41 | { 42 | return !(*this == rhs); 43 | } 44 | 45 | static std::string get_csv_state_header_string() 46 | { 47 | std::stringstream os; 48 | os << "t, "; 49 | os << "a_x, a_y, a_z, "; 50 | os << "w_x, w_y, w_z"; 51 | 52 | return os.str(); 53 | } 54 | 55 | std::string to_csv_string(const double& timestamp) const 56 | { 57 | std::stringstream os; 58 | os.precision(17); 59 | os << timestamp; 60 | 61 | os << ", " << linear_acceleration_(0) << ", " << linear_acceleration_(1) << ", " << linear_acceleration_(2); 62 | os << ", " << angular_velocity_(0) << ", " << angular_velocity_(1) << ", " << angular_velocity_(2); 63 | 64 | return os.str(); 65 | } 66 | }; 67 | } // namespace mars 68 | #endif // IMU_MEASUREMENT_TYPE_H 69 | -------------------------------------------------------------------------------- /source/mars/include/mars/sensors/imu/imu_sensor_class.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef IMU_SENSOR_CLASS_H 12 | #define IMU_SENSOR_CLASS_H 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | namespace mars 21 | { 22 | class ImuSensorClass : public SensorAbsClass 23 | { 24 | public: 25 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW 26 | 27 | ImuSensorClass(const std::string& name) 28 | { 29 | name_ = name; 30 | std::cout << "Created: [" << this->name_ << "] Sensor" << std::endl; 31 | } 32 | 33 | virtual ~ImuSensorClass() = default; 34 | 35 | Eigen::MatrixXd get_covariance(const std::shared_ptr& /*sensor_data*/) 36 | { 37 | return {}; 38 | } 39 | 40 | void set_initial_calib(std::shared_ptr /*calibration*/) 41 | { 42 | } 43 | 44 | BufferDataType Initialize(const Time& /*timestamp*/, std::shared_ptr /*measurement*/, 45 | std::shared_ptr /*latest_core_data*/) 46 | { 47 | return {}; 48 | } 49 | 50 | bool CalcUpdate(const Time& /*timestamp*/, std::shared_ptr /*measurement*/, 51 | const CoreStateType& /*prior_core_state_data*/, std::shared_ptr /*latest_sensor_data*/, 52 | const Eigen::MatrixXd& /*prior_cov*/, BufferDataType* /*new_state_data*/) 53 | { 54 | return false; 55 | } 56 | }; 57 | } // namespace mars 58 | 59 | #endif // IMU_SENSOR_CLASS_H 60 | -------------------------------------------------------------------------------- /source/mars/include/mars/sensors/mag/mag_measurement_type.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef MAG_MEASUREMENT_TYPE_H 12 | #define MAG_MEASUREMENT_TYPE_H 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | namespace mars 19 | { 20 | class MagMeasurementType : public BaseMeas 21 | { 22 | public: 23 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW 24 | 25 | Eigen::Vector3d mag_vector_; ///< Raw magnetometer measurement [x y z] 26 | 27 | MagMeasurementType() = default; 28 | 29 | MagMeasurementType(Eigen::Vector3d mag_vector) : mag_vector_(std::move(mag_vector)) 30 | { 31 | } 32 | 33 | static std::string get_csv_state_header_string() 34 | { 35 | std::stringstream os; 36 | os << "t, "; 37 | os << "m_x, m_y, m_z"; 38 | 39 | return os.str(); 40 | } 41 | 42 | std::string to_csv_string(const double& timestamp) const 43 | { 44 | std::stringstream os; 45 | os.precision(17); 46 | os << timestamp; 47 | 48 | os << ", " << mag_vector_.x() << ", " << mag_vector_.y() << ", " << mag_vector_.z(); 49 | 50 | return os.str(); 51 | } 52 | }; 53 | } // namespace mars 54 | 55 | #endif // MAG_MEASUREMENT_TYPE_H 56 | -------------------------------------------------------------------------------- /source/mars/include/mars/sensors/mag/mag_sensor_state_type.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef MAG_SENSOR_STATE_TYPE_H 12 | #define MAG_SENSOR_STATE_TYPE_H 13 | 14 | #include 15 | #include 16 | 17 | namespace mars 18 | { 19 | class MagSensorStateType : public BaseStates 20 | { 21 | public: 22 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW 23 | 24 | Eigen::Vector3d mag_; 25 | Eigen::Quaterniond q_im_; 26 | 27 | MagSensorStateType() : BaseStates(6) // cov size 28 | { 29 | mag_.setZero(); 30 | q_im_.setIdentity(); 31 | } 32 | 33 | static std::string get_csv_state_header_string() 34 | { 35 | std::stringstream os; 36 | os << "t, "; 37 | os << "mag_w_x, mag_w_y, mag_w_z, "; 38 | os << "q_im_w, q_im_x, q_im_y, q_im_z"; 39 | 40 | return os.str(); 41 | } 42 | 43 | /// 44 | /// \brief to_csv_string export state to single csv string 45 | /// \param timestamp 46 | /// \return string format [mag q_wi] 47 | /// 48 | std::string to_csv_string(const double& timestamp) const 49 | { 50 | std::stringstream os; 51 | os.precision(17); 52 | os << timestamp; 53 | 54 | os << ", " << mag_(0) << ", " << mag_(1) << ", " << mag_(2); 55 | Eigen::Vector4d q_im = q_im_.coeffs(); // x y z w 56 | os << ", " << q_im(3) << ", " << q_im(0) << ", " << q_im(1) << ", " << q_im(2); 57 | 58 | return os.str(); 59 | } 60 | }; 61 | } // namespace mars 62 | #endif // MAG_SENSOR_STATE_TYPE_H 63 | -------------------------------------------------------------------------------- /source/mars/include/mars/sensors/measurement_base_class.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef MEASUREMENT_BASE_CLASS_H 12 | #define MEASUREMENT_BASE_CLASS_H 13 | 14 | #include 15 | #include 16 | 17 | namespace mars 18 | { 19 | class BaseMeas : public MeasInterface 20 | { 21 | public: 22 | Eigen::MatrixXd meas_noise_; 23 | bool has_meas_noise{ false }; 24 | 25 | bool get_meas_noise(Eigen::MatrixXd* meas_noise) 26 | { 27 | if (this->has_meas_noise) 28 | { 29 | *meas_noise = this->meas_noise_; 30 | return true; 31 | } 32 | else 33 | { 34 | meas_noise = nullptr; 35 | return false; 36 | } 37 | } 38 | 39 | void set_meas_noise(const Eigen::MatrixXd& meas_noise) 40 | { 41 | this->meas_noise_ = meas_noise; 42 | } 43 | }; 44 | } // namespace mars 45 | 46 | #endif // MEASUREMENT_BASE_CLASS_H 47 | -------------------------------------------------------------------------------- /source/mars/include/mars/sensors/measurement_interface.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef MEASUREMENT_INTERFACE_H 12 | #define MEASUREMENT_INTERFACE_H 13 | 14 | #include 15 | #include 16 | 17 | namespace mars 18 | { 19 | class MeasInterface 20 | { 21 | public: 22 | virtual ~MeasInterface() = default; 23 | 24 | /// 25 | /// \brief get the measurement noise associated with the current sensor measurement 26 | /// \param sensor_data contains the current sensor measurement 27 | /// \return Measurement noise matrix 28 | /// 29 | virtual bool get_meas_noise(Eigen::MatrixXd* meas_noise) = 0; 30 | virtual void set_meas_noise(const Eigen::MatrixXd& meas_noise) = 0; 31 | 32 | protected: 33 | }; 34 | } // namespace mars 35 | 36 | #endif // MEASUREMENT_INTERFACE_H 37 | -------------------------------------------------------------------------------- /source/mars/include/mars/sensors/pose/pose_measurement_type.cpp: -------------------------------------------------------------------------------- 1 | #include "PoseMeasurementType.h" 2 | 3 | PoseMeasurementType::PoseMeasurementType() 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /source/mars/include/mars/sensors/pose/pose_measurement_type.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef POSEMEASUREMENTTYPE_H 12 | #define POSEMEASUREMENTTYPE_H 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | namespace mars 19 | { 20 | class PoseMeasurementType : public BaseMeas 21 | { 22 | public: 23 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW 24 | 25 | Eigen::Vector3d position_; ///< Position [x y z] 26 | Eigen::Quaternion orientation_; ///< Quaternion [w x y z] 27 | 28 | PoseMeasurementType() = default; 29 | 30 | PoseMeasurementType(Eigen::Vector3d position, const Eigen::Quaternion& orientation) 31 | : position_(std::move(position)), orientation_(orientation) 32 | { 33 | } 34 | 35 | static std::string get_csv_state_header_string() 36 | { 37 | std::stringstream os; 38 | os << "t, "; 39 | os << "p_x, p_y, p_z, "; 40 | os << "q_w, q_x, q_y, q_z"; 41 | 42 | return os.str(); 43 | } 44 | 45 | std::string to_csv_string(const double& timestamp) const 46 | { 47 | std::stringstream os; 48 | os.precision(17); 49 | os << timestamp; 50 | 51 | os << ", " << position_.x() << ", " << position_.y() << ", " << position_.z(); 52 | os << ", " << orientation_.w() << ", " << orientation_.x() << ", " << orientation_.y() << ", " << orientation_.z(); 53 | 54 | return os.str(); 55 | } 56 | }; 57 | } // namespace mars 58 | #endif // POSEMEASUREMENTTYPE_H 59 | -------------------------------------------------------------------------------- /source/mars/include/mars/sensors/pose/pose_sensor_class.cpp: -------------------------------------------------------------------------------- 1 | #include "PoseSensorClass.h" 2 | 3 | PoseSensorClass::PoseSensorClass() 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /source/mars/include/mars/sensors/pose/pose_sensor_state_type.cpp: -------------------------------------------------------------------------------- 1 | #include "PoseSensorStateType.h" 2 | 3 | PoseSensorStateType::PoseSensorStateType() 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /source/mars/include/mars/sensors/pose/pose_sensor_state_type.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef POSESENSORSTATETYPE_H 12 | #define POSESENSORSTATETYPE_H 13 | 14 | #include 15 | #include 16 | 17 | namespace mars 18 | { 19 | class PoseSensorStateType : public BaseStates 20 | { 21 | public: 22 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW 23 | 24 | Eigen::Vector3d p_ip_; 25 | Eigen::Quaternion q_ip_; 26 | 27 | PoseSensorStateType() : BaseStates(6) // size of covariance 28 | { 29 | p_ip_.setZero(); 30 | q_ip_.setIdentity(); 31 | } 32 | 33 | static std::string get_csv_state_header_string() 34 | { 35 | std::stringstream os; 36 | os << "t, "; 37 | os << "p_ip_x, p_ip_y, p_ip_z, "; 38 | os << "q_ip_w, q_ip_x, q_ip_y, q_ip_z"; 39 | 40 | return os.str(); 41 | } 42 | 43 | std::string to_csv_string(const double& timestamp) const 44 | { 45 | std::stringstream os; 46 | os.precision(17); 47 | os << timestamp; 48 | 49 | os << ", " << p_ip_(0) << ", " << p_ip_(1) << ", " << p_ip_(2); 50 | 51 | Eigen::Vector4d q_ip = q_ip_.coeffs(); // x y z w 52 | os << ", " << q_ip(3) << ", " << q_ip(0) << ", " << q_ip(1) << ", " << q_ip(2); 53 | 54 | return os.str(); 55 | } 56 | }; 57 | } // namespace mars 58 | #endif // POSESENSORSTATETYPE_H 59 | -------------------------------------------------------------------------------- /source/mars/include/mars/sensors/position/position_measurement_type.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef POSITIONMEASUREMENTTYPE_H 12 | #define POSITIONMEASUREMENTTYPE_H 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | namespace mars 19 | { 20 | class PositionMeasurementType : public BaseMeas 21 | { 22 | public: 23 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW 24 | 25 | Eigen::Vector3d position_; ///< Position [x y z] 26 | 27 | PositionMeasurementType(Eigen::Vector3d position) : position_(std::move(position)) 28 | { 29 | } 30 | 31 | static std::string get_csv_state_header_string() 32 | { 33 | std::stringstream os; 34 | os << "t, "; 35 | os << "p_x, p_y, p_z"; 36 | 37 | return os.str(); 38 | } 39 | 40 | std::string to_csv_string(const double& timestamp) const 41 | { 42 | std::stringstream os; 43 | os.precision(17); 44 | os << timestamp; 45 | 46 | os << ", " << position_.x() << ", " << position_.y() << ", " << position_.z(); 47 | 48 | return os.str(); 49 | } 50 | }; 51 | } // namespace mars 52 | #endif // POSITIONMEASUREMENTTYPE_H 53 | -------------------------------------------------------------------------------- /source/mars/include/mars/sensors/position/position_sensor_state_type.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef POSITIONSENSORSTATETYPE_H 12 | #define POSITIONSENSORSTATETYPE_H 13 | 14 | #include 15 | #include 16 | 17 | namespace mars 18 | { 19 | class PositionSensorStateType : public BaseStates 20 | { 21 | public: 22 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW 23 | 24 | Eigen::Vector3d p_ip_; 25 | 26 | PositionSensorStateType() : BaseStates(3) // cov size 27 | { 28 | p_ip_.setZero(); 29 | } 30 | 31 | static std::string get_csv_state_header_string() 32 | { 33 | std::stringstream os; 34 | os << "t, "; 35 | os << "p_ip_x, p_ip_y, p_ip_z"; 36 | 37 | return os.str(); 38 | } 39 | 40 | std::string to_csv_string(const double& timestamp) const 41 | { 42 | std::stringstream os; 43 | os.precision(17); 44 | os << timestamp; 45 | 46 | os << ", " << p_ip_(0) << ", " << p_ip_(1) << ", " << p_ip_(2); 47 | 48 | return os.str(); 49 | } 50 | }; 51 | } // namespace mars 52 | #endif // POSITIONSENSORSTATETYPE_H 53 | -------------------------------------------------------------------------------- /source/mars/include/mars/sensors/pressure/pressure_sensor_state_type.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022-2023 Martin Scheiber, Christian Brommer, 2 | // Control of Networked Systems, University of Klagenfurt, Austria. 3 | // 4 | // All rights reserved. 5 | // 6 | // This software is licensed under the terms of the BSD-2-Clause-License with 7 | // no commercial use allowed, the full terms of which are made available 8 | // in the LICENSE file. No license in patents is granted. 9 | // 10 | // You can contact the authors at 11 | // and . 12 | 13 | #ifndef PRESSURE_SENSOR_STATE_TYPE_H 14 | #define PRESSURE_SENSOR_STATE_TYPE_H 15 | 16 | #include 17 | #include 18 | 19 | namespace mars 20 | { 21 | class PressureSensorStateType : public BaseStates 22 | { 23 | public: 24 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW 25 | 26 | Eigen::Vector3d p_ip_; ///< translation between IMU and Pressure sensor 27 | double bias_p_; ///< bias of pressure sensor 28 | // technically also scale here, which is currently assumed one 29 | 30 | PressureSensorStateType() : BaseStates(4) // cov size 31 | { 32 | p_ip_.setZero(); 33 | bias_p_ = 0.0; 34 | } 35 | 36 | static std::string get_csv_state_header_string() 37 | { 38 | std::stringstream os; 39 | os << "t, "; 40 | os << "p_ip_x, p_ip_y, p_ip_z, "; 41 | os << "bias_p"; 42 | 43 | return os.str(); 44 | } 45 | 46 | std::string to_csv_string(const double& timestamp) const 47 | { 48 | std::stringstream os; 49 | os.precision(17); 50 | os << timestamp; 51 | 52 | os << ", " << p_ip_(0) << ", " << p_ip_(1) << ", " << p_ip_(2); 53 | os << ", " << bias_p_; 54 | 55 | return os.str(); 56 | } 57 | }; 58 | } // namespace mars 59 | 60 | #endif // PRESSURE_SENSOR_STATE_TYPE_H 61 | -------------------------------------------------------------------------------- /source/mars/include/mars/sensors/sensor_abs_class.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef SENSORABSCLASS_H 12 | #define SENSORABSCLASS_H 13 | 14 | #include 15 | #include 16 | 17 | namespace mars 18 | { 19 | class SensorAbsClass : public SensorInterface 20 | { 21 | public: 22 | int id_{ -1 }; 23 | std::string name_; ///< Name of the individual sensor instance 24 | bool is_initialized_{ false }; ///< True if the sensor has been initialized 25 | bool do_update_{ true }; ///< True if updates should be performed with the sensor 26 | int type_{ -1 }; ///< Future feature, holds information such as position or orientation for highlevel decissions 27 | bool const_ref_to_nav_{ true }; ///< True if the reference should not be estimated 28 | bool ref_to_nav_given_{ false }; ///< True if the reference to the navigation frame is given by initial calibration 29 | bool use_dynamic_meas_noise_{ false }; ///< True if dynamic noise values from measurements should be used 30 | 31 | /// 32 | /// \brief operator << Overload the << operator for easy printing of the sensor information 33 | /// 34 | friend std::ostream& operator<<(std::ostream& out, const SensorAbsClass& sensor) 35 | { 36 | out << "\tSensor: " << sensor.name_ << std::endl; 37 | out << "\tInitialized: " << sensor.is_initialized_ << std::endl; 38 | out << "\tDo update: " << sensor.do_update_ << std::endl; 39 | out << "\tReference to nav: " << sensor.const_ref_to_nav_ << std::endl; 40 | out << "\tUse dynamic noise: " << sensor.use_dynamic_meas_noise_ << std::endl; 41 | return out; 42 | } 43 | }; 44 | } // namespace mars 45 | #endif // SENSORABSCLASS_H 46 | -------------------------------------------------------------------------------- /source/mars/include/mars/sensors/update_sensor_abs_class.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef UPDATE_SENSOR_ABS_CLASS_H 12 | #define UPDATE_SENSOR_ABS_CLASS_H 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | namespace mars 22 | { 23 | class UpdateSensorAbsClass : public SensorAbsClass 24 | { 25 | public: 26 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW 27 | 28 | int aux_states_; 29 | int aux_error_states_; 30 | int ref_to_nav_; 31 | Eigen::MatrixXd residual_; 32 | Eigen::VectorXd R_; ///< Measurement noise "squared" 33 | Eigen::MatrixXd F_; 34 | Eigen::MatrixXd H_; 35 | Eigen::MatrixXd Q_; 36 | 37 | std::shared_ptr initial_calib_{ nullptr }; 38 | bool initial_calib_provided_{ false }; ///< True if an initial calibration was provided 39 | 40 | Chi2 chi2_; 41 | 42 | std::shared_ptr core_states_; 43 | }; 44 | } // namespace mars 45 | 46 | #endif // UPDATE_SENSOR_ABS_CLASS_H 47 | -------------------------------------------------------------------------------- /source/mars/include/mars/sensors/velocity/velocity_measurement_type.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2024 Christian Brommer, Control of Networked Systems, University of Klagenfurt, 2 | // Austria. 3 | // 4 | // All rights reserved. 5 | // 6 | // This software is licensed under the terms of the BSD-2-Clause-License with 7 | // no commercial use allowed, the full terms of which are made available 8 | // in the LICENSE file. No license in patents is granted. 9 | // 10 | // You can contact the author at 11 | 12 | #ifndef VELOCITYMEASUREMENTTYPE_H 13 | #define VELOCITYMEASUREMENTTYPE_H 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | namespace mars 20 | { 21 | class VelocityMeasurementType : public BaseMeas 22 | { 23 | public: 24 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW 25 | 26 | Eigen::Vector3d velocity_; ///< Velocity [x y z] 27 | 28 | VelocityMeasurementType() = default; 29 | 30 | VelocityMeasurementType(Eigen::Vector3d velocity) : velocity_(std::move(velocity)) 31 | { 32 | } 33 | 34 | static std::string get_csv_state_header_string() 35 | { 36 | std::stringstream os; 37 | os << "t, "; 38 | os << "v_x, v_y, v_z"; 39 | 40 | return os.str(); 41 | } 42 | 43 | std::string to_csv_string(const double& timestamp) const 44 | { 45 | std::stringstream os; 46 | os.precision(17); 47 | os << timestamp; 48 | 49 | os << ", " << velocity_.x() << ", " << velocity_.y() << ", " << velocity_.z(); 50 | 51 | return os.str(); 52 | } 53 | }; 54 | } // namespace mars 55 | #endif // VELOCITYMEASUREMENTTYPE_H 56 | -------------------------------------------------------------------------------- /source/mars/include/mars/sensors/velocity/velocity_sensor_state_type.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2024 Christian Brommer, Control of Networked Systems, University of Klagenfurt, 2 | // Austria. 3 | // 4 | // All rights reserved. 5 | // 6 | // This software is licensed under the terms of the BSD-2-Clause-License with 7 | // no commercial use allowed, the full terms of which are made available 8 | // in the LICENSE file. No license in patents is granted. 9 | // 10 | // You can contact the author at 11 | 12 | #ifndef VELOCITYSENSORSTATETYPE_H 13 | #define VELOCITYSENSORSTATETYPE_H 14 | 15 | #include 16 | #include 17 | 18 | namespace mars 19 | { 20 | class VelocitySensorStateType : public BaseStates 21 | { 22 | public: 23 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW 24 | 25 | Eigen::Vector3d p_iv_; 26 | 27 | VelocitySensorStateType() : BaseStates(3) // size of covariance 28 | { 29 | p_iv_.setZero(); 30 | } 31 | 32 | static std::string get_csv_state_header_string() 33 | { 34 | std::stringstream os; 35 | os << "t, "; 36 | os << "p_iv_x, p_iv_y, p_iv_z"; 37 | 38 | return os.str(); 39 | } 40 | 41 | std::string to_csv_string(const double& timestamp) const 42 | { 43 | std::stringstream os; 44 | os.precision(17); 45 | os << timestamp; 46 | 47 | os << ", " << p_iv_(0) << ", " << p_iv_(1) << ", " << p_iv_(2); 48 | return os.str(); 49 | } 50 | }; 51 | } // namespace mars 52 | #endif // VELOCITYSENSORSTATETYPE_H 53 | -------------------------------------------------------------------------------- /source/mars/include/mars/sensors/vision/vision_measurement_type.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef VISIONMEASUREMENTTYPE_H 12 | #define VISIONMEASUREMENTTYPE_H 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | namespace mars 19 | { 20 | class VisionMeasurementType : public BaseMeas 21 | { 22 | public: 23 | EIGEN_MAKE_ALIGNED_OPERATOR_NEW 24 | 25 | Eigen::Vector3d position_; ///< Position [x y z] 26 | Eigen::Quaternion orientation_; ///< Quaternion [w x y z] 27 | 28 | VisionMeasurementType() = default; 29 | 30 | VisionMeasurementType(Eigen::Vector3d position, const Eigen::Quaternion& orientation) 31 | : position_(std::move(position)), orientation_(orientation) 32 | { 33 | } 34 | 35 | static std::string get_csv_state_header_string() 36 | { 37 | std::stringstream os; 38 | os << "t, "; 39 | os << "p_x, p_y, p_z, "; 40 | os << "q_w, q_x, q_y, q_z"; 41 | 42 | return os.str(); 43 | } 44 | 45 | std::string to_csv_string(const double& timestamp) const 46 | { 47 | std::stringstream os; 48 | os.precision(17); 49 | os << timestamp; 50 | 51 | os << ", " << position_.x() << ", " << position_.y() << ", " << position_.z(); 52 | os << ", " << orientation_.w() << ", " << orientation_.x() << ", " << orientation_.y() << ", " << orientation_.z(); 53 | 54 | return os.str(); 55 | } 56 | }; 57 | } // namespace mars 58 | #endif // VISIONMEASUREMENTTYPE_H 59 | -------------------------------------------------------------------------------- /source/mars/include/mars/time.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef TIME_H 12 | #define TIME_H 13 | 14 | #include 15 | #include 16 | 17 | namespace mars 18 | { 19 | class Time 20 | { 21 | public: 22 | Time() = default; 23 | Time(const double& seconds); 24 | 25 | static Time get_time_now(); 26 | 27 | double get_seconds() const; 28 | Time abs() const; 29 | 30 | Time operator+(const Time& rhs) const; 31 | Time operator-(const Time& rhs) const; 32 | bool operator==(const Time& rhs) const; 33 | bool operator<(const Time& rhs) const; 34 | bool operator<=(const Time& rhs) const; 35 | bool operator>(const Time& rhs) const; 36 | bool operator>=(const Time& rhs) const; 37 | 38 | friend std::ostream& operator<<(std::ostream& out, const Time& data); 39 | 40 | private: 41 | double seconds_{ 0.0 }; 42 | }; 43 | } // namespace mars 44 | #endif // TIME_H 45 | -------------------------------------------------------------------------------- /source/mars/include/mars/type_definitions/base_states.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef BASESTATES_H 12 | #define BASESTATES_H 13 | 14 | #include 15 | 16 | namespace mars 17 | { 18 | /// 19 | /// \brief The BaseStates class is used to ensure that all sensor data classes define a covariance size for the 20 | /// 'bind_sensor_data' class 21 | /// 22 | class BaseStates 23 | { 24 | public: 25 | int cov_size_; 26 | 27 | BaseStates(int cov_size) : cov_size_(cov_size) 28 | { 29 | } 30 | }; 31 | } // namespace mars 32 | 33 | #endif // BASESTATES_H 34 | -------------------------------------------------------------------------------- /source/mars/include/mars/type_definitions/core_type.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef CORETYPE_H 12 | #define CORETYPE_H 13 | 14 | #include 15 | 16 | namespace mars 17 | { 18 | class CoreType 19 | { 20 | public: 21 | CoreStateType state_; 22 | CoreStateMatrix cov_; 23 | CoreStateMatrix state_transition_; 24 | // ref_to_nav; 25 | 26 | CoreType() = default; 27 | }; 28 | } // namespace mars 29 | 30 | #endif // CORETYPE_H 31 | -------------------------------------------------------------------------------- /source/mars/include/mars/type_definitions/mars_types.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2022 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef MARSTYPES_H 12 | #define MARSTYPES_H 13 | 14 | #include 15 | 16 | namespace mars 17 | { 18 | class Pose 19 | { 20 | public: 21 | Eigen::Vector3d p_{ Eigen::Vector3d::Zero() }; 22 | Eigen::Quaterniond q_{ Eigen::Quaterniond::Identity() }; 23 | 24 | Eigen::Vector3d n_p_{ Eigen::Vector3d::Ones() * 0.1 }; 25 | Eigen::Vector3d n_r_{ Eigen::Vector3d::Ones() * 0.1 }; 26 | 27 | Pose() = default; 28 | Pose(const Eigen::Vector3d& position, const Eigen::Quaterniond& orientation) : p_(position), q_(orientation) 29 | { 30 | } 31 | 32 | Pose(const Eigen::Vector3d& position, const Eigen::Matrix3d& rotation) : p_(position), q_(rotation) 33 | { 34 | } 35 | 36 | void set_meas_noise(Eigen::Vector3d n_p, Eigen::Vector3d n_r) 37 | { 38 | n_p_ = n_p; 39 | n_r_ = n_r; 40 | } 41 | 42 | bool operator==(const Pose& rhs) const 43 | { 44 | return ((p_ == rhs.p_) && ((q_.coeffs() == rhs.q_.coeffs()))); 45 | } 46 | 47 | friend std::ostream& operator<<(std::ostream& out, const Pose& data) 48 | { 49 | out << "p: " << data.p_[0] << ", " << data.p_[1] << ", " << data.p_[2]; 50 | out << " q: " << data.q_.w() << ", " << data.q_.x() << ", " << data.q_.y() << ", " << data.q_.z(); 51 | 52 | return out; 53 | } 54 | 55 | Eigen::Matrix get_meas_noise_mat() const 56 | { 57 | Eigen::Matrix vec; 58 | vec << n_p_, n_r_; 59 | return vec.asDiagonal(); 60 | } 61 | 62 | /// 63 | /// \brief Return inverse transformation (T_AB -> T_BA) as mars::Pose 64 | /// \return Pose 65 | /// 66 | Pose get_inverse_pose() const 67 | { 68 | return Pose(-q_.toRotationMatrix().transpose() * p_, q_.conjugate()); 69 | } 70 | }; 71 | } // namespace mars 72 | 73 | #endif // MARSTYPES_H 74 | -------------------------------------------------------------------------------- /source/mars/source/sensor_abs_class.cpp: -------------------------------------------------------------------------------- 1 | #include "SensorAbsClass.h" 2 | 3 | SensorAbsClass::SensorAbsClass() 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /source/mars/source/sensor_interface.cpp: -------------------------------------------------------------------------------- 1 | #include "SensorInterface.h" 2 | 3 | SensorInterface::SensorInterface() 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /source/mars/source/sensor_manager.cpp: -------------------------------------------------------------------------------- 1 | #include "mars/SensorManager.hpp" 2 | 3 | SensorManager::SensorManager() 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /source/tests/README.md: -------------------------------------------------------------------------------- 1 | ## Update googletest and googlemock 2 | 3 | After updating, the following changes needs to be applied manually: 4 | 5 | * https://github.com/cginternals/cmake-init/commit/6df2e5acd0111ca13f4a54f616a8e9e729f3fedc 6 | * https://github.com/cginternals/cmake-init/commit/da2b52c0b8b47989d779b8285c1a0294a71947ac 7 | * https://github.com/cginternals/cmake-init/commit/f505bef30fe3122d7bd3b8061fcf704fac452d7f 8 | * https://github.com/cginternals/cmake-init/commit/217786a6e8ab1c3a69ab899ec7fba06d5516452a 9 | 10 | ### Explicit diff 11 | 12 | `googletest/googlemock/CMakeLists.txt` 13 | 14 | * Add `set(BUILD_SHARED_LIBS OFF)` after the call to `option(BUILD_SHARED_LIBS ...)` 15 | * Add `set(CMAKE_MACOSX_RPATH OFF)` before the calls to `cxx_library(...)` 16 | * Add `set_target_properties(gmock_main PROPERTIES FOLDER "Tests")` after the calls to `cxx_library(...)` 17 | * Add `set_target_properties(gmock PROPERTIES FOLDER "Tests")` after the calls to `cxx_library(...)` 18 | 19 | `googletest/googletest/CMakeLists.txt` 20 | 21 | * Add `set(BUILD_SHARED_LIBS OFF)` after the call to `option(BUILD_SHARED_LIBS ...)` 22 | * Add `set(CMAKE_MACOSX_RPATH OFF)` before the calls to `cxx_library(...)` 23 | * Add `set_target_properties(gtest_main PROPERTIES FOLDER "Tests")` after the calls to `cxx_library(...)` 24 | * Add `set_target_properties(gtest PROPERTIES FOLDER "Tests")` after the calls to `cxx_library(...)` 25 | * Comment out the calls to `install` 26 | -------------------------------------------------------------------------------- /source/tests/googletest/.clang-format: -------------------------------------------------------------------------------- 1 | # Run manually to reformat a file: 2 | # clang-format -i --style=file 3 | Language: Cpp 4 | BasedOnStyle: Google 5 | -------------------------------------------------------------------------------- /source/tests/googletest/.github/ISSUE_TEMPLATE/10-feature_request.yml: -------------------------------------------------------------------------------- 1 | name: Feature request 2 | description: Propose a new feature. 3 | title: "[FR]: Please title this feature request" 4 | labels: "enhancement" 5 | body: 6 | - type: textarea 7 | id: version 8 | attributes: 9 | label: Does the feature exist in the most recent commit? 10 | description: We recommend using the latest commit from GitHub in your projects. 11 | validations: 12 | required: true 13 | - type: textarea 14 | id: why 15 | attributes: 16 | label: Why do we need this feature? 17 | description: Ideally, explain why a combination of existing features cannot be used instead. 18 | validations: 19 | required: true 20 | - type: textarea 21 | id: proposal 22 | attributes: 23 | label: Describe the proposal. 24 | description: Include a detailed description of the feature, with usage examples. 25 | validations: 26 | required: true 27 | - type: textarea 28 | id: platform 29 | attributes: 30 | label: Is the feature specific to an operating system, compiler, or build system version? 31 | description: If it is, please specify which versions. 32 | validations: 33 | required: true 34 | -------------------------------------------------------------------------------- /source/tests/googletest/.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Get Help 4 | url: https://github.com/google/googletest/discussions 5 | about: Please ask and answer questions here. 6 | -------------------------------------------------------------------------------- /source/tests/googletest/.github/workflows/gtest-ci.yml: -------------------------------------------------------------------------------- 1 | name: ci 2 | 3 | on: 4 | push: 5 | pull_request: 6 | 7 | env: 8 | BAZEL_CXXOPTS: -std=c++14 9 | 10 | jobs: 11 | Linux: 12 | runs-on: ubuntu-latest 13 | steps: 14 | 15 | - uses: actions/checkout@v3 16 | with: 17 | fetch-depth: 0 18 | 19 | - name: Tests 20 | run: bazel test --cxxopt=-std=c++14 --features=external_include_paths --test_output=errors ... 21 | 22 | macOS: 23 | runs-on: macos-latest 24 | steps: 25 | 26 | - uses: actions/checkout@v3 27 | with: 28 | fetch-depth: 0 29 | 30 | - name: Tests 31 | run: bazel test --cxxopt=-std=c++14 --features=external_include_paths --test_output=errors ... 32 | 33 | 34 | Windows: 35 | runs-on: windows-latest 36 | steps: 37 | 38 | - uses: actions/checkout@v3 39 | with: 40 | fetch-depth: 0 41 | 42 | - name: Tests 43 | run: bazel test --cxxopt=/std:c++14 --features=external_include_paths --test_output=errors ... 44 | -------------------------------------------------------------------------------- /source/tests/googletest/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore CI build directory 2 | build/ 3 | xcuserdata 4 | cmake-build-debug/ 5 | .idea/ 6 | bazel-bin 7 | bazel-genfiles 8 | bazel-googletest 9 | bazel-out 10 | bazel-testlogs 11 | # python 12 | *.pyc 13 | 14 | # Visual Studio files 15 | .vs 16 | *.sdf 17 | *.opensdf 18 | *.VC.opendb 19 | *.suo 20 | *.user 21 | _ReSharper.Caches/ 22 | Win32-Debug/ 23 | Win32-Release/ 24 | x64-Debug/ 25 | x64-Release/ 26 | 27 | # Ignore autoconf / automake files 28 | Makefile.in 29 | aclocal.m4 30 | configure 31 | build-aux/ 32 | autom4te.cache/ 33 | googletest/m4/libtool.m4 34 | googletest/m4/ltoptions.m4 35 | googletest/m4/ltsugar.m4 36 | googletest/m4/ltversion.m4 37 | googletest/m4/lt~obsolete.m4 38 | googlemock/m4 39 | 40 | # Ignore generated directories. 41 | googlemock/fused-src/ 42 | googletest/fused-src/ 43 | 44 | # macOS files 45 | .DS_Store 46 | googletest/.DS_Store 47 | googletest/xcode/.DS_Store 48 | 49 | # Ignore cmake generated directories and files. 50 | CMakeFiles 51 | CTestTestfile.cmake 52 | Makefile 53 | cmake_install.cmake 54 | googlemock/CMakeFiles 55 | googlemock/CTestTestfile.cmake 56 | googlemock/Makefile 57 | googlemock/cmake_install.cmake 58 | googlemock/gtest 59 | /bin 60 | /googlemock/gmock.dir 61 | /googlemock/gmock_main.dir 62 | /googlemock/RUN_TESTS.vcxproj.filters 63 | /googlemock/RUN_TESTS.vcxproj 64 | /googlemock/INSTALL.vcxproj.filters 65 | /googlemock/INSTALL.vcxproj 66 | /googlemock/gmock_main.vcxproj.filters 67 | /googlemock/gmock_main.vcxproj 68 | /googlemock/gmock.vcxproj.filters 69 | /googlemock/gmock.vcxproj 70 | /googlemock/gmock.sln 71 | /googlemock/ALL_BUILD.vcxproj.filters 72 | /googlemock/ALL_BUILD.vcxproj 73 | /lib 74 | /Win32 75 | /ZERO_CHECK.vcxproj.filters 76 | /ZERO_CHECK.vcxproj 77 | /RUN_TESTS.vcxproj.filters 78 | /RUN_TESTS.vcxproj 79 | /INSTALL.vcxproj.filters 80 | /INSTALL.vcxproj 81 | /googletest-distribution.sln 82 | /CMakeCache.txt 83 | /ALL_BUILD.vcxproj.filters 84 | /ALL_BUILD.vcxproj 85 | -------------------------------------------------------------------------------- /source/tests/googletest/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Note: CMake support is community-based. The maintainers do not use CMake 2 | # internally. 3 | 4 | cmake_minimum_required(VERSION 3.5) 5 | 6 | if (POLICY CMP0048) 7 | cmake_policy(SET CMP0048 NEW) 8 | endif (POLICY CMP0048) 9 | 10 | if (POLICY CMP0069) 11 | cmake_policy(SET CMP0069 NEW) 12 | endif (POLICY CMP0069) 13 | 14 | if (POLICY CMP0077) 15 | cmake_policy(SET CMP0077 NEW) 16 | endif (POLICY CMP0077) 17 | 18 | project(googletest-distribution) 19 | set(GOOGLETEST_VERSION 1.13.0) 20 | 21 | if(NOT CYGWIN AND NOT MSYS AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL QNX) 22 | set(CMAKE_CXX_EXTENSIONS OFF) 23 | endif() 24 | 25 | enable_testing() 26 | 27 | include(CMakeDependentOption) 28 | include(GNUInstallDirs) 29 | 30 | #Note that googlemock target already builds googletest 31 | option(BUILD_GMOCK "Builds the googlemock subproject" ON) 32 | option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" ON) 33 | option(GTEST_HAS_ABSL "Use Abseil and RE2. Requires Abseil and RE2 to be separately added to the build." OFF) 34 | 35 | if(BUILD_GMOCK) 36 | add_subdirectory( googlemock ) 37 | else() 38 | add_subdirectory( googletest ) 39 | endif() 40 | -------------------------------------------------------------------------------- /source/tests/googletest/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2008, Google Inc. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following disclaimer 12 | in the documentation and/or other materials provided with the 13 | distribution. 14 | * Neither the name of Google Inc. nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /source/tests/googletest/RELEASE_1_13_0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aau-cns/mars_lib/2abe2576fe7ff79cd574be6c5c6d7b56a10ead38/source/tests/googletest/RELEASE_1_13_0 -------------------------------------------------------------------------------- /source/tests/googletest/WORKSPACE: -------------------------------------------------------------------------------- 1 | workspace(name = "com_google_googletest") 2 | 3 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") 4 | 5 | http_archive( 6 | name = "com_google_absl", # 2023-01-10T21:08:25Z 7 | sha256 = "f9a4e749f42c386a32a90fddf0e2913ed408d10c42f7f33ccf4c59ac4f0d1d05", 8 | strip_prefix = "abseil-cpp-52835439ca90d86b27bf8cd1708296e95604d724", 9 | urls = ["https://github.com/abseil/abseil-cpp/archive/52835439ca90d86b27bf8cd1708296e95604d724.zip"], 10 | ) 11 | 12 | # Note this must use a commit from the `abseil` branch of the RE2 project. 13 | # https://github.com/google/re2/tree/abseil 14 | http_archive( 15 | name = "com_googlesource_code_re2", # 2022-12-21T14:29:10Z 16 | sha256 = "b9ce3a51beebb38534d11d40f8928d40509b9e18a735f6a4a97ad3d014c87cb5", 17 | strip_prefix = "re2-d0b1f8f2ecc2ea74956c7608b6f915175314ff0e", 18 | urls = ["https://github.com/google/re2/archive/d0b1f8f2ecc2ea74956c7608b6f915175314ff0e.zip"], 19 | ) 20 | 21 | http_archive( 22 | name = "rules_python", # 2023-01-10T22:00:51Z 23 | sha256 = "5de54486a60ad8948dabe49605bb1c08053e04001a431ab3e96745b4d97a4419", 24 | strip_prefix = "rules_python-70cce26432187a60b4e950118791385e6fb3c26f", 25 | urls = ["https://github.com/bazelbuild/rules_python/archive/70cce26432187a60b4e950118791385e6fb3c26f.zip"], 26 | ) 27 | 28 | http_archive( 29 | name = "bazel_skylib", # 2022-11-16T18:29:32Z 30 | sha256 = "a22290c26d29d3ecca286466f7f295ac6cbe32c0a9da3a91176a90e0725e3649", 31 | strip_prefix = "bazel-skylib-5bfcb1a684550626ce138fe0fe8f5f702b3764c3", 32 | urls = ["https://github.com/bazelbuild/bazel-skylib/archive/5bfcb1a684550626ce138fe0fe8f5f702b3764c3.zip"], 33 | ) 34 | 35 | http_archive( 36 | name = "platforms", # 2022-11-09T19:18:22Z 37 | sha256 = "b4a3b45dc4202e2b3e34e3bc49d2b5b37295fc23ea58d88fb9e01f3642ad9b55", 38 | strip_prefix = "platforms-3fbc687756043fb58a407c2ea8c944bc2fe1d922", 39 | urls = ["https://github.com/bazelbuild/platforms/archive/3fbc687756043fb58a407c2ea8c944bc2fe1d922.zip"], 40 | ) 41 | -------------------------------------------------------------------------------- /source/tests/googletest/ci/windows-presubmit.bat: -------------------------------------------------------------------------------- 1 | SETLOCAL ENABLEDELAYEDEXPANSION 2 | 3 | SET BAZEL_EXE=%KOKORO_GFILE_DIR%\bazel-5.1.1-windows-x86_64.exe 4 | 5 | SET PATH=C:\Python37;%PATH% 6 | SET BAZEL_PYTHON=C:\python37\python.exe 7 | SET BAZEL_SH=C:\tools\msys64\usr\bin\bash.exe 8 | SET CMAKE_BIN="C:\Program Files\CMake\bin\cmake.exe" 9 | SET CTEST_BIN="C:\Program Files\CMake\bin\ctest.exe" 10 | SET CTEST_OUTPUT_ON_FAILURE=1 11 | 12 | IF EXIST git\googletest ( 13 | CD git\googletest 14 | ) ELSE IF EXIST github\googletest ( 15 | CD github\googletest 16 | ) 17 | 18 | IF %errorlevel% neq 0 EXIT /B 1 19 | 20 | :: ---------------------------------------------------------------------------- 21 | :: CMake Visual Studio 15 2017 Win64 22 | MKDIR cmake_msvc2017 23 | CD cmake_msvc2017 24 | 25 | %CMAKE_BIN% .. ^ 26 | -G "Visual Studio 15 2017 Win64" ^ 27 | -DPYTHON_EXECUTABLE:FILEPATH=c:\python37\python.exe ^ 28 | -DPYTHON_INCLUDE_DIR:PATH=c:\python37\include ^ 29 | -DPYTHON_LIBRARY:FILEPATH=c:\python37\lib\site-packages\pip ^ 30 | -Dgtest_build_samples=ON ^ 31 | -Dgtest_build_tests=ON ^ 32 | -Dgmock_build_tests=ON 33 | IF %errorlevel% neq 0 EXIT /B 1 34 | 35 | %CMAKE_BIN% --build . --target ALL_BUILD --config Debug -- -maxcpucount 36 | IF %errorlevel% neq 0 EXIT /B 1 37 | 38 | %CTEST_BIN% -C Debug --timeout 600 39 | IF %errorlevel% neq 0 EXIT /B 1 40 | 41 | CD .. 42 | RMDIR /S /Q cmake_msvc2017 43 | 44 | :: ---------------------------------------------------------------------------- 45 | :: Bazel Visual Studio 15 2017 Win64 46 | 47 | SET BAZEL_VC=C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC 48 | %BAZEL_EXE% test ... ^ 49 | --compilation_mode=dbg ^ 50 | --copt=/std:c++14 ^ 51 | --copt=/WX ^ 52 | --features=external_include_paths ^ 53 | --keep_going ^ 54 | --test_output=errors ^ 55 | --test_tag_filters=-no_test_msvc2017 56 | IF %errorlevel% neq 0 EXIT /B 1 57 | -------------------------------------------------------------------------------- /source/tests/googletest/docs/_config.yml: -------------------------------------------------------------------------------- 1 | title: GoogleTest 2 | -------------------------------------------------------------------------------- /source/tests/googletest/docs/_data/navigation.yml: -------------------------------------------------------------------------------- 1 | nav: 2 | - section: "Get Started" 3 | items: 4 | - title: "Supported Platforms" 5 | url: "/platforms.html" 6 | - title: "Quickstart: Bazel" 7 | url: "/quickstart-bazel.html" 8 | - title: "Quickstart: CMake" 9 | url: "/quickstart-cmake.html" 10 | - section: "Guides" 11 | items: 12 | - title: "GoogleTest Primer" 13 | url: "/primer.html" 14 | - title: "Advanced Topics" 15 | url: "/advanced.html" 16 | - title: "Mocking for Dummies" 17 | url: "/gmock_for_dummies.html" 18 | - title: "Mocking Cookbook" 19 | url: "/gmock_cook_book.html" 20 | - title: "Mocking Cheat Sheet" 21 | url: "/gmock_cheat_sheet.html" 22 | - section: "References" 23 | items: 24 | - title: "Testing Reference" 25 | url: "/reference/testing.html" 26 | - title: "Mocking Reference" 27 | url: "/reference/mocking.html" 28 | - title: "Assertions" 29 | url: "/reference/assertions.html" 30 | - title: "Matchers" 31 | url: "/reference/matchers.html" 32 | - title: "Actions" 33 | url: "/reference/actions.html" 34 | - title: "Testing FAQ" 35 | url: "/faq.html" 36 | - title: "Mocking FAQ" 37 | url: "/gmock_faq.html" 38 | - title: "Code Samples" 39 | url: "/samples.html" 40 | - title: "Using pkg-config" 41 | url: "/pkgconfig.html" 42 | - title: "Community Documentation" 43 | url: "/community_created_documentation.html" 44 | -------------------------------------------------------------------------------- /source/tests/googletest/docs/assets/css/style.scss: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | 4 | @import "jekyll-theme-primer"; 5 | @import "main"; 6 | -------------------------------------------------------------------------------- /source/tests/googletest/docs/community_created_documentation.md: -------------------------------------------------------------------------------- 1 | # Community-Created Documentation 2 | 3 | The following is a list, in no particular order, of links to documentation 4 | created by the Googletest community. 5 | 6 | * [Googlemock Insights](https://github.com/ElectricRCAircraftGuy/eRCaGuy_dotfiles/blob/master/googletest/insights.md), 7 | by [ElectricRCAircraftGuy](https://github.com/ElectricRCAircraftGuy) 8 | -------------------------------------------------------------------------------- /source/tests/googletest/docs/index.md: -------------------------------------------------------------------------------- 1 | # GoogleTest User's Guide 2 | 3 | ## Welcome to GoogleTest! 4 | 5 | GoogleTest is Google's C++ testing and mocking framework. This user's guide has 6 | the following contents: 7 | 8 | * [GoogleTest Primer](primer.md) - Teaches you how to write simple tests using 9 | GoogleTest. Read this first if you are new to GoogleTest. 10 | * [GoogleTest Advanced](advanced.md) - Read this when you've finished the 11 | Primer and want to utilize GoogleTest to its full potential. 12 | * [GoogleTest Samples](samples.md) - Describes some GoogleTest samples. 13 | * [GoogleTest FAQ](faq.md) - Have a question? Want some tips? Check here 14 | first. 15 | * [Mocking for Dummies](gmock_for_dummies.md) - Teaches you how to create mock 16 | objects and use them in tests. 17 | * [Mocking Cookbook](gmock_cook_book.md) - Includes tips and approaches to 18 | common mocking use cases. 19 | * [Mocking Cheat Sheet](gmock_cheat_sheet.md) - A handy reference for 20 | matchers, actions, invariants, and more. 21 | * [Mocking FAQ](gmock_faq.md) - Contains answers to some mocking-specific 22 | questions. 23 | -------------------------------------------------------------------------------- /source/tests/googletest/docs/platforms.md: -------------------------------------------------------------------------------- 1 | # Supported Platforms 2 | 3 | GoogleTest requires a codebase and compiler compliant with the C++11 standard or 4 | newer. 5 | 6 | The GoogleTest code is officially supported on the following platforms. 7 | Operating systems or tools not listed below are community-supported. For 8 | community-supported platforms, patches that do not complicate the code may be 9 | considered. 10 | 11 | If you notice any problems on your platform, please file an issue on the 12 | [GoogleTest GitHub Issue Tracker](https://github.com/google/googletest/issues). 13 | Pull requests containing fixes are welcome! 14 | 15 | ### Operating systems 16 | 17 | * Linux 18 | * macOS 19 | * Windows 20 | 21 | ### Compilers 22 | 23 | * gcc 5.0+ 24 | * clang 5.0+ 25 | * MSVC 2015+ 26 | 27 | **macOS users:** Xcode 9.3+ provides clang 5.0+. 28 | 29 | ### Build systems 30 | 31 | * [Bazel](https://bazel.build/) 32 | * [CMake](https://cmake.org/) 33 | 34 | Bazel is the build system used by the team internally and in tests. CMake is 35 | supported on a best-effort basis and by the community. 36 | -------------------------------------------------------------------------------- /source/tests/googletest/docs/samples.md: -------------------------------------------------------------------------------- 1 | # Googletest Samples 2 | 3 | If you're like us, you'd like to look at 4 | [googletest samples.](https://github.com/google/googletest/blob/main/googletest/samples) 5 | The sample directory has a number of well-commented samples showing how to use a 6 | variety of googletest features. 7 | 8 | * Sample #1 shows the basic steps of using googletest to test C++ functions. 9 | * Sample #2 shows a more complex unit test for a class with multiple member 10 | functions. 11 | * Sample #3 uses a test fixture. 12 | * Sample #4 teaches you how to use googletest and `googletest.h` together to 13 | get the best of both libraries. 14 | * Sample #5 puts shared testing logic in a base test fixture, and reuses it in 15 | derived fixtures. 16 | * Sample #6 demonstrates type-parameterized tests. 17 | * Sample #7 teaches the basics of value-parameterized tests. 18 | * Sample #8 shows using `Combine()` in value-parameterized tests. 19 | * Sample #9 shows use of the listener API to modify Google Test's console 20 | output and the use of its reflection API to inspect test results. 21 | * Sample #10 shows use of the listener API to implement a primitive memory 22 | leak checker. 23 | -------------------------------------------------------------------------------- /source/tests/googletest/googlemock/README.md: -------------------------------------------------------------------------------- 1 | # Googletest Mocking (gMock) Framework 2 | 3 | ### Overview 4 | 5 | Google's framework for writing and using C++ mock classes. It can help you 6 | derive better designs of your system and write better tests. 7 | 8 | It is inspired by: 9 | 10 | * [jMock](http://www.jmock.org/) 11 | * [EasyMock](http://www.easymock.org/) 12 | * [Hamcrest](http://code.google.com/p/hamcrest/) 13 | 14 | It is designed with C++'s specifics in mind. 15 | 16 | gMock: 17 | 18 | - Provides a declarative syntax for defining mocks. 19 | - Can define partial (hybrid) mocks, which are a cross of real and mock 20 | objects. 21 | - Handles functions of arbitrary types and overloaded functions. 22 | - Comes with a rich set of matchers for validating function arguments. 23 | - Uses an intuitive syntax for controlling the behavior of a mock. 24 | - Does automatic verification of expectations (no record-and-replay needed). 25 | - Allows arbitrary (partial) ordering constraints on function calls to be 26 | expressed. 27 | - Lets a user extend it by defining new matchers and actions. 28 | - Does not use exceptions. 29 | - Is easy to learn and use. 30 | 31 | Details and examples can be found here: 32 | 33 | * [gMock for Dummies](https://google.github.io/googletest/gmock_for_dummies.html) 34 | * [Legacy gMock FAQ](https://google.github.io/googletest/gmock_faq.html) 35 | * [gMock Cookbook](https://google.github.io/googletest/gmock_cook_book.html) 36 | * [gMock Cheat Sheet](https://google.github.io/googletest/gmock_cheat_sheet.html) 37 | 38 | GoogleMock is a part of 39 | [GoogleTest C++ testing framework](http://github.com/google/googletest/) and a 40 | subject to the same requirements. 41 | -------------------------------------------------------------------------------- /source/tests/googletest/googlemock/cmake/gmock.pc.in: -------------------------------------------------------------------------------- 1 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 2 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 3 | 4 | Name: gmock 5 | Description: GoogleMock (without main() function) 6 | Version: @PROJECT_VERSION@ 7 | URL: https://github.com/google/googletest 8 | Requires: gtest = @PROJECT_VERSION@ 9 | Libs: -L${libdir} -lgmock @CMAKE_THREAD_LIBS_INIT@ 10 | Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ 11 | -------------------------------------------------------------------------------- /source/tests/googletest/googlemock/cmake/gmock_main.pc.in: -------------------------------------------------------------------------------- 1 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 2 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 3 | 4 | Name: gmock_main 5 | Description: GoogleMock (with main() function) 6 | Version: @PROJECT_VERSION@ 7 | URL: https://github.com/google/googletest 8 | Requires: gmock = @PROJECT_VERSION@ 9 | Libs: -L${libdir} -lgmock_main @CMAKE_THREAD_LIBS_INIT@ 10 | Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ 11 | -------------------------------------------------------------------------------- /source/tests/googletest/googlemock/docs/README.md: -------------------------------------------------------------------------------- 1 | # Content Moved 2 | 3 | We are working on updates to the GoogleTest documentation, which has moved to 4 | the top-level [docs](../../docs) directory. 5 | -------------------------------------------------------------------------------- /source/tests/googletest/googlemock/include/gmock/internal/custom/README.md: -------------------------------------------------------------------------------- 1 | # Customization Points 2 | 3 | The custom directory is an injection point for custom user configurations. 4 | 5 | ## Header `gmock-port.h` 6 | 7 | The following macros can be defined: 8 | 9 | ### Flag related macros: 10 | 11 | * `GMOCK_DECLARE_bool_(name)` 12 | * `GMOCK_DECLARE_int32_(name)` 13 | * `GMOCK_DECLARE_string_(name)` 14 | * `GMOCK_DEFINE_bool_(name, default_val, doc)` 15 | * `GMOCK_DEFINE_int32_(name, default_val, doc)` 16 | * `GMOCK_DEFINE_string_(name, default_val, doc)` 17 | * `GMOCK_FLAG_GET(flag_name)` 18 | * `GMOCK_FLAG_SET(flag_name, value)` 19 | -------------------------------------------------------------------------------- /source/tests/googletest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h: -------------------------------------------------------------------------------- 1 | // IWYU pragma: private, include "gmock/gmock.h" 2 | // IWYU pragma: friend gmock/.* 3 | 4 | #ifndef GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_ 5 | #define GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_ 6 | 7 | #endif // GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_ 8 | -------------------------------------------------------------------------------- /source/tests/googletest/googlemock/include/gmock/internal/custom/gmock-matchers.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // Injection point for custom user configurations. See README for details 31 | 32 | // IWYU pragma: private, include "gmock/gmock.h" 33 | // IWYU pragma: friend gmock/.* 34 | 35 | #ifndef GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_MATCHERS_H_ 36 | #define GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_MATCHERS_H_ 37 | #endif // GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_MATCHERS_H_ 38 | -------------------------------------------------------------------------------- /source/tests/googletest/googlemock/include/gmock/internal/custom/gmock-port.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // Injection point for custom user configurations. See README for details 31 | // 32 | // ** Custom implementation starts here ** 33 | 34 | // IWYU pragma: private, include "gmock/gmock.h" 35 | // IWYU pragma: friend gmock/.* 36 | 37 | #ifndef GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_ 38 | #define GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_ 39 | 40 | #endif // GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_ 41 | -------------------------------------------------------------------------------- /source/tests/googletest/googlemock/test/gmock-port_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // Google Mock - a framework for writing C++ mock classes. 31 | // 32 | // This file tests the internal cross-platform support utilities. 33 | 34 | #include "gmock/internal/gmock-port.h" 35 | 36 | #include "gtest/gtest.h" 37 | 38 | // NOTE: if this file is left without tests for some reason, put a dummy 39 | // test here to make references to symbols in the gtest library and avoid 40 | // 'undefined symbol' linker errors in gmock_main: 41 | 42 | TEST(DummyTest, Dummy) {} 43 | -------------------------------------------------------------------------------- /source/tests/googletest/googlemock/test/gmock_link2_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // Google Mock - a framework for writing C++ mock classes. 31 | // 32 | // This file is for verifying that various Google Mock constructs do not 33 | // produce linker errors when instantiated in different translation units. 34 | // Please see gmock_link_test.h for details. 35 | 36 | #define LinkTest LinkTest2 37 | 38 | #include "test/gmock_link_test.h" 39 | -------------------------------------------------------------------------------- /source/tests/googletest/googlemock/test/gmock_link_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // Google Mock - a framework for writing C++ mock classes. 31 | // 32 | // This file is for verifying that various Google Mock constructs do not 33 | // produce linker errors when instantiated in different translation units. 34 | // Please see gmock_link_test.h for details. 35 | 36 | #define LinkTest LinkTest1 37 | 38 | #include "test/gmock_link_test.h" 39 | -------------------------------------------------------------------------------- /source/tests/googletest/googletest/cmake/Config.cmake.in: -------------------------------------------------------------------------------- 1 | @PACKAGE_INIT@ 2 | include(CMakeFindDependencyMacro) 3 | if (@GTEST_HAS_PTHREAD@) 4 | set(THREADS_PREFER_PTHREAD_FLAG @THREADS_PREFER_PTHREAD_FLAG@) 5 | find_dependency(Threads) 6 | endif() 7 | 8 | include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake") 9 | check_required_components("@project_name@") 10 | -------------------------------------------------------------------------------- /source/tests/googletest/googletest/cmake/gtest.pc.in: -------------------------------------------------------------------------------- 1 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 2 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 3 | 4 | Name: gtest 5 | Description: GoogleTest (without main() function) 6 | Version: @PROJECT_VERSION@ 7 | URL: https://github.com/google/googletest 8 | Libs: -L${libdir} -lgtest @CMAKE_THREAD_LIBS_INIT@ 9 | Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ 10 | -------------------------------------------------------------------------------- /source/tests/googletest/googletest/cmake/gtest_main.pc.in: -------------------------------------------------------------------------------- 1 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 2 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 3 | 4 | Name: gtest_main 5 | Description: GoogleTest (with main() function) 6 | Version: @PROJECT_VERSION@ 7 | URL: https://github.com/google/googletest 8 | Requires: gtest = @PROJECT_VERSION@ 9 | Libs: -L${libdir} -lgtest_main @CMAKE_THREAD_LIBS_INIT@ 10 | Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ 11 | -------------------------------------------------------------------------------- /source/tests/googletest/googletest/cmake/libgtest.la.in: -------------------------------------------------------------------------------- 1 | # libgtest.la - a libtool library file 2 | # Generated by libtool (GNU libtool) 2.4.6 3 | 4 | # Please DO NOT delete this file! 5 | # It is necessary for linking the library. 6 | 7 | # Names of this library. 8 | library_names='libgtest.so' 9 | 10 | # Is this an already installed library? 11 | installed=yes 12 | 13 | # Should we warn about portability when linking against -modules? 14 | shouldnotlink=no 15 | 16 | # Files to dlopen/dlpreopen 17 | dlopen='' 18 | dlpreopen='' 19 | 20 | # Directory that this library needs to be installed in: 21 | libdir='@CMAKE_INSTALL_FULL_LIBDIR@' 22 | -------------------------------------------------------------------------------- /source/tests/googletest/googletest/docs/README.md: -------------------------------------------------------------------------------- 1 | # Content Moved 2 | 3 | We are working on updates to the GoogleTest documentation, which has moved to 4 | the top-level [docs](../../docs) directory. 5 | -------------------------------------------------------------------------------- /source/tests/googletest/googletest/include/gtest/internal/custom/README.md: -------------------------------------------------------------------------------- 1 | # Customization Points 2 | 3 | The custom directory is an injection point for custom user configurations. 4 | 5 | ## Header `gtest.h` 6 | 7 | ### The following macros can be defined: 8 | 9 | * `GTEST_OS_STACK_TRACE_GETTER_` - The name of an implementation of 10 | `OsStackTraceGetterInterface`. 11 | * `GTEST_CUSTOM_TEMPDIR_FUNCTION_` - An override for `testing::TempDir()`. See 12 | `testing::TempDir` for semantics and signature. 13 | 14 | ## Header `gtest-port.h` 15 | 16 | The following macros can be defined: 17 | 18 | ### Logging: 19 | 20 | * `GTEST_LOG_(severity)` 21 | * `GTEST_CHECK_(condition)` 22 | * Functions `LogToStderr()` and `FlushInfoLog()` have to be provided too. 23 | 24 | ### Threading: 25 | 26 | * `GTEST_HAS_NOTIFICATION_` - Enabled if Notification is already provided. 27 | * `GTEST_HAS_MUTEX_AND_THREAD_LOCAL_` - Enabled if `Mutex` and `ThreadLocal` 28 | are already provided. Must also provide `GTEST_DECLARE_STATIC_MUTEX_(mutex)` 29 | and `GTEST_DEFINE_STATIC_MUTEX_(mutex)` 30 | * `GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)` 31 | * `GTEST_LOCK_EXCLUDED_(locks)` 32 | 33 | ### Underlying library support features 34 | 35 | * `GTEST_HAS_CXXABI_H_` 36 | 37 | ### Exporting API symbols: 38 | 39 | * `GTEST_API_` - Specifier for exported symbols. 40 | 41 | ## Header `gtest-printers.h` 42 | 43 | * See documentation at `gtest/gtest-printers.h` for details on how to define a 44 | custom printer. 45 | -------------------------------------------------------------------------------- /source/tests/googletest/googletest/include/gtest/internal/custom/gtest-port.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Injection point for custom user configurations. See README for details 31 | // 32 | // ** Custom implementation starts here ** 33 | 34 | #ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_ 35 | #define GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_ 36 | 37 | #endif // GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_ 38 | -------------------------------------------------------------------------------- /source/tests/googletest/googletest/include/gtest/internal/custom/gtest.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Injection point for custom user configurations. See README for details 31 | // 32 | // ** Custom implementation starts here ** 33 | 34 | #ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_ 35 | #define GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_ 36 | 37 | #endif // GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_ 38 | -------------------------------------------------------------------------------- /source/tests/googletest/googletest/samples/sample1.h: -------------------------------------------------------------------------------- 1 | // Copyright 2005, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // A sample program demonstrating using Google C++ testing framework. 31 | 32 | #ifndef GOOGLETEST_SAMPLES_SAMPLE1_H_ 33 | #define GOOGLETEST_SAMPLES_SAMPLE1_H_ 34 | 35 | // Returns n! (the factorial of n). For negative n, n! is defined to be 1. 36 | int Factorial(int n); 37 | 38 | // Returns true if and only if n is a prime number. 39 | bool IsPrime(int n); 40 | 41 | #endif // GOOGLETEST_SAMPLES_SAMPLE1_H_ 42 | -------------------------------------------------------------------------------- /source/tests/googletest/googletest/samples/sample4_unittest.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2005, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #include "sample4.h" 31 | 32 | #include "gtest/gtest.h" 33 | 34 | namespace { 35 | // Tests the Increment() method. 36 | 37 | TEST(Counter, Increment) { 38 | Counter c; 39 | 40 | // Test that counter 0 returns 0 41 | EXPECT_EQ(0, c.Decrement()); 42 | 43 | // EXPECT_EQ() evaluates its arguments exactly once, so they 44 | // can have side effects. 45 | 46 | EXPECT_EQ(0, c.Increment()); 47 | EXPECT_EQ(1, c.Increment()); 48 | EXPECT_EQ(2, c.Increment()); 49 | 50 | EXPECT_EQ(3, c.Decrement()); 51 | } 52 | 53 | } // namespace 54 | -------------------------------------------------------------------------------- /source/tests/googletest/googletest/test/googletest-param-test-invalid-name1-test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #include "gtest/gtest.h" 31 | 32 | namespace { 33 | class DummyTest : public ::testing::TestWithParam {}; 34 | 35 | TEST_P(DummyTest, Dummy) {} 36 | 37 | INSTANTIATE_TEST_SUITE_P(InvalidTestName, DummyTest, 38 | ::testing::Values("InvalidWithQuotes"), 39 | ::testing::PrintToStringParamName()); 40 | 41 | } // namespace 42 | 43 | int main(int argc, char *argv[]) { 44 | testing::InitGoogleTest(&argc, argv); 45 | return RUN_ALL_TESTS(); 46 | } 47 | -------------------------------------------------------------------------------- /source/tests/googletest/googletest/test/googletest-setuptestsuite-test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #include "gtest/gtest.h" 31 | 32 | class SetupFailTest : public ::testing::Test { 33 | protected: 34 | static void SetUpTestSuite() { ASSERT_EQ("", "SET_UP_FAIL"); } 35 | }; 36 | 37 | TEST_F(SetupFailTest, NoopPassingTest) {} 38 | 39 | class TearDownFailTest : public ::testing::Test { 40 | protected: 41 | static void TearDownTestSuite() { ASSERT_EQ("", "TEAR_DOWN_FAIL"); } 42 | }; 43 | 44 | TEST_F(TearDownFailTest, NoopPassingTest) {} 45 | -------------------------------------------------------------------------------- /source/tests/googletest/googletest/test/googletest-uninitialized-test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #include "gtest/gtest.h" 31 | 32 | TEST(DummyTest, Dummy) { 33 | // This test doesn't verify anything. We just need it to create a 34 | // realistic stage for testing the behavior of Google Test when 35 | // RUN_ALL_TESTS() is called without 36 | // testing::InitGoogleTest() being called first. 37 | } 38 | 39 | int main() { return RUN_ALL_TESTS(); } 40 | -------------------------------------------------------------------------------- /source/tests/googletest/googletest/test/gtest-typed-test2_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008 Google Inc. 2 | // All Rights Reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #include 31 | 32 | #include "gtest/gtest.h" 33 | #include "test/gtest-typed-test_test.h" 34 | 35 | // Tests that the same type-parameterized test case can be 36 | // instantiated in different translation units linked together. 37 | // (ContainerTest is also instantiated in gtest-typed-test_test.cc.) 38 | INSTANTIATE_TYPED_TEST_SUITE_P(Vector, ContainerTest, 39 | testing::Types >); 40 | -------------------------------------------------------------------------------- /source/tests/googletest/googletest/test/gtest_main_unittest.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #include "gtest/gtest.h" 31 | 32 | // Tests that we don't have to define main() when we link to 33 | // gtest_main instead of gtest. 34 | 35 | namespace { 36 | 37 | TEST(GTestMainTest, ShouldSucceed) {} 38 | 39 | } // namespace 40 | 41 | // We are using the main() function defined in gtest_main.cc, so we 42 | // don't define it here. 43 | -------------------------------------------------------------------------------- /source/tests/googletest/googletest/test/gtest_skip_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008 Google Inc. 2 | // All Rights Reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // Author: arseny.aprelev@gmail.com (Arseny Aprelev) 31 | // 32 | 33 | #include "gtest/gtest.h" 34 | 35 | using ::testing::Test; 36 | 37 | TEST(SkipTest, DoesSkip) { 38 | GTEST_SKIP() << "skipping single test"; 39 | EXPECT_EQ(0, 1); 40 | } 41 | 42 | class Fixture : public Test { 43 | protected: 44 | void SetUp() override { 45 | GTEST_SKIP() << "skipping all tests for this fixture"; 46 | } 47 | }; 48 | 49 | TEST_F(Fixture, SkipsOneTest) { EXPECT_EQ(5, 7); } 50 | 51 | TEST_F(Fixture, SkipsAnotherTest) { EXPECT_EQ(99, 100); } 52 | -------------------------------------------------------------------------------- /source/tests/googletest/googletest/test/gtest_testbridge_test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2018, Google LLC. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // This program is meant to be run by gtest_test_filter_test.py. Do not run 31 | // it directly. 32 | 33 | #include "gtest/gtest.h" 34 | 35 | // These tests are used to detect if filtering is working. Only 36 | // 'TestThatSucceeds' should ever run. 37 | 38 | TEST(TestFilterTest, TestThatSucceeds) {} 39 | 40 | TEST(TestFilterTest, TestThatFails) { 41 | ASSERT_TRUE(false) << "This test should never be run."; 42 | } 43 | -------------------------------------------------------------------------------- /source/tests/googletest/googletest/test/gtest_xml_outfile1_test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // gtest_xml_outfile1_test_ writes some xml via TestProperty used by 31 | // gtest_xml_outfiles_test.py 32 | 33 | #include "gtest/gtest.h" 34 | 35 | class PropertyOne : public testing::Test { 36 | protected: 37 | void SetUp() override { RecordProperty("SetUpProp", 1); } 38 | void TearDown() override { RecordProperty("TearDownProp", 1); } 39 | }; 40 | 41 | TEST_F(PropertyOne, TestSomeProperties) { 42 | RecordProperty("TestSomeProperty", 1); 43 | } 44 | -------------------------------------------------------------------------------- /source/tests/googletest/googletest/test/gtest_xml_outfile2_test_.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2008, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | // 30 | // gtest_xml_outfile2_test_ writes some xml via TestProperty used by 31 | // gtest_xml_outfiles_test.py 32 | 33 | #include "gtest/gtest.h" 34 | 35 | class PropertyTwo : public testing::Test { 36 | protected: 37 | void SetUp() override { RecordProperty("SetUpProp", 2); } 38 | void TearDown() override { RecordProperty("TearDownProp", 2); } 39 | }; 40 | 41 | TEST_F(PropertyTwo, TestSomeProperties) { 42 | // Validate we can write an unsigned size_t as a property 43 | size_t prop_two = 2; 44 | RecordProperty("TestSomeProperty", prop_two); 45 | } 46 | -------------------------------------------------------------------------------- /source/tests/googletest/googletest/test/production.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | // 31 | // This is part of the unit test for gtest_prod.h. 32 | 33 | #include "production.h" 34 | 35 | PrivateCode::PrivateCode() : x_(0) {} 36 | -------------------------------------------------------------------------------- /source/tests/mars-e2e-test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # External dependencies 4 | # 5 | 6 | find_package(${META_PROJECT_NAME} REQUIRED HINTS "${CMAKE_CURRENT_SOURCE_DIR}/../../../") 7 | 8 | # 9 | # Executable name and options 10 | # 11 | 12 | # Target name 13 | set(target mars-e2e-test) 14 | set(target_lib mars) 15 | message(STATUS "Test ${target}") 16 | 17 | 18 | # 19 | # Sources 20 | # 21 | 22 | set(sources 23 | main.cpp 24 | mars_e2e_imu_prop.cpp 25 | mars_e2e_imu_pose_update.cpp 26 | mars_e2e_imu_pose_ooo_rework.cpp 27 | mars_e2e_imu_pose_outlier.cpp 28 | mars_e2e_imu_pose_update_perf.cpp 29 | mars_e2e_imu_prop_empty_updates.cpp 30 | ) 31 | 32 | 33 | # 34 | # Create executable 35 | # 36 | 37 | # Build executable 38 | add_executable(${target} 39 | ${sources} 40 | ) 41 | 42 | # Create namespaced alias 43 | add_executable(${META_PROJECT_NAME}::${target} ALIAS ${target}) 44 | 45 | 46 | # 47 | # Project options 48 | # 49 | 50 | set_target_properties(${target} 51 | PROPERTIES 52 | ${DEFAULT_PROJECT_OPTIONS} 53 | FOLDER "${IDE_FOLDER}" 54 | ) 55 | 56 | 57 | # 58 | # Include directories 59 | # 60 | 61 | target_include_directories(${target} 62 | PRIVATE 63 | ${DEFAULT_INCLUDE_DIRECTORIES} 64 | ) 65 | 66 | 67 | # 68 | # Libraries 69 | # 70 | 71 | target_link_libraries(${target} 72 | PRIVATE 73 | ${DEFAULT_LIBRARIES} 74 | ${META_PROJECT_NAME}::${target_lib} 75 | gmock-dev 76 | ) 77 | 78 | 79 | # 80 | # Compile definitions 81 | # 82 | 83 | target_compile_definitions(${target} 84 | PRIVATE 85 | ${DEFAULT_COMPILE_DEFINITIONS} 86 | ) 87 | 88 | 89 | # 90 | # Compile options 91 | # 92 | 93 | target_compile_options(${target} 94 | PRIVATE 95 | ${DEFAULT_COMPILE_OPTIONS} 96 | ) 97 | 98 | 99 | # 100 | # Linker options 101 | # 102 | 103 | target_link_libraries(${target} 104 | PRIVATE 105 | ${DEFAULT_LINKER_OPTIONS} 106 | ) 107 | 108 | -------------------------------------------------------------------------------- /source/tests/mars-e2e-test/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | int main(int argc, char* argv[]) 5 | { 6 | ::testing::InitGoogleMock(&argc, argv); 7 | return RUN_ALL_TESTS(); 8 | } 9 | -------------------------------------------------------------------------------- /source/tests/mars-test/eigen_runtime_test.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | 6 | class eigen_runtime_test: public testing::Test 7 | { 8 | public: 9 | }; 10 | 11 | template 12 | void test_rt(int const num_iterations) 13 | { 14 | Eigen::MatrixXd M1 = Eigen::MatrixXd::Random(dim,dim); 15 | Eigen::Matrix M_stat = Eigen::Matrix::Random(); 16 | 17 | typedef std::chrono::high_resolution_clock clk_t; 18 | typedef clk_t::time_point tp_t; 19 | { 20 | tp_t t1 = clk_t::now(); 21 | 22 | for(int i=0; i < num_iterations; i++) 23 | { 24 | M1 = M1*M1; 25 | } 26 | tp_t t2 = clk_t::now(); 27 | 28 | auto duration = std::chrono::duration_cast( t2 - t1 ).count(); 29 | std::cout << "["<( t2 - t1 ).count(); 43 | std::cout << "["<( t2 - t1 ).count(); 56 | std::cout << "["<(100000); 63 | } 64 | 65 | TEST_F(eigen_runtime_test, time_measurement_20) 66 | { 67 | test_rt<20>(10000); 68 | } 69 | 70 | TEST_F(eigen_runtime_test, time_measurement_100) 71 | { 72 | test_rt<100>(100); 73 | } 74 | -------------------------------------------------------------------------------- /source/tests/mars-test/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | int main(int argc, char* argv[]) 5 | { 6 | ::testing::InitGoogleMock(&argc, argv); 7 | return RUN_ALL_TESTS(); 8 | } 9 | -------------------------------------------------------------------------------- /source/tests/mars-test/mars_bind_sensor_data.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | class mars_bind_sensor_data : public testing::Test 19 | { 20 | public: 21 | }; 22 | 23 | TEST_F(mars_bind_sensor_data, CTOR) 24 | { 25 | mars::PoseSensorData sensor_data; 26 | 27 | constexpr int core_state_size = mars::CoreStateType::size_error_; 28 | int sensor_state_size = sensor_data.state_.cov_size_; 29 | int full_state_size = core_state_size + sensor_state_size; 30 | 31 | // Check for correct dimensions 32 | EXPECT_EQ(sensor_data.get_full_cov().size(), full_state_size * full_state_size); 33 | 34 | // Check that all entrys are zero when no data was written 35 | EXPECT_EQ(sensor_data.get_full_cov(), Eigen::MatrixXd::Zero(full_state_size, full_state_size)); 36 | 37 | // Check that the cov is returned correctly, and that the core cov is set to zero 38 | Eigen::MatrixXd full_cov(full_state_size, full_state_size); 39 | full_cov.setRandom(); 40 | full_cov = mars::Utils::EnforceMatrixSymmetry(full_cov); 41 | 42 | Eigen::MatrixXd expected_result = full_cov; 43 | expected_result.block(0, 0, core_state_size, core_state_size) = 44 | Eigen::Matrix::Zero(); 45 | 46 | sensor_data.set_cov(full_cov); 47 | Eigen::MatrixXd full_cov_return = sensor_data.get_full_cov(); 48 | 49 | Eigen::IOFormat OctaveFmt(Eigen::StreamPrecision, 0, ", ", ";\n", "", "", "[", "]"); 50 | std::cout << (full_cov_return - expected_result).format(OctaveFmt) << std::endl; 51 | 52 | EXPECT_EQ(expected_result, full_cov_return); 53 | } 54 | -------------------------------------------------------------------------------- /source/tests/mars-test/mars_ekf.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | class mars_Ekf_test : public testing::Test 16 | { 17 | public: 18 | }; 19 | 20 | TEST_F(mars_Ekf_test, CTOR_EKF) 21 | { 22 | Eigen::Matrix4d H = Eigen::Matrix4d::Random(); 23 | Eigen::Matrix4d R = Eigen::Matrix4d::Random(); 24 | Eigen::MatrixXd res = Eigen::MatrixXd::Random(4, 1); 25 | Eigen::Matrix4d P = Eigen::Matrix4d::Random(); 26 | 27 | mars::Ekf test(H, R, res, P); 28 | test.CalculateCorrection(); 29 | test.CalculateCovUpdate(); 30 | } 31 | -------------------------------------------------------------------------------- /source/tests/mars-test/mars_imu_sensor.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef MARS_IMU_SENSOR_CPP 12 | #define MARS_IMU_SENSOR_CPP 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | class mars_imu_sensor_test : public testing::Test 21 | { 22 | public: 23 | }; 24 | 25 | TEST_F(mars_imu_sensor_test, CTOR_) 26 | { 27 | Eigen::Vector3d linear_acceleration_1 = { 1, 2, 3 }; 28 | Eigen::Vector3d angular_velocity_1 = { 4, 5, 6 }; 29 | mars::IMUMeasurementType imu_measurement_1(linear_acceleration_1, angular_velocity_1); 30 | mars::IMUMeasurementType imu_measurement_2(linear_acceleration_1, angular_velocity_1); 31 | 32 | ASSERT_EQ(imu_measurement_1.linear_acceleration_, linear_acceleration_1); 33 | ASSERT_EQ(imu_measurement_1.angular_velocity_, angular_velocity_1); 34 | ASSERT_EQ(imu_measurement_1, imu_measurement_2); 35 | 36 | // Copy constructor 37 | mars::IMUMeasurementType imu_measurement_3(imu_measurement_1); 38 | ASSERT_EQ(imu_measurement_1, imu_measurement_3); 39 | } 40 | 41 | #endif // MARS_IMU_SENSOR_CPP 42 | -------------------------------------------------------------------------------- /source/tests/mars-test/mars_m_perf.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #include 12 | #include 13 | 14 | class mars_m_perf_test : public testing::Test 15 | { 16 | public: 17 | }; 18 | 19 | TEST_F(mars_m_perf_test, CTOR) 20 | { 21 | mars::MPerf m_perf("Test Case"); 22 | 23 | m_perf.StartEntity("cb"); 24 | m_perf.StartEntity("ab"); 25 | m_perf.StartEntity("bb"); 26 | m_perf.StopEntity("cb"); 27 | m_perf.StopEntity("ab"); 28 | m_perf.StopEntity("bb"); 29 | 30 | m_perf.StartEntity("cb"); 31 | m_perf.StartEntity("ab"); 32 | m_perf.StartEntity("bb"); 33 | m_perf.StopEntity("cb"); 34 | m_perf.StopEntity("ab"); 35 | m_perf.StopEntity("bb"); 36 | 37 | m_perf.StartEntity("cb"); 38 | m_perf.StartEntity("ab"); 39 | m_perf.StartEntity("bb"); 40 | m_perf.StopEntity("cb"); 41 | m_perf.StopEntity("ab"); 42 | m_perf.StopEntity("bb"); 43 | 44 | m_perf.StartEntity("cb"); 45 | m_perf.StartEntity("ab"); 46 | m_perf.StartEntity("bb"); 47 | m_perf.StopEntity("cb"); 48 | m_perf.StopEntity("ab"); 49 | m_perf.StopEntity("bb"); 50 | 51 | m_perf.PrintStats(); 52 | 53 | std::cout << "List of Entries \n" << m_perf.get_entity_names() << std::endl; 54 | } 55 | -------------------------------------------------------------------------------- /source/tests/mars-test/mars_time.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #include 12 | #include 13 | 14 | class mars_time_test : public testing::Test 15 | { 16 | public: 17 | }; 18 | 19 | TEST_F(mars_time_test, CTOR) 20 | { 21 | mars::Time empty_ctor; 22 | EXPECT_EQ(empty_ctor.get_seconds(), 0.0); 23 | 24 | mars::Time positive_ctor(10); 25 | EXPECT_EQ(positive_ctor.get_seconds(), 10.0); 26 | 27 | mars::Time negative_ctor(-10); 28 | EXPECT_EQ(negative_ctor.get_seconds(), -10.0); 29 | } 30 | 31 | TEST_F(mars_time_test, OPERATOR) 32 | { 33 | mars::Time timestamp(15); 34 | 35 | // Logic 36 | EXPECT_FALSE(timestamp < 15); 37 | EXPECT_FALSE(timestamp > 15); 38 | EXPECT_FALSE(timestamp > 16); 39 | EXPECT_FALSE(timestamp < 14); 40 | 41 | EXPECT_TRUE(timestamp <= 15); 42 | EXPECT_TRUE(timestamp >= 15); 43 | EXPECT_TRUE(timestamp == 15); 44 | EXPECT_TRUE(timestamp < 16); 45 | EXPECT_TRUE(timestamp > 14); 46 | 47 | // Math 48 | const double a = 2.1; 49 | const double b = 3.2; 50 | 51 | mars::Time t1(a); 52 | mars::Time t2(b); 53 | EXPECT_EQ(t1 + t2, mars::Time(a + b)); 54 | EXPECT_EQ(t1 - t2, mars::Time(a - b)); 55 | EXPECT_EQ(t2 - t1, mars::Time(b - a)); 56 | } 57 | 58 | TEST_F(mars_time_test, ABS) 59 | { 60 | mars::Time positive_ctor(1.3); 61 | EXPECT_EQ(positive_ctor.abs(), 1.3); 62 | 63 | mars::Time negative_ctor(-1.3); 64 | EXPECT_EQ(negative_ctor.abs(), 1.3); 65 | } 66 | -------------------------------------------------------------------------------- /source/tests/mars-test/mars_type_erasure.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2021 Christian Brommer, Control of Networked Systems, University of Klagenfurt, Austria. 2 | // 3 | // All rights reserved. 4 | // 5 | // This software is licensed under the terms of the BSD-2-Clause-License with 6 | // no commercial use allowed, the full terms of which are made available 7 | // in the LICENSE file. No license in patents is granted. 8 | // 9 | // You can contact the author at 10 | 11 | #ifndef MARS_TYPE_ERASURE_CPP 12 | #define MARS_TYPE_ERASURE_CPP 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | class mars_type_erasure_test : public testing::Test 21 | { 22 | public: 23 | }; 24 | 25 | TEST_F(mars_type_erasure_test, IMU_MEASUREMENT) 26 | { 27 | Eigen::Vector3d linear_acceleration = { 1, 2, 3 }; 28 | Eigen::Vector3d angular_velocity = { 4, 5, 6 }; 29 | 30 | mars::IMUMeasurementType imu_measurement(linear_acceleration, angular_velocity); 31 | std::shared_ptr test = std::make_shared(imu_measurement); 32 | mars::IMUMeasurementType resolved_void = *(static_cast(test.get())); 33 | 34 | ASSERT_EQ(imu_measurement, resolved_void); 35 | } 36 | 37 | #endif // MARS_TYPE_ERASURE_CPP 38 | -------------------------------------------------------------------------------- /source/tests/test_data.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aau-cns/mars_lib/2abe2576fe7ff79cd574be6c5c6d7b56a10ead38/source/tests/test_data.tar.gz -------------------------------------------------------------------------------- /source/tests/test_data_settings.h.in: -------------------------------------------------------------------------------- 1 | #define ${META_PROJECT_ID}_TEST_DATA_PATH "@TEST_DATA_DIR@" 2 | -------------------------------------------------------------------------------- /source/version.h.in: -------------------------------------------------------------------------------- 1 | 2 | #define ${META_PROJECT_ID}_PROJECT_NAME "@META_PROJECT_NAME@" 3 | #define ${META_PROJECT_ID}_PROJECT_DESCRIPTION "@META_PROJECT_DESCRIPTION@" 4 | 5 | #define ${META_PROJECT_ID}_AUTHOR_ORGANIZATION "@META_AUTHOR_ORGANIZATION@" 6 | #define ${META_PROJECT_ID}_AUTHOR_DOMAIN "@META_AUTHOR_DOMAIN@" 7 | #define ${META_PROJECT_ID}_AUTHOR_MAINTAINER "@META_AUTHOR_MAINTAINER@" 8 | 9 | #define ${META_PROJECT_ID}_VERSION_MAJOR "@META_VERSION_MAJOR@" 10 | #define ${META_PROJECT_ID}_VERSION_MINOR "@META_VERSION_MINOR@" 11 | #define ${META_PROJECT_ID}_VERSION_PATCH "@META_VERSION_PATCH@" 12 | #define ${META_PROJECT_ID}_VERSION_REVISION "@META_VERSION_REVISION@" 13 | 14 | #define ${META_PROJECT_ID}_VERSION "@META_VERSION@" 15 | #define ${META_PROJECT_ID}_NAME_VERSION "@META_NAME_VERSION@" 16 | --------------------------------------------------------------------------------