We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5108030 commit c2f42d5Copy full SHA for c2f42d5
joint_state_broadcaster/src/joint_state_broadcaster.cpp
@@ -420,8 +420,13 @@ controller_interface::return_type JointStateBroadcaster::update(
420
const auto & opt = state_interfaces_[i].get_optional(0);
421
if (opt.has_value())
422
{
423
- *mapped_values_[map_index++] = opt.value();
+ *mapped_values_[map_index] = opt.value();
424
}
425
+ // Always advance map_index for every DOUBLE interface, regardless of whether the read
426
+ // succeeded. If we only advance on success, a temporary read failure (e.g. lock contention
427
+ // on a chained interface) causes all subsequent interfaces to be written into the wrong
428
+ // mapped_values_ slots, corrupting the published joint states.
429
+ ++map_index;
430
431
432
0 commit comments