From 4934ce072e02d9c581894df5c2a812101fbff4a7 Mon Sep 17 00:00:00 2001 From: "Takagi, Isamu" Date: Wed, 19 Jun 2024 18:38:25 +0900 Subject: [PATCH] feat(default_ad_api): add log when operation mode change fails Signed-off-by: Takagi, Isamu --- system/default_ad_api/src/operation_mode.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/system/default_ad_api/src/operation_mode.cpp b/system/default_ad_api/src/operation_mode.cpp index d4b430ecd0579..510788dd09d08 100644 --- a/system/default_ad_api/src/operation_mode.cpp +++ b/system/default_ad_api/src/operation_mode.cpp @@ -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(); req->mode = mode;