Skip to content

Commit 5cadcf5

Browse files
fix(joint_state_broadcaster): suppress confusing warning for standard 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 #2261
1 parent 629afee commit 5cadcf5

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

joint_state_broadcaster/src/joint_state_broadcaster.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,16 @@ controller_interface::CallbackReturn JointStateBroadcaster::on_configure(
124124
params_.interfaces.end())
125125
{
126126
map_interface_to_joint_state_[interface] = interface;
127-
RCLCPP_WARN(
128-
get_node()->get_logger(),
129-
"Mapping from '%s' to interface '%s' will not be done, because '%s' is defined "
130-
"in 'interface' parameter.",
131-
interface_to_map.c_str(), interface.c_str(), interface.c_str());
127+
// Only warn if there's a custom mapping being ignored (interface != interface_to_map)
128+
// When they're equal (e.g., both "velocity"), it's the standard case and no warning is needed
129+
if (interface != interface_to_map)
130+
{
131+
RCLCPP_WARN(
132+
get_node()->get_logger(),
133+
"Mapping from '%s' to interface '%s' will not be done, because '%s' is defined "
134+
"in 'interface' parameter.",
135+
interface_to_map.c_str(), interface.c_str(), interface.c_str());
136+
}
132137
}
133138
else
134139
{

0 commit comments

Comments
 (0)