feat: warn when ForwardCommandController receives commands while inactive - #2488
Open
Rudyy75 wants to merge 2 commits into
Open
feat: warn when ForwardCommandController receives commands while inactive#2488Rudyy75 wants to merge 2 commits into
Rudyy75 wants to merge 2 commits into
Conversation
| "~/commands", rclcpp::SystemDefaultsQoS(), | ||
| [this](const CmdType::SharedPtr msg) | ||
| { | ||
| if (get_node()->get_current_state().id() != lifecycle_msgs::msg::State::PRIMARY_STATE_ACTIVE) |
Member
There was a problem hiding this comment.
IMHO this is not a problem as this subscriber does not run in the RT loop, but maybe this is faster:
Suggested change
| if (get_node()->get_current_state().id() != lifecycle_msgs::msg::State::PRIMARY_STATE_ACTIVE) | |
| if (get_lifecycle_id() != lifecycle_msgs::msg::State::PRIMARY_STATE_ACTIVE) |
For reference ros-controls/ros2_control#2884
@saikishor what is best practice here?
christophfroehlich
marked this pull request as ready for review
July 29, 2026 07:59
github-actions
Bot
requested review from
Juliaj,
MarqRazz,
fmauch,
mhubii and
saikishor
July 29, 2026 08:00
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2488 +/- ##
==========================================
- Coverage 86.85% 86.84% -0.02%
==========================================
Files 148 148
Lines 16267 16269 +2
Branches 1367 1368 +1
==========================================
Hits 14128 14128
- Misses 1632 1633 +1
- Partials 507 508 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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
This PR fixes #1760 where
ForwardCommandControllersilently ignores commands when it is in an inactive lifecycle state.Changes made:
get_node()->get_current_state()) to the subscription callback inForwardControllersBase.RCLCPP_WARN_THROTTLE) and drops the message if the controller is not inPRIMARY_STATE_ACTIVE.ForwardCommandControllerandMultiInterfaceForwardCommandController.Fixes #1760
Is this user-facing behavior change?
Yes, controllers will now log a warning when commands are received while inactive, instead of silently ignoring them.
Did you use Generative AI?
Yes, Claude Sonnet 4.6
Additional Information
TODOs
To send us a pull request, please:
colcon testandpre-commit run(requires you to install pre-commit bypip3 install pre-commit)