Repository navigation
Conversation
Fixes -Wunused-result warnings reported in ros-controls#2808. - Export of freshly created interfaces: explicitly discard with std::ignore - Lifecycle resets / initial setpoints: RCLCPP_WARN on failure (as in DiffDriveController::reset_buffers()) - update() paths: accumulate result and RCLCPP_WARN_THROTTLE once - Tests: ASSERT_TRUE on set_value() Fixes ros-controls#2808
github-actions
Bot
requested review from
bmagyar,
christophfroehlich,
erickisos,
homalozoa and
moriarty
December 1, 2026 17:54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Handles the ignored results of
[[nodiscard]] bool set_value(...)reported by-Wunused-resultin #2808, in all locations listed there. Each call site follows a pattern already used in this repo:on_export_*_interfaces_list()on a freshly created interfacestd::ignore = ...admittance_controller,chained_filter_controlleron_activate()(omni_wheelreset_buffers(), pidon_activate())if (!...) RCLCPP_WARN(...)DiffDriveController::reset_buffers()update_reference_from_subscribers()/update_and_write_commands()&=(no short-circuit, every interface still gets written), oneRCLCPP_WARN_THROTTLE(1 s)set_command_result &=inDiffDriveController::update_and_write_commands()ASSERT_TRUE(...->set_value(...))test_omni_wheel_drive_controller.cppPackages:
diff_drive_controller,force_torque_sensor_broadcaster,imu_sensor_broadcaster,mecanum_drive_controller,omni_wheel_drive_controller,pid_controller.Fixes #2808
Is this user-facing behavior change?
No functional change. A failed
set_valuethat was previously dropped silently now logs a warning (throttled in update paths).Did you use Generative AI?
Yes, Claude Opus 5.5 (Claude Code) wrote the patch and helped with this description . I reviewed the changes and ran the build and tests below myself.
Additional Information
Verified in a
ros:rollingcontainer againstmaster(b8619af), withclang++and-DCMAKE_CXX_FLAGS=-Werror=unused-result:pid_controller.cpp: 10 errors: ignoring return value of function declared with 'nodiscard' attributecolcon test: 192 tests, 0 errors, 0 failures, 0 skippedpre-commit(clang-format, codespell, whitespace hooks) passes; cpplint shows no new findings. GCC is left to CI.Note: #2810 touches the same
update_reference_from_subscribers()code indiff_drive_controllerandomni_wheel_drive_controller; whichever lands second needs a small rebase.