{"id":28266808,"url":"https://github.com/maximilian-nitsch/magnetometer-simulator","last_synced_at":"2026-05-14T12:31:34.948Z","repository":{"id":286080944,"uuid":"960304151","full_name":"maximilian-nitsch/Magnetometer-Simulator","owner":"maximilian-nitsch","description":"C++ Simulator and ROS 2 Node for Magnetometers (MAG). ","archived":false,"fork":false,"pushed_at":"2025-04-11T08:39:36.000Z","size":12818,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-20T13:40:34.329Z","etag":null,"topics":["autonomous-robots","autonomous-underwater-vehicle","autonomous-vehicles","auv-simulator","magnetometer","navigation","robotics","robotics-simulation","sensor","simulation","simulator"],"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/maximilian-nitsch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT","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":"2025-04-04T07:49:10.000Z","updated_at":"2025-06-10T06:55:40.000Z","dependencies_parsed_at":"2025-06-19T01:43:22.733Z","dependency_job_id":null,"html_url":"https://github.com/maximilian-nitsch/Magnetometer-Simulator","commit_stats":null,"previous_names":["maximilian-nitsch/magnetometer-simulator"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/maximilian-nitsch/Magnetometer-Simulator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximilian-nitsch%2FMagnetometer-Simulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximilian-nitsch%2FMagnetometer-Simulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximilian-nitsch%2FMagnetometer-Simulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximilian-nitsch%2FMagnetometer-Simulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maximilian-nitsch","download_url":"https://codeload.github.com/maximilian-nitsch/Magnetometer-Simulator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximilian-nitsch%2FMagnetometer-Simulator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33024898,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":["autonomous-robots","autonomous-underwater-vehicle","autonomous-vehicles","auv-simulator","magnetometer","navigation","robotics","robotics-simulation","sensor","simulation","simulator"],"created_at":"2025-05-20T14:14:17.572Z","updated_at":"2026-05-14T12:31:34.917Z","avatar_url":"https://github.com/maximilian-nitsch.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# C++/ROS 2 Magnetometer Simulator\n![Build](https://github.com/maximilian-nitsch/Magnetometer-Simulator/actions/workflows/ci.yaml/badge.svg)\u003c!-- --\u003e\n![License](https://img.shields.io/github/license/maximilian-nitsch/Magnetometer-Simulator.svg)\u003c!-- --\u003e\n[![Last Commit](https://img.shields.io/github/last-commit/maximilian-nitsch/Magnetometer-Simulator)](https://github.com/maximilian-nitsch/Magnetometer-Simulator/commits/main)\u003c!-- --\u003e\n[![ROS2 Humble](https://img.shields.io/badge/ROS2-Humble-blue)](https://index.ros.org/doc/ros2/Installation/Humble/)\u003c!-- --\u003e\n[![Release](https://img.shields.io/github/v/release/maximilian-nitsch/Magnetometer-Simulator)](https://github.com/maximilian-nitsch/Magnetometer-Simulator/releases)\u003c!-- --\u003e\n[![Open Issues](https://img.shields.io/github/issues/maximilian-nitsch/Magnetometer-Simulator)](https://github.com/maximilian-nitsch/Magnetometer-Simulator/issues)\u003c!-- --\u003e\n[![Contributors](https://img.shields.io/github/contributors/maximilian-nitsch/Magnetometer-Simulator)](https://github.com/maximilian-nitsch/Magnetometer-Simulator/graphs/contributors)\n\n![](./data/icon.svg)\n\n\u003c!--- protected region package header begins --\u003e\n**Author:**\n- Maximilian Nitsch \u003cm.nitsch@irt.rwth-aachen.de\u003e\n\n**Affiliation:** Institute of Automatic Control - RWTH Aachen University\n\n**Maintainer:**\n  - Maximilian Nitsch \u003cm.nitsch@irt.rwth-aachen.de\u003e\n\u003c!--- protected region package header ends --\u003e\n\n## Description\nThis project provides a high-fidelity MAG simulator written in C++.\n\nThe simulator implements the following features:\n- Magnetometer measurement simulation\n- Ideal measurement model\n- Soft iron distortion\n- Hard iron bias\n- Stochastic noise (colored/non-white noise)\n  - Velocity/angular random walk\n  - Bias instability\n  - Acceleration/rate random walk\n- Saturation\n- Quantization errors\n- All parameters for the MAG can be configured in a YAML file\n- All models and effects can be enabled/disabled separately\n\nAn example config file from real data of a PNI RM3100 MAG is provided.\n\n## Table of Contents\n\n- [Dependencies](#dependencies)\n- [Installation](#installation)\n- [Usage](#usage)\n- [ROS 2 Nodes](#ros-2-nodes)\n  - [Publisher Node](#publisher-node)\n  - [Subscriber Node](#subscriber-node)\n- [Coding Guidelines](#coding-guidelines)\n- [References](#references)\n- [Reports](#reports)\n- [Contributing](#contributing)\n- [License](#license)\n\n# Dependencies\n\nThis project depends on the following literature and libraries:\n\n- **Eigen3**: Eigen is a C++ template library for linear algebra: [Eigen website](https://eigen.tuxfamily.org/).\n- **ROS 2 Humble**: ROS 2 is a set of software libraries and tools for building robot applications: [ROS 2 Installation page](https://docs.ros.org/en/humble/Installation.html).\n- **Navigation Utilities Package**: ROS 2 package with common navigation utilities for TRIPLE-GNC: [Navigation Utilities](https://gitlab.informatik.uni-bremen.de/triple/gnc/utilities/navigation-utilities)\n\n\n# Installation\n\nTo install the `mag_simulator_package`, you need to follow these steps:\n\n1. **Install Eigen3**: Eigen3 is a dependency for your package. You can install it using your package manager. For example, on Ubuntu, you can install it using the following command:\n\n    ```bash\n    sudo apt-get install libeigen3-dev\n    ```\n\n2. **Install ROS 2 Humble**: Ensure you have ROS 2 (Humble) installed. You can follow the official installation instructions provided by ROS 2. Visit [ROS 2 Humble Installation page](https://docs.ros.org/en/humble/Installation.html) for detailed installation instructions tailored to your platform.\n\n3. **Clone the Package**: Clone the package repository to your ROS 2 workspace. If you don't have a ROS 2 workspace yet, you can create one using the following commands:\n\n    ```bash\n    mkdir -p /path/to/ros2_workspace/src\n    cd /path/to/ros2_workspace/src\n    ```\n\n    Now, clone the package repository:\n\n    ```bash\n    git clone \u003crepository_url\u003e\n    ```\n\n    Replace `\u003crepository_url\u003e` with the URL of your package repository.\n\n4. **Build the Package**: Once the package is cloned, you must build it using colcon, the default build system for ROS 2. Navigate to your ROS 2 workspace and run the following command:\n\n    ```bash\n    cd /path/to/ros2_workspace\n    colcon build\n    ```\n\n    This command will build all the packages in your workspace, including the newly added package.\n\n5. **Source the Workspace**: After building the package, you need to source your ROS 2 workspace to make the package available in your ROS 2 environment. Run the following command:\n\n    ```bash\n    source /path/to/ros2_workspace/install/setup.bash\n    ```\n\n    Replace `/path/to/ros2_workspace` with the actual path to your ROS 2 workspace.\n\nThat's it! Your `mag_simulator_package` should now be installed along with its dependencies and ready to use in your ROS 2 environment.\n\n## Usage\n\n1. **Configure your YAML file** for your MAG or use the default file.\n\n2. **Start the MAG simulator** with the launch file:\n    ```bash\n    ros2 launch mag_simulator_package mag_simulator.launch.py\n    ```\n  The MAG simulator prints your settings and waits for a ground truth odometry message.\n\n3. **Provide an odometry publisher** from you vehicle simulation.\n  For testing, you can launch the odometry_test_publisher node:\n    ```bash\n    ros2 launch mag_simulator_package odometry_test_publisher.py\n    ```\n\n4. The MAG values should now be published.\n\n\n**Important Usage Information**:\n- The odometry message must be published with at least the MAG data rate/sample time.\n- The message `/mag/diagnostic` will show `WARN` if the odometry rate is lower.\n- If no odometry message is published, the message `/mag/diagnostic` will show `STALE`.\n- If everything is correct, `/mag/diagnostic` will show `OK`. \n\n## ROS 2 Nodes\n\nThe MAG simulator node implements two publishers and subscribes to one topic.\nROS 2 services or actions are not provided.\n\n### Publisher Node\n\nThis node publishes the following topics:\n\n| Topic Name       | Message Type        | Description                        |\n|------------------|---------------------|------------------------------------|\n| `/nanoauv/sensor/navigation/mag/magnetic_field`   | `sensor_msgs/MagneticField`   | Publishes MAG sensor data.|\n| `/nanoauv/sensor/navigation/mag/magnetic_field_ideal`   | `sensor_msgs/MagneticField`   | Publishes ideal MAG sensor data.|\n| `/nanoauv/sensor/navigation/mag/diagnostic`  | `diagnostic_msgs/DiagnosticStatus.msg` | Publishes the diagnostic status of the MAG data.\n\n### Subscriber Node\n\nThis node subscribes to the following topics:\n\n| Topic Name        | Message Type        | Description                        |\n|-------------------|---------------------|------------------------------------|\n| `/nanoauv/odometry`| `nav_msgs/Odometry.msg`| Subscribes to ground truth vehicle odometry.|\n\n## Coding Guidelines\n\nThis project follows these coding guidelines:\n- https://google.github.io/styleguide/cppguide.html\n- http://docs.ros.org/en/humble/The-ROS2-Project/Contributing/Code-Style-Language-Versions.html \n\n## References\n\nThe MAG simulator implementation closely follows the work:\n- J. A. Farrell, F. O. Silva, F. Rahman and J. Wendel, \"Inertial Measurement Unit Error Modeling Tutorial: Inertial Navigation System State Estimation with Real-Time Sensor Calibration,\" in IEEE Control Systems Magazine, vol. 42, no. 6, pp. 40-66, Dec. 2022, [DOI: 10.1109/MCS.2022.3209059](https://doi.org/10.1109/MCS.2022.3209059).\n- J. A. Farrell, \"Aided Navigation Systems: GPS and High Rate Sensors,\" New York, NY, McGraw-Hill, 552 pages, 2008.\n\n## Contributing\n\nIf you want to contribute to the project, see the [CONTRIBUTING](CONTRIBUTING) file for details.\n\n## License\n\nThis project is licensed under the BSD-3-Clause License. Please look at the [LICENSE](LICENSE) file for details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximilian-nitsch%2Fmagnetometer-simulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaximilian-nitsch%2Fmagnetometer-simulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximilian-nitsch%2Fmagnetometer-simulator/lists"}