Returns CancelResponse::REJECT while goal handle failed to transit to CANCELING state (#1641) (#1659)
Signed-off-by: Kaven Yau <kavenyau@foxmail.com>
This commit is contained in:
parent
d12ed36e89
commit
122355704b
1 changed files with 8 additions and 1 deletions
|
@ -365,7 +365,14 @@ protected:
|
||||||
if (goal_handle) {
|
if (goal_handle) {
|
||||||
resp = handle_cancel_(goal_handle);
|
resp = handle_cancel_(goal_handle);
|
||||||
if (CancelResponse::ACCEPT == resp) {
|
if (CancelResponse::ACCEPT == resp) {
|
||||||
goal_handle->_cancel_goal();
|
try {
|
||||||
|
goal_handle->_cancel_goal();
|
||||||
|
} catch (const rclcpp::exceptions::RCLError & ex) {
|
||||||
|
RCLCPP_DEBUG(
|
||||||
|
rclcpp::get_logger("rclcpp_action"),
|
||||||
|
"Failed to cancel goal in call_handle_cancel_callback: %s", ex.what());
|
||||||
|
return CancelResponse::REJECT;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return resp;
|
return resp;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue