Add GoalStatusCode enum and get_status_code() to client goal handles #3292
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 236 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.327
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3292"
general
weight: 0.35
jmachowinski
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 https://github.com/ros2/rclcpp/issues/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.