Skip to content

fix(joint_state_broadcaster): suppress confusing warning for standard interfaces (backport #2276)#2334

Merged
christophfroehlich merged 1 commit intokiltedfrom
mergify/bp/kilted/pr-2276
Apr 28, 2026
Merged

fix(joint_state_broadcaster): suppress confusing warning for standard interfaces (backport #2276)#2334
christophfroehlich merged 1 commit intokiltedfrom
mergify/bp/kilted/pr-2276

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify Bot commented Apr 27, 2026

Description

This PR fixes the confusing warning message from JointStateBroadcaster when using standard interfaces like velocity with the default mapping.

Problem

When configuring the broadcaster with standard interfaces:

rotor_state_broadcaster:
  ros__parameters:
    joints: [rotor/1, rotor/2, rotor/3, rotor/4]
    interfaces: [velocity]

The following confusing warning was displayed:

Mapping from 'velocity' to interface 'velocity' will not be done, because 'velocity' is defined in 'interface' parameter.

This warning is confusing because:

  1. The user didn't configure any custom mapping
  2. The data is being published correctly to the velocity field
  3. The warning suggests something is wrong when everything works as expected

Solution

The warning is now only displayed when there's an actual custom mapping being ignored (i.e., when the interface name differs from the JointState field name).

For example, if someone had:

interfaces: [velocity]
map_interface_to_joint_state:
  velocity: custom_velocity_interface

Then the warning would still be shown because the custom mapping custom_velocity_interface -> velocity would be ignored.

But for the standard case where interfaces: [velocity] and the default mapping velocity -> velocity, no warning is shown because no mapping is needed.

Changes

  • Modified joint_state_broadcaster.cpp to only print the warning when interface != interface_to_map

Related Issue

Fixes #2261


This is an automatic backport of pull request #2276 done by Mergify.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.77%. Comparing base (c42dc54) to head (6934268).
⚠️ Report is 1 commits behind head on kilted.

Additional details and impacted files
@@            Coverage Diff             @@
##           kilted    #2334      +/-   ##
==========================================
- Coverage   85.81%   85.77%   -0.05%     
==========================================
  Files         152      152              
  Lines       14962    15082     +120     
  Branches     1293     1293              
==========================================
+ Hits        12840    12936      +96     
- Misses       1663     1688      +25     
+ Partials      459      458       -1     
Flag Coverage Δ
unittests 85.77% <100.00%> (-0.05%) ⬇️

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

Files with missing lines Coverage Δ
..._state_broadcaster/src/joint_state_broadcaster.cpp 88.26% <ø> (+0.55%) ⬆️
..._broadcaster/test/test_joint_state_broadcaster.cpp 96.96% <100.00%> (-0.38%) ⬇️

... and 21 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@christophfroehlich christophfroehlich merged commit c2a182f into kilted Apr 28, 2026
15 of 16 checks passed
@christophfroehlich christophfroehlich deleted the mergify/bp/kilted/pr-2276 branch April 28, 2026 06:29
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.

2 participants