{"id":28516738,"url":"https://github.com/mit-spark/config_utilities","last_synced_at":"2025-07-22T10:06:52.006Z","repository":{"id":204589767,"uuid":"712191861","full_name":"MIT-SPARK/config_utilities","owner":"MIT-SPARK","description":"Automatic C++ config structs and tools.","archived":false,"fork":false,"pushed_at":"2025-07-14T15:52:46.000Z","size":850,"stargazers_count":34,"open_issues_count":5,"forks_count":8,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-07-14T20:06:17.966Z","etag":null,"topics":["config","cpp","ros","tools","utilities","yaml"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MIT-SPARK.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-10-31T01:24:11.000Z","updated_at":"2025-06-26T23:04:00.000Z","dependencies_parsed_at":"2024-02-21T03:23:40.528Z","dependency_job_id":"0d73e1c0-509f-43b8-a49f-68a18774ee57","html_url":"https://github.com/MIT-SPARK/config_utilities","commit_stats":null,"previous_names":["mit-spark/config_utilities"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MIT-SPARK/config_utilities","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MIT-SPARK%2Fconfig_utilities","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MIT-SPARK%2Fconfig_utilities/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MIT-SPARK%2Fconfig_utilities/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MIT-SPARK%2Fconfig_utilities/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MIT-SPARK","download_url":"https://codeload.github.com/MIT-SPARK/config_utilities/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MIT-SPARK%2Fconfig_utilities/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266473051,"owners_count":23934476,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["config","cpp","ros","tools","utilities","yaml"],"created_at":"2025-06-09T04:12:39.357Z","updated_at":"2025-07-22T10:06:51.998Z","avatar_url":"https://github.com/MIT-SPARK.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"![CMake: Build](https://github.com/MIT-SPARK/config_utilities/actions/workflows/cmake_build.yml/badge.svg)\n\n# config_utilities\n`config_utilities` is a minimal but powerful C++ library, providing tools for automated modular software configuration. Parse, verify, and print C++ config structs and run-time configuration of object-oriented modular systems.\n\n## Table of contents\n- [Credits](#credits)\n- [Why `config_utilities`?](#why-config_utilities)\n- [Installation](#installation)\n- [How to `config_utilities`?](#how-to-config_utilities)\n- [Example Projects using `config_utilities`](#example-projects-using-config_utilities)\n\n## Credits\nThis library was developed by [Lukas Schmid](https://schmluk.github.io/) and [Nathan Hughes](http://mit.edu/sparklab/people.html) at the [MIT-SPARK Lab](http://mit.edu/sparklab), based on functionalities in [ethz-asl/config_utilities](https://github.com/ethz-asl/config_utilities) and [Hydra](https://github.com/MIT-SPARK/Hydra), and is released under a [BSD-3-Clause License](LICENSE)! Additional contributions welcome! This work was supported in part by the Swiss National Science Foundation and Amazon.\n\n## Why `config_utilities`?\nAmong many other, the key features of `config_utilities` include:\n- **Minimal dependencies**: Only C++17 standard library and [yaml-cpp](https://github.com/jbeder/yaml-cpp).\n- Declare **any struct a config**, also from external projects:\n    ```c++\n    namespace external_project {\n        void declare_config(ExternalObject\u0026 config); // that's all!\n    }   // namespace external_project\n    ```\n- **Minimal** and **clear, human readable interfaces** for config definitions:\n    ```c++\n    void declare_config(MyConfig\u0026 config) {\n        using namespace config;\n        name(\"MyConfig\");                             // Name for printing.\n        field(config.distance, \"distance\", \"m\");      // Field definition.\n        check(config.distance, GT, 0.0, \"distance\");  // Ensure 'distance \u003e 0'.\n    }\n    ```\n- **Everything** related to a config is defined in a **single place**.\n  ```c++\n  void declare_config(MyConfig\u0026 config) { /* ALL the information about a config is here */ }\n  ```\n- Parse any declared config from **various data sources**, **without pulling in dependencies** on data sources into core libraries:\n    ```c++\n    core.cpp {\n        struct MyConfig { ... };\n        void declare_config(MyConfig\u0026 config) { ... };\n    }  // Depends only on C++ and yaml-cpp.\n\n    application.cpp {\n        MyConfig config1 = fromYamlFile\u003cMyConfig\u003e(file_path);\n        MyConfig config2 = fromRos\u003cMyConfig\u003e(node_handle);\n    }  // Pull in dependencies as needed.\n    ```\n- **Automatically implements** frequently used functionalities, such as **checking** for valid parameters and **formatting** to string:\n    ```c++\n    MyObject(const MyConfig\u0026 config) : config_(checkValid(config)) {\n        // Do magic with config_, which has valid parameters only.\n        std::cout \u003c\u003c config_ \u003c\u003c std::endl;\n    }\n    ```\n- Automatic **run-time module creation** based on specified configurations:\n    ```cpp\n    static auto registration = Registration\u003cBase, MyDerived\u003e(\"my_derived\");\n\n    const std::string module_type = \"my_derived\";\n    std::unique_ptr\u003cBase\u003e module = create(module_type);\n    ```\n- **Informative, clear**, and **human readable** printing of potentially complicated config structs:\n    ```\n    =================================== MyConfig ===================================\n    distance [m]:                 -0.9876\n    A ridiculously long field name that will not be wrapped: Short Value (default)\n    A ridiculously long field name that will also not be wrapped:\n                                  A really really really ridiculously long string th\n                                  at will be wrapped. (default)\n    A really really really really really really ridiculously long field name that wi\n    ll be wrapped:                A really really really ridiculously long string th\n                                  at will also be wrapped. (default)\n    vec:                          [5, 4, 3, 2, 1]\n    map:                          {b: 2, c: 3, d: 4, e: 5}\n    mat:                          [[1, 2, 3],\n                                   [4, 5, 6],\n                                   [7, 8, 9]]\n    my_enum:                      B\n    sub_config [SubConfig] (default):\n       f:                         0.123 (default)\n       s:                         test (default)\n       sub_sub_config [SubSubConfig] (default):\n          color:                  [255, 127, 0] (default)\n          size:                   5 (default)\n    ================================================================================\n    ```\n\n- **Verbose warnings and errors** if desired for clear and easy development and use:\n    ```\n    =================================== MyConfig ===================================\n    Warning: Check failed for 'distance': param \u003e 0 (is: '-1').\n    Warning: Check failed for 'subconfig.f': param within [0, 100) (is: '123').\n    Warning: Failed to parse param 'vec': Data is not a sequence.\n    Warning: Failed to parse param 'mat': Incompatible Matrix dimensions: Requested\n            3x3 but got 3x4.\n    Warning: Failed to parse param 'my_enum': Name 'D' is out of bounds for enum wit\n            h names ['A', 'B', 'C'].\n    Warning: Failed to parse param 'uint': Value '-1' underflows storage min of '0'.\n    ================================================================================\n\n    [ERROR] No module of type 'NotRegistered' registered to the factory for BaseT='d\n    emo::Base' and ConstructorArguments={'int'}. Registered are: 'DerivedB', 'Derive\n    dA'.\n\n    [ERROR] Cannot create a module of type 'DerivedA': No modules registered to the\n    factory for BaseT='demo::Base' and ConstructorArguments={'int', 'float'}. Regist\n    er modules using a static config::Registration\u003cBaseT, DerivedT, ConstructorArgum\n    ents...\u003e struct.\n    ```\n\n## Installation\n\nThis package is compatible with `ROS2`/`colcon`. Just clone it into your workspace and you should be all set!\n```bash\ncd ~/my_ws/src\ngit clone git@github.com:MIT-SPARK/config_utilities.git\ncolcon build config_utilities_ros\n```\n\nIf you want to build and install without colcon/ROS, that is easy, too! Just clone this repository and build via CMake:\n```bash\ngit clone git@github.com:MIT-SPARK/config_utilities.git\ncd config_utilities/config_utilities\nmkdir build\ncd build\ncmake ..\nmake -j\n\n# optionally install this package\nsudo make install\n```\n\n## How to `config_utilities`\nWe provide detailed introductions about everything you need to know about `config_utilities` in the following [tutorials](docs/README.md#tutorials) and some verbose example [demos](docs/README.md#demos) that you can run.\n\nThe (non-ros) demos can be run via the `run_demo.py` utility in the scripts directory. If you are building this library via catkin, you can run one of the following to see the results of one of the corresponding demo files:\n```\npython3 scripts/run_demo.py config\npython3 scripts/run_demo.py inheritance\npython3 scripts/run_demo.py factory\n```\n\n\u003e **ℹ️ Note**\u003cbr\u003e\n\u003e If you're building via cmake, you can point `run_demo.py` to the build directory with `-b/--build_path`.\n\nThe ros demo for dynamic config updates can be run via:\n```\nros2 launch config_utilities_ros demo_ros_dynamic_config.yaml\n```\n\nIf you are looking for a specific use case that is not in the tutorials or demos, chances are you can find a good example in the `tests/` directory!\n\n\n# Example Projects using `config_utilities`\nMany cool projects are already using `config_utilities`! If you are using `config_utilities` and would like to be featured, please open a pull request or reach out!\n\n### Academic Open-source Projects\nThese projects are openly available, check them out to see what `config_utilities` can do!\n* [MIT-SPARK/Khronos](https://github.com/MIT-SPARK/Khronos)\n* [MIT-SPARK/Hydra](https://github.com/MIT-SPARK/Hydra)\n\n### Use in Industry\nSeveral leading companies and start-ups in robotics have let us know that they use `config_utilities`, but we cannot currently list them. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmit-spark%2Fconfig_utilities","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmit-spark%2Fconfig_utilities","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmit-spark%2Fconfig_utilities/lists"}