Skip to content

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

Open
greencookie-afk wants to merge 1 commit intoros-controls:masterfrom
greencookie-afk:fix/confusing-warning-joint-state-broadcaster
Open

fix(joint_state_broadcaster): suppress confusing warning for standard interfaces#2276
greencookie-afk wants to merge 1 commit intoros-controls:masterfrom
greencookie-afk:fix/confusing-warning-joint-state-broadcaster

Conversation

@greencookie-afk
Copy link
Copy Markdown

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

… interfaces

When using standard interfaces like 'velocity' with the default mapping,
the warning 'Mapping from velocity to interface velocity will not be done'
is confusing because no mapping is actually needed.

This change only shows the warning when there's a custom mapping being
ignored (i.e., when interface name differs from the JointState field name).

Fixes ros-controls#2261
@greencookie-afk
Copy link
Copy Markdown
Author

@christophfroehlich, I opened a PR for this issue. Would you be able to review when you have a chance? I am a beginner so any feedback will be appreciated.

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.

confusing joint_state_broadcaster warning

1 participant