Skip to content

Commit ebc3290

Browse files
Try to get the latest value from the state interfaces only once
1 parent a7528e0 commit ebc3290

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

joint_state_broadcaster/src/joint_state_broadcaster.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -405,9 +405,8 @@ controller_interface::return_type JointStateBroadcaster::update(
405405
{
406406
for (auto i = 0u; i < state_interfaces_.size(); ++i)
407407
{
408-
/// @note should we limit the number of retries here? does it even
409-
/// make sense to try to get the latest value on every iteration?
410-
const auto & opt = state_interfaces_[i].get_optional();
408+
// no retries, just try to get the latest value once
409+
const auto & opt = state_interfaces_[i].get_optional(0);
411410
if (opt.has_value())
412411
{
413412
*mapped_values_[i] = opt.value();

0 commit comments

Comments
 (0)