Skip to content

broadcaster for magnetic field values from a magnetometer#2214

Open
christianrauch wants to merge 4 commits intoros-controls:masterfrom
christianrauch:magnetometer_broadcaster
Open

broadcaster for magnetic field values from a magnetometer#2214
christianrauch wants to merge 4 commits intoros-controls:masterfrom
christianrauch:magnetometer_broadcaster

Conversation

@christianrauch
Copy link
Copy Markdown

@christianrauch christianrauch commented Mar 15, 2026

This PR adds a broadcaster for magnetometers via the semantic_components::MagneticFieldSensor, similar to how this is done for other semantic components (semantic_components::IMUSensor, semantic_components::ForceTorqueSensor).


  • Fork the repository.
  • Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
  • Ensure local tests pass. (colcon test and pre-commit run (requires you to install pre-commit by pip3 install pre-commit)
  • Commit to your fork using clear commit messages.
  • Send a pull request, answering any default questions in the pull request interface.
  • Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.

@christianrauch christianrauch marked this pull request as ready for review March 15, 2026 21:33
@thedevmystic
Copy link
Copy Markdown
Contributor

thedevmystic commented Mar 17, 2026

Hey @christianrauch, I see its some usage. Let's see what maintainers have to say.

And another thing, why is the class declaration is in implementation file (everything is in .cpp file).

It'll be really better if declaration was in .hpp and implementation was in .cpp

@christianrauch christianrauch force-pushed the magnetometer_broadcaster branch from 9d9b9fc to 22c1d40 Compare March 17, 2026 10:24
bmagyar
bmagyar previously approved these changes Mar 20, 2026
Copy link
Copy Markdown
Member

@bmagyar bmagyar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hpp/cpp comment is a good catch indeed but since this is delivered as a plugin I'm not too concerned about it. Thanks for pointing it out @thedevmystic

@christianrauch
Copy link
Copy Markdown
Author

I addressed the one comment about the maintainers and fixed one CI issue from my side.

The CI shows a couple of other issues, such as missing dependencies on controller_manager and backward_ros, which I suspect come from other packages since the magnetometer_broadcaster is not using controller_manager and backward_ros is already defined.

@christianrauch christianrauch force-pushed the magnetometer_broadcaster branch from cddcb89 to 45bea18 Compare March 25, 2026 12:12
@christianrauch christianrauch requested a review from bmagyar March 25, 2026 12:13
Copy link
Copy Markdown
Member

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't reviewed the code yet, but there is a lack of documentation. At least a brief description rst file, added to the controller_index and a note in the release_notes is mandatory.

@christianrauch christianrauch force-pushed the magnetometer_broadcaster branch from 45bea18 to b5c6ffa Compare March 30, 2026 19:03
bmagyar
bmagyar previously approved these changes Mar 30, 2026
Copy link
Copy Markdown
Member

@bmagyar bmagyar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good but please purge the linting dependencies and run pre-commit to fix formatting issues

@christianrauch
Copy link
Copy Markdown
Author

Generally looks good but please purge the linting dependencies and run pre-commit to fix formatting issues

I removed the ament_lint test dependencies. Can you trigger the CI again?

FYI, I essentially took them from the imu_sensor_broadcaster:

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

If they are not required for the packages in this repo, you also want to remove them from there.

I will add the documentation later, but I would like to see that the CI is happy first.

@christophfroehlich christophfroehlich mentioned this pull request Mar 30, 2026
8 tasks
@christophfroehlich
Copy link
Copy Markdown
Member

FYI, I essentially took them from the imu_sensor_broadcaster:

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

If they are not required for the packages in this repo, you also want to remove them from there.

#2263

@christianrauch christianrauch force-pushed the magnetometer_broadcaster branch from 7876ec6 to 414ff43 Compare March 30, 2026 20:24
@christianrauch
Copy link
Copy Markdown
Author

I haven't reviewed the code yet, but there is a lack of documentation. At least a brief description rst file, added to the controller_index and a note in the release_notes is mandatory.

I also added the documentation now. Thanks for the feedback.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 31, 2026

Codecov Report

❌ Patch coverage is 86.48649% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.69%. Comparing base (fc570f8) to head (8473213).

Files with missing lines Patch % Lines
...meter_broadcaster/src/magnetometer_broadcaster.cpp 60.52% 14 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2214      +/-   ##
==========================================
+ Coverage   84.68%   84.69%   +0.01%     
==========================================
  Files         153      156       +3     
  Lines       15319    15430     +111     
  Branches     1332     1333       +1     
==========================================
+ Hits        12973    13069      +96     
- Misses       1858     1872      +14     
- Partials      488      489       +1     
Flag Coverage Δ
unittests 84.69% <86.48%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...caster/test/test_load_magnetometer_broadcaster.cpp 100.00% <100.00%> (ø)
...broadcaster/test/test_magnetometer_broadcaster.cpp 100.00% <100.00%> (ø)
...meter_broadcaster/src/magnetometer_broadcaster.cpp 60.52% <60.52%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants