From ffdc3d84893503974b8cddca67a736318859a10c Mon Sep 17 00:00:00 2001 From: Esteve Fernandez Date: Tue, 29 Oct 2024 11:34:15 +0100 Subject: [PATCH 1/2] refactor(autoware_iv_external_api_adaptor): update component_interface_utils dependency Signed-off-by: Esteve Fernandez --- autoware_iv_external_api_adaptor/package.xml | 2 +- autoware_iv_external_api_adaptor/src/initial_pose.cpp | 6 +++--- autoware_iv_external_api_adaptor/src/initial_pose.hpp | 4 ++-- autoware_iv_external_api_adaptor/src/route.cpp | 6 +++--- autoware_iv_external_api_adaptor/src/route.hpp | 8 ++++---- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/autoware_iv_external_api_adaptor/package.xml b/autoware_iv_external_api_adaptor/package.xml index 0a46882..9d87f46 100644 --- a/autoware_iv_external_api_adaptor/package.xml +++ b/autoware_iv_external_api_adaptor/package.xml @@ -12,11 +12,11 @@ autoware_ad_api_specs autoware_component_interface_specs + autoware_component_interface_utils autoware_control_msgs autoware_external_api_msgs autoware_system_msgs autoware_vehicle_msgs - component_interface_utils nlohmann-json-dev rclcpp rclcpp_components diff --git a/autoware_iv_external_api_adaptor/src/initial_pose.cpp b/autoware_iv_external_api_adaptor/src/initial_pose.cpp index 3e769b3..726ef3c 100644 --- a/autoware_iv_external_api_adaptor/src/initial_pose.cpp +++ b/autoware_iv_external_api_adaptor/src/initial_pose.cpp @@ -52,7 +52,7 @@ InitialPose::InitialPose(const rclcpp::NodeOptions & options) std::bind(&InitialPose::setInitializePoseAuto, this, _1, _2), rmw_qos_profile_services_default, group_); - const auto adaptor = component_interface_utils::NodeAdaptor(this); + const auto adaptor = autoware::component_interface_utils::NodeAdaptor(this); adaptor.init_cli(cli_localization_initialize_); } @@ -70,7 +70,7 @@ void InitialPose::setInitializePose( try { const auto res = cli_localization_initialize_->call(req, initial_pose_timeout); response->status = converter::convert(res->status); - } catch (const component_interface_utils::ServiceException & error) { + } catch (const autoware::component_interface_utils::ServiceException & error) { response->status = tier4_api_utils::response_error(error.what()); } } @@ -87,7 +87,7 @@ void InitialPose::setInitializePoseAuto( try { const auto res = cli_localization_initialize_->call(req, initial_pose_timeout); response->status = converter::convert(res->status); - } catch (const component_interface_utils::ServiceException & error) { + } catch (const autoware::component_interface_utils::ServiceException & error) { response->status = tier4_api_utils::response_error(error.what()); } } diff --git a/autoware_iv_external_api_adaptor/src/initial_pose.hpp b/autoware_iv_external_api_adaptor/src/initial_pose.hpp index c4bd49c..7a5084d 100644 --- a/autoware_iv_external_api_adaptor/src/initial_pose.hpp +++ b/autoware_iv_external_api_adaptor/src/initial_pose.hpp @@ -16,7 +16,7 @@ #define INITIAL_POSE_HPP_ #include -#include +#include #include #include @@ -39,7 +39,7 @@ class InitialPose : public rclcpp::Node rclcpp::CallbackGroup::SharedPtr group_; tier4_api_utils::Service::SharedPtr srv_set_initialize_pose_; tier4_api_utils::Service::SharedPtr srv_set_initialize_pose_auto_; - component_interface_utils::Client:: + autoware::component_interface_utils::Client:: SharedPtr cli_localization_initialize_; // ros callback diff --git a/autoware_iv_external_api_adaptor/src/route.cpp b/autoware_iv_external_api_adaptor/src/route.cpp index 5f06e48..9dac0fc 100644 --- a/autoware_iv_external_api_adaptor/src/route.cpp +++ b/autoware_iv_external_api_adaptor/src/route.cpp @@ -43,7 +43,7 @@ Route::Route(const rclcpp::NodeOptions & options) : Node("external_api_route", o // adapi { - const auto adaptor = component_interface_utils::NodeAdaptor(this); + const auto adaptor = autoware::component_interface_utils::NodeAdaptor(this); adaptor.init_cli(cli_clear_route_); adaptor.init_cli(cli_set_route_); adaptor.init_sub(sub_get_route_, this, &Route::onRoute); @@ -66,7 +66,7 @@ void Route::setRoute( *req = converter::convert(*request); const auto res = cli_set_route_->call(req); response->status = converter::convert(res->status); - } catch (const component_interface_utils::ServiceException & error) { + } catch (const autoware::component_interface_utils::ServiceException & error) { response->status = tier4_api_utils::response_error(error.what()); } } @@ -79,7 +79,7 @@ void Route::clearRoute( const auto req = std::make_shared(); const auto res = cli_clear_route_->call(req); response->status = converter::convert(res->status); - } catch (const component_interface_utils::ServiceException & error) { + } catch (const autoware::component_interface_utils::ServiceException & error) { response->status = tier4_api_utils::response_error(error.what()); } } diff --git a/autoware_iv_external_api_adaptor/src/route.hpp b/autoware_iv_external_api_adaptor/src/route.hpp index fe32e19..945a364 100644 --- a/autoware_iv_external_api_adaptor/src/route.hpp +++ b/autoware_iv_external_api_adaptor/src/route.hpp @@ -15,8 +15,8 @@ #ifndef ROUTE_HPP_ #define ROUTE_HPP_ +#include "autoware/component_interface_utils/rclcpp.hpp" #include "autoware_ad_api_specs/routing.hpp" -#include "component_interface_utils/rclcpp.hpp" #include "rclcpp/rclcpp.hpp" #include "tier4_api_utils/tier4_api_utils.hpp" @@ -44,10 +44,10 @@ class Route : public rclcpp::Node tier4_api_utils::Service::SharedPtr srv_set_route_; tier4_api_utils::Service::SharedPtr srv_clear_route_; rclcpp::Publisher::SharedPtr pub_get_route_; - component_interface_utils::Client::SharedPtr + autoware::component_interface_utils::Client::SharedPtr cli_clear_route_; - component_interface_utils::Client::SharedPtr cli_set_route_; - component_interface_utils::Subscription::SharedPtr + autoware::component_interface_utils::Client::SharedPtr cli_set_route_; + autoware::component_interface_utils::Subscription::SharedPtr sub_get_route_; // ros callback From 01936ccbb17c9c314c5f41f06c7307020aca9824 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 10:36:03 +0000 Subject: [PATCH 2/2] style(pre-commit): autofix --- autoware_iv_external_api_adaptor/src/initial_pose.hpp | 5 +++-- autoware_iv_external_api_adaptor/src/route.hpp | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/autoware_iv_external_api_adaptor/src/initial_pose.hpp b/autoware_iv_external_api_adaptor/src/initial_pose.hpp index 7a5084d..93ea21d 100644 --- a/autoware_iv_external_api_adaptor/src/initial_pose.hpp +++ b/autoware_iv_external_api_adaptor/src/initial_pose.hpp @@ -39,8 +39,9 @@ class InitialPose : public rclcpp::Node rclcpp::CallbackGroup::SharedPtr group_; tier4_api_utils::Service::SharedPtr srv_set_initialize_pose_; tier4_api_utils::Service::SharedPtr srv_set_initialize_pose_auto_; - autoware::component_interface_utils::Client:: - SharedPtr cli_localization_initialize_; + autoware::component_interface_utils::Client< + autoware::component_interface_specs::localization::Initialize>::SharedPtr + cli_localization_initialize_; // ros callback void setInitializePose( diff --git a/autoware_iv_external_api_adaptor/src/route.hpp b/autoware_iv_external_api_adaptor/src/route.hpp index 945a364..dade0f5 100644 --- a/autoware_iv_external_api_adaptor/src/route.hpp +++ b/autoware_iv_external_api_adaptor/src/route.hpp @@ -46,7 +46,8 @@ class Route : public rclcpp::Node rclcpp::Publisher::SharedPtr pub_get_route_; autoware::component_interface_utils::Client::SharedPtr cli_clear_route_; - autoware::component_interface_utils::Client::SharedPtr cli_set_route_; + autoware::component_interface_utils::Client::SharedPtr + cli_set_route_; autoware::component_interface_utils::Subscription::SharedPtr sub_get_route_;