You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#3292 adds get_status_code() to ClientGoalHandle and GenericClientGoalHandle. It returns a GoalStatusCode enum and throws InvalidGoalStatusError if the server sent a status outside the action_msgs/GoalStatus values. This issue proposes deprecating get_status(), which returns the raw int8_t, so callers move to the typed getter.
Two getters return the same value in different forms. get_status() passes through whatever the server sent. Callers compare it against GoalStatus::STATUS_* constants and have to handle out-of-range values themselves. With one getter, every caller gets the type and the range check.
It follows the pattern from deprecate rclcpp::spin_some and rclcpp::spin_all #2848: [[deprecated("use get_status_code() instead")]] before RCLCPP_ACTION_PUBLIC, and RCPPUTILS_DEPRECATION_WARNING_OFF_START/STOP around tests that still call get_status().
I have a branch ready. It moves 39 test assertions and 5 benchmark checks in rclcpp_action to get_status_code(), and rclcpp_action builds without warnings.
Downstream projects need their own PRs to switch to get_status_code():
Nav2 has 5 call sites, including nav2_behavior_tree/bt_action_node.hpp.
MoveIt 2 has 1, in the motion planning RViz plugin.
I found these with GitHub code search on default branches, so the list may be incomplete. Those PRs can merge once get_status_code() is in a rolling release. A branch that also builds for released distros will need a version check, because those distros don't have get_status_code(). I plan to open the PRs for Nav2 and MoveIt 2. Ideally they merge before the deprecation, so neither project sees the warning.
Additional Information
get_status_code() throws where get_status() did not. A caller that reads the status on every tick, like bt_action_node, will need to decide how to handle InvalidGoalStatusError. Checking the status where it arrives, in handle_status_message() and the result callback, would remove that case. That belongs in a separate change.
Description
#3292 adds
get_status_code()toClientGoalHandleandGenericClientGoalHandle. It returns aGoalStatusCodeenum and throwsInvalidGoalStatusErrorif the server sent a status outside theaction_msgs/GoalStatusvalues. This issue proposes deprecatingget_status(), which returns the rawint8_t, so callers move to the typed getter.Depends on #3292.
Motivation
Two getters return the same value in different forms.
get_status()passes through whatever the server sent. Callers compare it againstGoalStatus::STATUS_*constants and have to handle out-of-range values themselves. With one getter, every caller gets the type and the range check.Design / Implementation Considerations
Rolling only. A deprecation in a released distro would add warnings there, so this one should not be backported. Add GoalStatusCode enum and get_status_code() to client goal handles #3292 can be.
It follows the pattern from deprecate rclcpp::spin_some and rclcpp::spin_all #2848:
[[deprecated("use get_status_code() instead")]]beforeRCLCPP_ACTION_PUBLIC, andRCPPUTILS_DEPRECATION_WARNING_OFF_START/STOParound tests that still callget_status().I have a branch ready. It moves 39 test assertions and 5 benchmark checks in
rclcpp_actiontoget_status_code(), andrclcpp_actionbuilds without warnings.Downstream projects need their own PRs to switch to
get_status_code():nav2_behavior_tree/bt_action_node.hpp.I found these with GitHub code search on default branches, so the list may be incomplete. Those PRs can merge once
get_status_code()is in a rolling release. A branch that also builds for released distros will need a version check, because those distros don't haveget_status_code(). I plan to open the PRs for Nav2 and MoveIt 2. Ideally they merge before the deprecation, so neither project sees the warning.Additional Information
get_status_code()throws whereget_status()did not. A caller that reads the status on every tick, likebt_action_node, will need to decide how to handleInvalidGoalStatusError. Checking the status where it arrives, inhandle_status_message()and the result callback, would remove that case. That belongs in a separate change.Done when
get_status_code().get_status_code().get_status()is deprecated on rolling.Claude Code with Claude Opus 5.5 drafted this issue. I reviewed it.