Skip to content

Commit

Permalink
feat(default_ad_api): add log when operation mode change fails
Browse files Browse the repository at this point in the history
Signed-off-by: Takagi, Isamu <[email protected]>
  • Loading branch information
isamu-takagi authored and TakaHoribe committed Jun 20, 2024
1 parent 46adcc6 commit 2217b65
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion system/default_ad_api/src/operation_mode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,13 @@ void OperationModeNode::change_mode(
const ResponseT res, const OperationModeRequest::_mode_type mode)
{
if (!mode_available_[mode]) {
RCLCPP_WARN(
get_logger(),
"The target mode is not available. Please check the cause with "
"rqt_diagnostics_graph_monitor");
throw component_interface_utils::ServiceException(
ServiceResponse::ERROR_NOT_AVAILABLE, "The mode change is blocked by the system.");
ServiceResponse::ERROR_NOT_AVAILABLE,
"The target mode is not available. Please check the diagnostics.");
}
const auto req = std::make_shared<OperationModeRequest>();
req->mode = mode;
Expand Down

0 comments on commit 2217b65

Please sign in to comment.