Skip to content

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

Merged
christophfroehlich merged 1 commit intojazzyfrom
mergify/bp/jazzy/pr-2276
Apr 28, 2026
Merged

fix(joint_state_broadcaster): suppress confusing warning for standard interfaces (backport #2276)#2333
christophfroehlich merged 1 commit intojazzyfrom
mergify/bp/jazzy/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 84.88%. Comparing base (9a750b8) to head (0d9c702).
⚠️ Report is 2 commits behind head on jazzy.

Additional details and impacted files
@@            Coverage Diff             @@
##            jazzy    #2333      +/-   ##
==========================================
- Coverage   84.91%   84.88%   -0.04%     
==========================================
  Files         154      154              
  Lines       15271    15378     +107     
  Branches     1351     1351              
==========================================
+ Hits        12968    13053      +85     
- Misses       1811     1834      +23     
+ Partials      492      491       -1     
Flag Coverage Δ
unittests 84.88% <100.00%> (-0.04%) ⬇️

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.70% <ø> (+0.53%) ⬆️
..._broadcaster/test/test_joint_state_broadcaster.cpp 96.98% <100.00%> (-0.37%) ⬇️

... and 19 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 6fc9bc0 into jazzy Apr 28, 2026
15 of 16 checks passed
@christophfroehlich christophfroehlich deleted the mergify/bp/jazzy/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