From 03f675e991e23347a24f79e1166e8b792c8f753f Mon Sep 17 00:00:00 2001 From: Masaki Baba Date: Tue, 3 Sep 2024 14:31:56 +0900 Subject: [PATCH] refactor(pose_initializer)!: prefix package and namespace with autoware (#8701) * add autoware_ prefix Signed-off-by: a-maumau * fix link Signed-off-by: a-maumau --------- Signed-off-by: a-maumau Co-authored-by: SakodaShintaro --- .github/CODEOWNERS | 2 +- .../pose_twist_estimator.launch.xml | 2 +- launch/tier4_localization_launch/package.xml | 2 +- .../launch/simulator.launch.xml | 4 ++-- .../CMakeLists.txt | 16 ++++++++-------- .../README.md | 10 +++++----- .../config/pose_initializer.param.yaml | 0 .../launch/pose_initializer.launch.xml | 4 ++-- .../media/diagnostic_pose_reliability.png | Bin .../package.xml | 4 ++-- .../schema/pose_initializer.schema.json | 0 .../src}/copy_vector_to_array.hpp | 9 ++++++--- .../src}/ekf_localization_trigger_module.cpp | 3 +++ .../src}/ekf_localization_trigger_module.hpp | 9 ++++++--- .../src}/gnss_module.cpp | 3 +++ .../src}/gnss_module.hpp | 9 ++++++--- .../src}/localization_module.cpp | 3 +++ .../src}/localization_module.hpp | 9 ++++++--- .../src}/ndt_localization_trigger_module.cpp | 3 +++ .../src}/ndt_localization_trigger_module.hpp | 9 ++++++--- .../src}/pose_initializer_core.cpp | 5 ++++- .../src}/pose_initializer_core.hpp | 9 ++++++--- .../src}/stop_check_module.cpp | 3 +++ .../src}/stop_check_module.hpp | 9 ++++++--- .../test/test_copy_vector_to_array.cpp | 8 ++++---- 25 files changed, 87 insertions(+), 48 deletions(-) rename localization/{pose_initializer => autoware_pose_initializer}/CMakeLists.txt (72%) rename localization/{pose_initializer => autoware_pose_initializer}/README.md (89%) rename localization/{pose_initializer => autoware_pose_initializer}/config/pose_initializer.param.yaml (100%) rename localization/{pose_initializer => autoware_pose_initializer}/launch/pose_initializer.launch.xml (86%) rename localization/{pose_initializer => autoware_pose_initializer}/media/diagnostic_pose_reliability.png (100%) rename localization/{pose_initializer => autoware_pose_initializer}/package.xml (94%) rename localization/{pose_initializer => autoware_pose_initializer}/schema/pose_initializer.schema.json (100%) rename localization/{pose_initializer/src/pose_initializer => autoware_pose_initializer/src}/copy_vector_to_array.hpp (89%) rename localization/{pose_initializer/src/pose_initializer => autoware_pose_initializer/src}/ekf_localization_trigger_module.cpp (96%) rename localization/{pose_initializer/src/pose_initializer => autoware_pose_initializer/src}/ekf_localization_trigger_module.hpp (82%) rename localization/{pose_initializer/src/pose_initializer => autoware_pose_initializer/src}/gnss_module.cpp (95%) rename localization/{pose_initializer/src/pose_initializer => autoware_pose_initializer/src}/gnss_module.hpp (88%) rename localization/{pose_initializer/src/pose_initializer => autoware_pose_initializer/src}/localization_module.cpp (95%) rename localization/{pose_initializer/src/pose_initializer => autoware_pose_initializer/src}/localization_module.hpp (87%) rename localization/{pose_initializer/src/pose_initializer => autoware_pose_initializer/src}/ndt_localization_trigger_module.cpp (96%) rename localization/{pose_initializer/src/pose_initializer => autoware_pose_initializer/src}/ndt_localization_trigger_module.hpp (82%) rename localization/{pose_initializer/src/pose_initializer => autoware_pose_initializer/src}/pose_initializer_core.cpp (98%) rename localization/{pose_initializer/src/pose_initializer => autoware_pose_initializer/src}/pose_initializer_core.hpp (93%) rename localization/{pose_initializer/src/pose_initializer => autoware_pose_initializer/src}/stop_check_module.cpp (93%) rename localization/{pose_initializer/src/pose_initializer => autoware_pose_initializer/src}/stop_check_module.hpp (87%) rename localization/{pose_initializer => autoware_pose_initializer}/test/test_copy_vector_to_array.cpp (83%) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 85f0c68a35f29..33e2fc1ab8f5f 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -94,7 +94,7 @@ localization/autoware_twist2accel/** anh.nguyen.2@tier4.jp kento.yabuuchi.2@tier localization/ekf_localizer/** anh.nguyen.2@tier4.jp kento.yabuuchi.2@tier4.jp masahiro.sakamoto@tier4.jp ryu.yamamoto@tier4.jp shintaro.sakoda@tier4.jp taiki.yamada@tier4.jp takamasa.horibe@tier4.jp takeshi.ishita@tier4.jp yamato.ando@tier4.jp localization/localization_util/** anh.nguyen.2@tier4.jp kento.yabuuchi.2@tier4.jp masahiro.sakamoto@tier4.jp ryu.yamamoto@tier4.jp shintaro.sakoda@tier4.jp taiki.yamada@tier4.jp yamato.ando@tier4.jp localization/ndt_scan_matcher/** anh.nguyen.2@tier4.jp kento.yabuuchi.2@tier4.jp masahiro.sakamoto@tier4.jp ryu.yamamoto@tier4.jp shintaro.sakoda@tier4.jp taiki.yamada@tier4.jp yamato.ando@tier4.jp -localization/pose_initializer/** anh.nguyen.2@tier4.jp isamu.takagi@tier4.jp kento.yabuuchi.2@tier4.jp masahiro.sakamoto@tier4.jp ryu.yamamoto@tier4.jp shintaro.sakoda@tier4.jp taiki.yamada@tier4.jp yamato.ando@tier4.jp +localization/autoware_pose_initializer/** anh.nguyen.2@tier4.jp isamu.takagi@tier4.jp kento.yabuuchi.2@tier4.jp masahiro.sakamoto@tier4.jp ryu.yamamoto@tier4.jp shintaro.sakoda@tier4.jp taiki.yamada@tier4.jp yamato.ando@tier4.jp localization/yabloc/yabloc_common/** anh.nguyen.2@tier4.jp kento.yabuuchi.2@tier4.jp masahiro.sakamoto@tier4.jp ryu.yamamoto@tier4.jp shintaro.sakoda@tier4.jp taiki.yamada@tier4.jp yamato.ando@tier4.jp localization/yabloc/yabloc_image_processing/** anh.nguyen.2@tier4.jp kento.yabuuchi.2@tier4.jp masahiro.sakamoto@tier4.jp ryu.yamamoto@tier4.jp shintaro.sakoda@tier4.jp taiki.yamada@tier4.jp yamato.ando@tier4.jp localization/yabloc/yabloc_monitor/** anh.nguyen.2@tier4.jp kento.yabuuchi.2@tier4.jp masahiro.sakamoto@tier4.jp ryu.yamamoto@tier4.jp shintaro.sakoda@tier4.jp taiki.yamada@tier4.jp yamato.ando@tier4.jp diff --git a/launch/tier4_localization_launch/launch/pose_twist_estimator/pose_twist_estimator.launch.xml b/launch/tier4_localization_launch/launch/pose_twist_estimator/pose_twist_estimator.launch.xml index 00f2406aa82d6..02d4f169cbc0d 100644 --- a/launch/tier4_localization_launch/launch/pose_twist_estimator/pose_twist_estimator.launch.xml +++ b/launch/tier4_localization_launch/launch/pose_twist_estimator/pose_twist_estimator.launch.xml @@ -120,7 +120,7 @@ - + diff --git a/launch/tier4_localization_launch/package.xml b/launch/tier4_localization_launch/package.xml index 70e09bb9072d8..be22d21707cec 100644 --- a/launch/tier4_localization_launch/package.xml +++ b/launch/tier4_localization_launch/package.xml @@ -24,13 +24,13 @@ autoware_lidar_marker_localizer autoware_pointcloud_preprocessor autoware_pose_estimator_arbiter + autoware_pose_initializer autoware_pose_instability_detector eagleye_geo_pose_fusion eagleye_gnss_converter eagleye_rt ekf_localizer ndt_scan_matcher - pose_initializer topic_tools yabloc_common yabloc_image_processing diff --git a/launch/tier4_simulator_launch/launch/simulator.launch.xml b/launch/tier4_simulator_launch/launch/simulator.launch.xml index 5dec24c66f6ca..330abaee3c839 100644 --- a/launch/tier4_simulator_launch/launch/simulator.launch.xml +++ b/launch/tier4_simulator_launch/launch/simulator.launch.xml @@ -141,7 +141,7 @@ - + @@ -159,7 +159,7 @@ - + diff --git a/localization/pose_initializer/CMakeLists.txt b/localization/autoware_pose_initializer/CMakeLists.txt similarity index 72% rename from localization/pose_initializer/CMakeLists.txt rename to localization/autoware_pose_initializer/CMakeLists.txt index 324488bedebfc..d07858d0b704e 100644 --- a/localization/pose_initializer/CMakeLists.txt +++ b/localization/autoware_pose_initializer/CMakeLists.txt @@ -1,20 +1,20 @@ cmake_minimum_required(VERSION 3.14) -project(pose_initializer) +project(autoware_pose_initializer) find_package(autoware_cmake REQUIRED) autoware_package() ament_auto_add_library(${PROJECT_NAME} SHARED - src/pose_initializer/pose_initializer_core.cpp - src/pose_initializer/gnss_module.cpp - src/pose_initializer/localization_module.cpp - src/pose_initializer/stop_check_module.cpp - src/pose_initializer/ekf_localization_trigger_module.cpp - src/pose_initializer/ndt_localization_trigger_module.cpp + src/pose_initializer_core.cpp + src/gnss_module.cpp + src/localization_module.cpp + src/stop_check_module.cpp + src/ekf_localization_trigger_module.cpp + src/ndt_localization_trigger_module.cpp ) rclcpp_components_register_node(${PROJECT_NAME} - PLUGIN "PoseInitializer" + PLUGIN "autoware::pose_initializer::PoseInitializer" EXECUTABLE ${PROJECT_NAME}_node EXECUTOR MultiThreadedExecutor ) diff --git a/localization/pose_initializer/README.md b/localization/autoware_pose_initializer/README.md similarity index 89% rename from localization/pose_initializer/README.md rename to localization/autoware_pose_initializer/README.md index 2928f51f7256d..e4b9bdd28b2c5 100644 --- a/localization/pose_initializer/README.md +++ b/localization/autoware_pose_initializer/README.md @@ -1,8 +1,8 @@ -# pose_initializer +# autoware_pose_initializer ## Purpose -The `pose_initializer` is the package to send an initial pose to `ekf_localizer`. +The `autoware_pose_initializer` is the package to send an initial pose to `ekf_localizer`. It receives roughly estimated initial pose from GNSS/user. Passing the pose to `ndt_scan_matcher`, and it gets a calculated ego pose from `ndt_scan_matcher` via service. Finally, it publishes the initial pose to `ekf_localizer`. @@ -13,7 +13,7 @@ This node depends on the map height fitter library. ### Parameters -{{ json_to_markdown("localization/pose_initializer/schema/pose_initializer.schema.json") }} +{{ json_to_markdown("localization/autoware_pose_initializer/schema/pose_initializer.schema.json") }} ### Services @@ -51,7 +51,7 @@ If the score of initial pose estimation result is lower than score threshold, ER ## Connection with Default AD API -This `pose_initializer` is used via default AD API. For detailed description of the API description, please refer to [the description of `autoware_default_adapi`](https://github.com/autowarefoundation/autoware.universe/blob/main/system/autoware_default_adapi/document/localization.md). +This `autoware_pose_initializer` is used via default AD API. For detailed description of the API description, please refer to [the description of `autoware_default_adapi`](https://github.com/autowarefoundation/autoware.universe/blob/main/system/autoware_default_adapi/document/localization.md). drawing @@ -136,4 +136,4 @@ pose: ``` It behaves the same as "initialpose (from rviz)". -The position.z and the covariance will be overwritten by [ad_api_adaptors](https://github.com/autowarefoundation/autoware.universe/tree/main/system/autoware_default_adapi_helpers/ad_api_adaptors), so there is no need to input them. +The position.z and the covariance will be overwritten by [ad_api_adaptors](https://github.com/autowarefoundation/autoware.universe/tree/main/system/default_ad_api_helpers/ad_api_adaptors), so there is no need to input them. diff --git a/localization/pose_initializer/config/pose_initializer.param.yaml b/localization/autoware_pose_initializer/config/pose_initializer.param.yaml similarity index 100% rename from localization/pose_initializer/config/pose_initializer.param.yaml rename to localization/autoware_pose_initializer/config/pose_initializer.param.yaml diff --git a/localization/pose_initializer/launch/pose_initializer.launch.xml b/localization/autoware_pose_initializer/launch/pose_initializer.launch.xml similarity index 86% rename from localization/pose_initializer/launch/pose_initializer.launch.xml rename to localization/autoware_pose_initializer/launch/pose_initializer.launch.xml index 2ffdebf39c474..e2fb71bdaab06 100644 --- a/localization/pose_initializer/launch/pose_initializer.launch.xml +++ b/localization/autoware_pose_initializer/launch/pose_initializer.launch.xml @@ -1,5 +1,5 @@ - + @@ -9,7 +9,7 @@ - + diff --git a/localization/pose_initializer/media/diagnostic_pose_reliability.png b/localization/autoware_pose_initializer/media/diagnostic_pose_reliability.png similarity index 100% rename from localization/pose_initializer/media/diagnostic_pose_reliability.png rename to localization/autoware_pose_initializer/media/diagnostic_pose_reliability.png diff --git a/localization/pose_initializer/package.xml b/localization/autoware_pose_initializer/package.xml similarity index 94% rename from localization/pose_initializer/package.xml rename to localization/autoware_pose_initializer/package.xml index e1f1233b8b4f5..67079c476ac8a 100644 --- a/localization/pose_initializer/package.xml +++ b/localization/autoware_pose_initializer/package.xml @@ -1,9 +1,9 @@ - pose_initializer + autoware_pose_initializer 0.1.0 - The pose_initializer package + The autoware_pose_initializer package Yamato Ando Takagi, Isamu Masahiro Sakamoto diff --git a/localization/pose_initializer/schema/pose_initializer.schema.json b/localization/autoware_pose_initializer/schema/pose_initializer.schema.json similarity index 100% rename from localization/pose_initializer/schema/pose_initializer.schema.json rename to localization/autoware_pose_initializer/schema/pose_initializer.schema.json diff --git a/localization/pose_initializer/src/pose_initializer/copy_vector_to_array.hpp b/localization/autoware_pose_initializer/src/copy_vector_to_array.hpp similarity index 89% rename from localization/pose_initializer/src/pose_initializer/copy_vector_to_array.hpp rename to localization/autoware_pose_initializer/src/copy_vector_to_array.hpp index 33d95c58a726b..5e9531d72b5aa 100644 --- a/localization/pose_initializer/src/pose_initializer/copy_vector_to_array.hpp +++ b/localization/autoware_pose_initializer/src/copy_vector_to_array.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef POSE_INITIALIZER__COPY_VECTOR_TO_ARRAY_HPP_ -#define POSE_INITIALIZER__COPY_VECTOR_TO_ARRAY_HPP_ +#ifndef COPY_VECTOR_TO_ARRAY_HPP_ +#define COPY_VECTOR_TO_ARRAY_HPP_ #include @@ -22,6 +22,8 @@ #include #include +namespace autoware::pose_initializer +{ template void copy_vector_to_array(const std::vector & vector, std::array & array) { @@ -44,5 +46,6 @@ std::array get_covariance_parameter(NodeT * node, const std::string copy_vector_to_array(parameter, covariance); return covariance; } +} // namespace autoware::pose_initializer -#endif // POSE_INITIALIZER__COPY_VECTOR_TO_ARRAY_HPP_ +#endif // COPY_VECTOR_TO_ARRAY_HPP_ diff --git a/localization/pose_initializer/src/pose_initializer/ekf_localization_trigger_module.cpp b/localization/autoware_pose_initializer/src/ekf_localization_trigger_module.cpp similarity index 96% rename from localization/pose_initializer/src/pose_initializer/ekf_localization_trigger_module.cpp rename to localization/autoware_pose_initializer/src/ekf_localization_trigger_module.cpp index 9ba424f8e857f..630635da870b0 100644 --- a/localization/pose_initializer/src/pose_initializer/ekf_localization_trigger_module.cpp +++ b/localization/autoware_pose_initializer/src/ekf_localization_trigger_module.cpp @@ -20,6 +20,8 @@ #include #include +namespace autoware::pose_initializer +{ using ServiceException = component_interface_utils::ServiceException; using Initialize = localization_interface::Initialize; @@ -65,3 +67,4 @@ void EkfLocalizationTriggerModule::send_request(bool flag, bool need_spin) const Initialize::Service::Response::ERROR_ESTIMATION, "EKF " + command_name + " failed"); } } +} // namespace autoware::pose_initializer diff --git a/localization/pose_initializer/src/pose_initializer/ekf_localization_trigger_module.hpp b/localization/autoware_pose_initializer/src/ekf_localization_trigger_module.hpp similarity index 82% rename from localization/pose_initializer/src/pose_initializer/ekf_localization_trigger_module.hpp rename to localization/autoware_pose_initializer/src/ekf_localization_trigger_module.hpp index 901e4ec4414b5..eab455764c040 100644 --- a/localization/pose_initializer/src/pose_initializer/ekf_localization_trigger_module.hpp +++ b/localization/autoware_pose_initializer/src/ekf_localization_trigger_module.hpp @@ -12,13 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef POSE_INITIALIZER__EKF_LOCALIZATION_TRIGGER_MODULE_HPP_ -#define POSE_INITIALIZER__EKF_LOCALIZATION_TRIGGER_MODULE_HPP_ +#ifndef EKF_LOCALIZATION_TRIGGER_MODULE_HPP_ +#define EKF_LOCALIZATION_TRIGGER_MODULE_HPP_ #include #include +namespace autoware::pose_initializer +{ class EkfLocalizationTriggerModule { private: @@ -33,5 +35,6 @@ class EkfLocalizationTriggerModule rclcpp::Node * node_; rclcpp::Client::SharedPtr client_ekf_trigger_; }; +} // namespace autoware::pose_initializer -#endif // POSE_INITIALIZER__EKF_LOCALIZATION_TRIGGER_MODULE_HPP_ +#endif // EKF_LOCALIZATION_TRIGGER_MODULE_HPP_ diff --git a/localization/pose_initializer/src/pose_initializer/gnss_module.cpp b/localization/autoware_pose_initializer/src/gnss_module.cpp similarity index 95% rename from localization/pose_initializer/src/pose_initializer/gnss_module.cpp rename to localization/autoware_pose_initializer/src/gnss_module.cpp index b746828e33b1c..c5fd1490b271e 100644 --- a/localization/pose_initializer/src/pose_initializer/gnss_module.cpp +++ b/localization/autoware_pose_initializer/src/gnss_module.cpp @@ -19,6 +19,8 @@ #include +namespace autoware::pose_initializer +{ GnssModule::GnssModule(rclcpp::Node * node) : fitter_(node), clock_(node->get_clock()), @@ -55,3 +57,4 @@ geometry_msgs::msg::PoseWithCovarianceStamped GnssModule::get_pose() } return pose; } +} // namespace autoware::pose_initializer diff --git a/localization/pose_initializer/src/pose_initializer/gnss_module.hpp b/localization/autoware_pose_initializer/src/gnss_module.hpp similarity index 88% rename from localization/pose_initializer/src/pose_initializer/gnss_module.hpp rename to localization/autoware_pose_initializer/src/gnss_module.hpp index bb3f6933c2aaa..59659162c81b0 100644 --- a/localization/pose_initializer/src/pose_initializer/gnss_module.hpp +++ b/localization/autoware_pose_initializer/src/gnss_module.hpp @@ -12,14 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef POSE_INITIALIZER__GNSS_MODULE_HPP_ -#define POSE_INITIALIZER__GNSS_MODULE_HPP_ +#ifndef GNSS_MODULE_HPP_ +#define GNSS_MODULE_HPP_ #include #include #include +namespace autoware::pose_initializer +{ class GnssModule { private: @@ -38,5 +40,6 @@ class GnssModule PoseWithCovarianceStamped::ConstSharedPtr pose_; double timeout_; }; +} // namespace autoware::pose_initializer -#endif // POSE_INITIALIZER__GNSS_MODULE_HPP_ +#endif // GNSS_MODULE_HPP_ diff --git a/localization/pose_initializer/src/pose_initializer/localization_module.cpp b/localization/autoware_pose_initializer/src/localization_module.cpp similarity index 95% rename from localization/pose_initializer/src/pose_initializer/localization_module.cpp rename to localization/autoware_pose_initializer/src/localization_module.cpp index 6963e5adbba3e..0b2a63a55447b 100644 --- a/localization/pose_initializer/src/pose_initializer/localization_module.cpp +++ b/localization/autoware_pose_initializer/src/localization_module.cpp @@ -20,6 +20,8 @@ #include #include +namespace autoware::pose_initializer +{ using ServiceException = component_interface_utils::ServiceException; using Initialize = localization_interface::Initialize; using PoseWithCovarianceStamped = geometry_msgs::msg::PoseWithCovarianceStamped; @@ -50,3 +52,4 @@ std::tuple LocalizationModule::align_pose( // Overwrite the covariance. return std::make_tuple(res->pose_with_covariance, res->reliable); } +} // namespace autoware::pose_initializer diff --git a/localization/pose_initializer/src/pose_initializer/localization_module.hpp b/localization/autoware_pose_initializer/src/localization_module.hpp similarity index 87% rename from localization/pose_initializer/src/pose_initializer/localization_module.hpp rename to localization/autoware_pose_initializer/src/localization_module.hpp index dc8bd49a26a79..c84c1cad31b0a 100644 --- a/localization/pose_initializer/src/pose_initializer/localization_module.hpp +++ b/localization/autoware_pose_initializer/src/localization_module.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef POSE_INITIALIZER__LOCALIZATION_MODULE_HPP_ -#define POSE_INITIALIZER__LOCALIZATION_MODULE_HPP_ +#ifndef LOCALIZATION_MODULE_HPP_ +#define LOCALIZATION_MODULE_HPP_ #include @@ -23,6 +23,8 @@ #include #include +namespace autoware::pose_initializer +{ class LocalizationModule { private: @@ -37,5 +39,6 @@ class LocalizationModule rclcpp::Logger logger_; rclcpp::Client::SharedPtr cli_align_; }; +} // namespace autoware::pose_initializer -#endif // POSE_INITIALIZER__LOCALIZATION_MODULE_HPP_ +#endif // LOCALIZATION_MODULE_HPP_ diff --git a/localization/pose_initializer/src/pose_initializer/ndt_localization_trigger_module.cpp b/localization/autoware_pose_initializer/src/ndt_localization_trigger_module.cpp similarity index 96% rename from localization/pose_initializer/src/pose_initializer/ndt_localization_trigger_module.cpp rename to localization/autoware_pose_initializer/src/ndt_localization_trigger_module.cpp index 436b1e2df3b21..5acf0909d21cf 100644 --- a/localization/pose_initializer/src/pose_initializer/ndt_localization_trigger_module.cpp +++ b/localization/autoware_pose_initializer/src/ndt_localization_trigger_module.cpp @@ -20,6 +20,8 @@ #include #include +namespace autoware::pose_initializer +{ using ServiceException = component_interface_utils::ServiceException; using Initialize = localization_interface::Initialize; @@ -65,3 +67,4 @@ void NdtLocalizationTriggerModule::send_request(bool flag, bool need_spin) const Initialize::Service::Response::ERROR_ESTIMATION, "NDT " + command_name + " failed"); } } +} // namespace autoware::pose_initializer diff --git a/localization/pose_initializer/src/pose_initializer/ndt_localization_trigger_module.hpp b/localization/autoware_pose_initializer/src/ndt_localization_trigger_module.hpp similarity index 82% rename from localization/pose_initializer/src/pose_initializer/ndt_localization_trigger_module.hpp rename to localization/autoware_pose_initializer/src/ndt_localization_trigger_module.hpp index 1c820557fb8ff..c7cfcbbf20680 100644 --- a/localization/pose_initializer/src/pose_initializer/ndt_localization_trigger_module.hpp +++ b/localization/autoware_pose_initializer/src/ndt_localization_trigger_module.hpp @@ -12,13 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef POSE_INITIALIZER__NDT_LOCALIZATION_TRIGGER_MODULE_HPP_ -#define POSE_INITIALIZER__NDT_LOCALIZATION_TRIGGER_MODULE_HPP_ +#ifndef NDT_LOCALIZATION_TRIGGER_MODULE_HPP_ +#define NDT_LOCALIZATION_TRIGGER_MODULE_HPP_ #include #include +namespace autoware::pose_initializer +{ class NdtLocalizationTriggerModule { private: @@ -33,5 +35,6 @@ class NdtLocalizationTriggerModule rclcpp::Node * node_; rclcpp::Client::SharedPtr client_ndt_trigger_; }; +} // namespace autoware::pose_initializer -#endif // POSE_INITIALIZER__NDT_LOCALIZATION_TRIGGER_MODULE_HPP_ +#endif // NDT_LOCALIZATION_TRIGGER_MODULE_HPP_ diff --git a/localization/pose_initializer/src/pose_initializer/pose_initializer_core.cpp b/localization/autoware_pose_initializer/src/pose_initializer_core.cpp similarity index 98% rename from localization/pose_initializer/src/pose_initializer/pose_initializer_core.cpp rename to localization/autoware_pose_initializer/src/pose_initializer_core.cpp index 6535863829fac..777f92826de73 100644 --- a/localization/pose_initializer/src/pose_initializer/pose_initializer_core.cpp +++ b/localization/autoware_pose_initializer/src/pose_initializer_core.cpp @@ -25,6 +25,8 @@ #include #include +namespace autoware::pose_initializer +{ PoseInitializer::PoseInitializer(const rclcpp::NodeOptions & options) : rclcpp::Node("pose_initializer", options) { @@ -221,6 +223,7 @@ geometry_msgs::msg::PoseWithCovarianceStamped PoseInitializer::get_gnss_pose() throw ServiceException( Initialize::Service::Response::ERROR_GNSS_SUPPORT, "GNSS is not supported."); } +} // namespace autoware::pose_initializer #include -RCLCPP_COMPONENTS_REGISTER_NODE(PoseInitializer) +RCLCPP_COMPONENTS_REGISTER_NODE(autoware::pose_initializer::PoseInitializer) diff --git a/localization/pose_initializer/src/pose_initializer/pose_initializer_core.hpp b/localization/autoware_pose_initializer/src/pose_initializer_core.hpp similarity index 93% rename from localization/pose_initializer/src/pose_initializer/pose_initializer_core.hpp rename to localization/autoware_pose_initializer/src/pose_initializer_core.hpp index cd82d522187c2..e8fef885cf577 100644 --- a/localization/pose_initializer/src/pose_initializer/pose_initializer_core.hpp +++ b/localization/autoware_pose_initializer/src/pose_initializer_core.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef POSE_INITIALIZER__POSE_INITIALIZER_CORE_HPP_ -#define POSE_INITIALIZER__POSE_INITIALIZER_CORE_HPP_ +#ifndef POSE_INITIALIZER_CORE_HPP_ +#define POSE_INITIALIZER_CORE_HPP_ #include "localization_util/diagnostics_module.hpp" @@ -26,6 +26,8 @@ #include +namespace autoware::pose_initializer +{ class StopCheckModule; class LocalizationModule; class GnssModule; @@ -69,5 +71,6 @@ class PoseInitializer : public rclcpp::Node const Initialize::Service::Response::SharedPtr res); PoseWithCovarianceStamped get_gnss_pose(); }; +} // namespace autoware::pose_initializer -#endif // POSE_INITIALIZER__POSE_INITIALIZER_CORE_HPP_ +#endif // POSE_INITIALIZER_CORE_HPP_ diff --git a/localization/pose_initializer/src/pose_initializer/stop_check_module.cpp b/localization/autoware_pose_initializer/src/stop_check_module.cpp similarity index 93% rename from localization/pose_initializer/src/pose_initializer/stop_check_module.cpp rename to localization/autoware_pose_initializer/src/stop_check_module.cpp index 683b161e14165..0ae7cde9865d4 100644 --- a/localization/pose_initializer/src/pose_initializer/stop_check_module.cpp +++ b/localization/autoware_pose_initializer/src/stop_check_module.cpp @@ -14,6 +14,8 @@ #include "stop_check_module.hpp" +namespace autoware::pose_initializer +{ StopCheckModule::StopCheckModule(rclcpp::Node * node, double buffer_duration) : VehicleStopCheckerBase(node, buffer_duration) { @@ -28,3 +30,4 @@ void StopCheckModule::on_twist(TwistWithCovarianceStamped::ConstSharedPtr msg) twist.twist = msg->twist.twist; addTwist(twist); } +} // namespace autoware::pose_initializer diff --git a/localization/pose_initializer/src/pose_initializer/stop_check_module.hpp b/localization/autoware_pose_initializer/src/stop_check_module.hpp similarity index 87% rename from localization/pose_initializer/src/pose_initializer/stop_check_module.hpp rename to localization/autoware_pose_initializer/src/stop_check_module.hpp index 31f04029bd00e..f1be03a09e4c3 100644 --- a/localization/pose_initializer/src/pose_initializer/stop_check_module.hpp +++ b/localization/autoware_pose_initializer/src/stop_check_module.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef POSE_INITIALIZER__STOP_CHECK_MODULE_HPP_ -#define POSE_INITIALIZER__STOP_CHECK_MODULE_HPP_ +#ifndef STOP_CHECK_MODULE_HPP_ +#define STOP_CHECK_MODULE_HPP_ #include #include @@ -21,6 +21,8 @@ #include #include +namespace autoware::pose_initializer +{ class StopCheckModule : public autoware::motion_utils::VehicleStopCheckerBase { public: @@ -32,5 +34,6 @@ class StopCheckModule : public autoware::motion_utils::VehicleStopCheckerBase rclcpp::Subscription::SharedPtr sub_twist_; void on_twist(TwistWithCovarianceStamped::ConstSharedPtr msg); }; +} // namespace autoware::pose_initializer -#endif // POSE_INITIALIZER__STOP_CHECK_MODULE_HPP_ +#endif // STOP_CHECK_MODULE_HPP_ diff --git a/localization/pose_initializer/test/test_copy_vector_to_array.cpp b/localization/autoware_pose_initializer/test/test_copy_vector_to_array.cpp similarity index 83% rename from localization/pose_initializer/test/test_copy_vector_to_array.cpp rename to localization/autoware_pose_initializer/test/test_copy_vector_to_array.cpp index f372a40076ffb..6205eb3b53864 100644 --- a/localization/pose_initializer/test/test_copy_vector_to_array.cpp +++ b/localization/autoware_pose_initializer/test/test_copy_vector_to_array.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "../src/pose_initializer/copy_vector_to_array.hpp" +#include "../src/copy_vector_to_array.hpp" #include @@ -20,7 +20,7 @@ TEST(CopyVectorToArray, CopyAllElements) { const std::vector vector{0, 1, 2, 3, 4}; std::array array{}; - copy_vector_to_array(vector, array); + autoware::pose_initializer::copy_vector_to_array(vector, array); EXPECT_THAT(array, testing::ElementsAre(0, 1, 2, 3, 4)); } @@ -29,7 +29,7 @@ TEST(CopyVectorToArray, CopyZeroElements) const std::vector vector{}; // just confirm that this works std::array array{}; - copy_vector_to_array(vector, array); + autoware::pose_initializer::copy_vector_to_array(vector, array); } TEST(CopyVectorToArray, ThrowsInvalidArgumentIfMoreElementsExpected) @@ -37,7 +37,7 @@ TEST(CopyVectorToArray, ThrowsInvalidArgumentIfMoreElementsExpected) auto f = [] { const std::vector vector{0, 1, 2, 3, 4}; std::array array{}; - copy_vector_to_array(vector, array); + autoware::pose_initializer::copy_vector_to_array(vector, array); }; EXPECT_THROW(