Add GoalStatusCode enum and get_status_code() to client goal handles - #1
Closed
dv-picknik wants to merge 1 commit into
Closed
dv-picknik wants to merge 1 commit into
dv-picknik wants to merge 1 commit into
Conversation
dv-picknik
marked this pull request as ready for review
September 28, 2026 21:07
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: David Vadovszki <david.vadovszki@picknik.ai>
dv-picknik
force-pushed
the
feature/2482-goal-status-enum
branch
from
September 28, 2026 21:07
07d47ce to
344ed0c
Compare
Member
Author
|
Superseded by ros2#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()returnsUNKNOWN, so callers never see an unnamed enum value.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().Would you rather deprecate
get_status()on rolling and have it return the enum instead of adding a second getter? I kept this additive so it can be backported to humble, which the issue asks for. Deprecating would make it rolling-only. I can do either.Fixes ros2#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. It fails without the range check, whereget_status_code()returns 0x2A.This branch is on an organization fork, which GitHub does not let maintainers push to. If you want changes, tell me and I will make them.