Add GoalStatusCode enum and get_status_code() to client goal handles - #3292
Merged
jmachowinski merged 2 commits intoOct 3, 2026
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: David Vadovszki <david.vadovszki@picknik.ai>
jmachowinski
requested changes
Sep 30, 2026
…status Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: David Vadovszki <david.vadovszki@picknik.ai>
This was referenced Oct 2, 2026
jmachowinski
approved these changes
Oct 2, 2026
Collaborator
|
Pulls: #3292 |
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 implements #2482.
ClientGoalHandle::get_status()andGenericClientGoalHandle::get_status()returnint8_t. Callers have to know those values areaction_msgs::msg::GoalStatus::STATUS_*constants.ResultCodedoes not fit, because it covers only the three terminal states.This adds
rclcpp_action::GoalStatusCode, anint8_tenum class intypes.hppwith all sevenGoalStatusvalues. Both goal handles get aget_status_code()that returns it.The status comes straight from the server's status topic, and the client does not check it. If a server sends a value outside the seven,
get_status_code()throwsexceptions::InvalidGoalStatusError.get_status()still returns the raw byte.The change only adds API, and the new
GenericClientGoalHandlemember is non-virtual, so existing binaries keep working.The names are open to change. I also considered
GoalState, which matches rcl_action'sGOAL_STATE_*, andget_goal_status().Deprecating
get_status()in favor ofget_status_code()will follow in its own PR.Fixes #2482
Is this user-facing behavior change?
No behavior change. New API only.
Did you use Generative AI?
Yes. Claude Code with Claude Opus 5.5 wrote the code, the tests and this description. I reviewed the change, then built and tested it.
Additional Information
I tested on rolling with rclcpp and rcl built from source. All
rclcpp_actiontests and linters pass. The package skips cppcheck on rolling. New assertions intest_client.cppandtest_generic_client.cppcheck ACCEPTED, SUCCEEDED, UNKNOWN after invalidation, and CANCELED after cancel-all. A newget_status_code_out_of_rangetest in each file publishes status 42 for a live goal and checks thatget_status()returns 42 andget_status_code()throws.