From 4cc3b531b0ada02cba1bad9c69259fa2c10726bf Mon Sep 17 00:00:00 2001 From: Kenzo Lobos Tsunekawa Date: Tue, 27 Aug 2024 08:11:18 +0900 Subject: [PATCH] chore(autoware_imu_corrector): refactored the imu corrector into the autoware namespace (#8222) * chore: refactored the imu corrector into the autoware namespace Signed-off-by: Kenzo Lobos-Tsunekawa * chore: reverted to non-exported includes Signed-off-by: Kenzo Lobos-Tsunekawa --------- Signed-off-by: Kenzo Lobos-Tsunekawa Co-authored-by: Yamato Ando --- .github/CODEOWNERS | 1 + .../CMakeLists.txt | 12 ++++++------ .../README.md | 2 +- .../config/gyro_bias_estimator.param.yaml | 0 .../config/imu_corrector.param.yaml | 0 .../launch/gyro_bias_estimator.launch.xml | 6 +++--- .../launch/imu_corrector.launch.xml | 4 ++-- .../package.xml | 4 ++-- .../schema/imu_corrector.json | 0 .../src/gyro_bias_estimation_module.cpp | 7 +++---- .../src/gyro_bias_estimation_module.hpp | 4 ++-- .../src/gyro_bias_estimator.cpp | 8 ++++---- .../src/gyro_bias_estimator.hpp | 6 +++--- .../src/imu_corrector_core.cpp | 6 +++--- .../src/imu_corrector_core.hpp | 9 ++++----- .../test/test_gyro_bias_estimation_module.cpp | 4 ++-- 16 files changed, 36 insertions(+), 37 deletions(-) rename sensing/{imu_corrector => autoware_imu_corrector}/CMakeLists.txt (79%) rename sensing/{imu_corrector => autoware_imu_corrector}/README.md (99%) rename sensing/{imu_corrector => autoware_imu_corrector}/config/gyro_bias_estimator.param.yaml (100%) rename sensing/{imu_corrector => autoware_imu_corrector}/config/imu_corrector.param.yaml (100%) rename sensing/{imu_corrector => autoware_imu_corrector}/launch/gyro_bias_estimator.launch.xml (74%) rename sensing/{imu_corrector => autoware_imu_corrector}/launch/imu_corrector.launch.xml (61%) rename sensing/{imu_corrector => autoware_imu_corrector}/package.xml (90%) rename sensing/{imu_corrector => autoware_imu_corrector}/schema/imu_corrector.json (100%) rename sensing/{imu_corrector => autoware_imu_corrector}/src/gyro_bias_estimation_module.cpp (97%) rename sensing/{imu_corrector => autoware_imu_corrector}/src/gyro_bias_estimation_module.hpp (94%) rename sensing/{imu_corrector => autoware_imu_corrector}/src/gyro_bias_estimator.cpp (98%) rename sensing/{imu_corrector => autoware_imu_corrector}/src/gyro_bias_estimator.hpp (95%) rename sensing/{imu_corrector => autoware_imu_corrector}/src/imu_corrector_core.cpp (97%) rename sensing/{imu_corrector => autoware_imu_corrector}/src/imu_corrector_core.hpp (89%) rename sensing/{imu_corrector => autoware_imu_corrector}/test/test_gyro_bias_estimation_module.cpp (97%) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 403fe7e0f728f..f0fdae85b78ee 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -200,6 +200,7 @@ planning/sampling_based_planner/autoware_frenet_planner/** maxime.clement@tier4. planning/sampling_based_planner/autoware_path_sampler/** maxime.clement@tier4.jp planning/sampling_based_planner/autoware_sampler_common/** maxime.clement@tier4.jp sensing/autoware_image_diagnostics/** dai.nguyen@tier4.jp yoshi.ri@tier4.jp +sensing/autoware_imu_corrector/** taiki.yamada@tier4.jp yamato.ando@tier4.jp sensing/autoware_image_transport_decompressor/** kenzo.lobos@tier4.jp yukihiro.saito@tier4.jp sensing/autoware_pcl_extensions/** david.wong@tier4.jp kenzo.lobos@tier4.jp ryu.yamamoto@tier4.jp sensing/autoware_pointcloud_preprocessor/** abrahammonrroy@yahoo.com dai.nguyen@tier4.jp david.wong@tier4.jp kenzo.lobos@tier4.jp kyoichi.sugahara@tier4.jp melike@leodrive.ai shunsuke.miura@tier4.jp yihsiang.fang@tier4.jp yoshi.ri@tier4.jp yukihiro.saito@tier4.jp diff --git a/sensing/imu_corrector/CMakeLists.txt b/sensing/autoware_imu_corrector/CMakeLists.txt similarity index 79% rename from sensing/imu_corrector/CMakeLists.txt rename to sensing/autoware_imu_corrector/CMakeLists.txt index b3be5be12b75d..5e417ce94597a 100644 --- a/sensing/imu_corrector/CMakeLists.txt +++ b/sensing/autoware_imu_corrector/CMakeLists.txt @@ -1,10 +1,10 @@ cmake_minimum_required(VERSION 3.14) -project(imu_corrector) +project(autoware_imu_corrector) find_package(autoware_cmake REQUIRED) autoware_package() -ament_auto_add_library(${PROJECT_NAME} SHARED +ament_auto_add_library(imu_corrector SHARED src/imu_corrector_core.cpp ) @@ -13,14 +13,14 @@ ament_auto_add_library(gyro_bias_estimator SHARED src/gyro_bias_estimation_module.cpp ) -rclcpp_components_register_node(${PROJECT_NAME} - PLUGIN "imu_corrector::ImuCorrector" - EXECUTABLE ${PROJECT_NAME}_node +rclcpp_components_register_node(imu_corrector + PLUGIN "autoware::imu_corrector::ImuCorrector" + EXECUTABLE imu_corrector_node EXECUTOR SingleThreadedExecutor ) rclcpp_components_register_node(gyro_bias_estimator - PLUGIN "imu_corrector::GyroBiasEstimator" + PLUGIN "autoware::imu_corrector::GyroBiasEstimator" EXECUTABLE gyro_bias_estimator_node EXECUTOR SingleThreadedExecutor ) diff --git a/sensing/imu_corrector/README.md b/sensing/autoware_imu_corrector/README.md similarity index 99% rename from sensing/imu_corrector/README.md rename to sensing/autoware_imu_corrector/README.md index 2df12c94b7d3b..805c20c0cb35c 100644 --- a/sensing/imu_corrector/README.md +++ b/sensing/autoware_imu_corrector/README.md @@ -1,4 +1,4 @@ -# imu_corrector +# autoware_imu_corrector ## imu_corrector diff --git a/sensing/imu_corrector/config/gyro_bias_estimator.param.yaml b/sensing/autoware_imu_corrector/config/gyro_bias_estimator.param.yaml similarity index 100% rename from sensing/imu_corrector/config/gyro_bias_estimator.param.yaml rename to sensing/autoware_imu_corrector/config/gyro_bias_estimator.param.yaml diff --git a/sensing/imu_corrector/config/imu_corrector.param.yaml b/sensing/autoware_imu_corrector/config/imu_corrector.param.yaml similarity index 100% rename from sensing/imu_corrector/config/imu_corrector.param.yaml rename to sensing/autoware_imu_corrector/config/imu_corrector.param.yaml diff --git a/sensing/imu_corrector/launch/gyro_bias_estimator.launch.xml b/sensing/autoware_imu_corrector/launch/gyro_bias_estimator.launch.xml similarity index 74% rename from sensing/imu_corrector/launch/gyro_bias_estimator.launch.xml rename to sensing/autoware_imu_corrector/launch/gyro_bias_estimator.launch.xml index 100168b17171a..774b8f14f9501 100644 --- a/sensing/imu_corrector/launch/gyro_bias_estimator.launch.xml +++ b/sensing/autoware_imu_corrector/launch/gyro_bias_estimator.launch.xml @@ -3,10 +3,10 @@ - - + + - + diff --git a/sensing/imu_corrector/launch/imu_corrector.launch.xml b/sensing/autoware_imu_corrector/launch/imu_corrector.launch.xml similarity index 61% rename from sensing/imu_corrector/launch/imu_corrector.launch.xml rename to sensing/autoware_imu_corrector/launch/imu_corrector.launch.xml index 8430f2a50a85c..456ce58750658 100755 --- a/sensing/imu_corrector/launch/imu_corrector.launch.xml +++ b/sensing/autoware_imu_corrector/launch/imu_corrector.launch.xml @@ -2,9 +2,9 @@ - + - + diff --git a/sensing/imu_corrector/package.xml b/sensing/autoware_imu_corrector/package.xml similarity index 90% rename from sensing/imu_corrector/package.xml rename to sensing/autoware_imu_corrector/package.xml index f5c719d2b4f7e..4869b5566ea05 100644 --- a/sensing/imu_corrector/package.xml +++ b/sensing/autoware_imu_corrector/package.xml @@ -1,9 +1,9 @@ - imu_corrector + autoware_imu_corrector 1.0.0 - The ROS 2 imu_corrector package + The ROS 2 autoware_imu_corrector package Yamato Ando Taiki Yamada Apache License 2.0 diff --git a/sensing/imu_corrector/schema/imu_corrector.json b/sensing/autoware_imu_corrector/schema/imu_corrector.json similarity index 100% rename from sensing/imu_corrector/schema/imu_corrector.json rename to sensing/autoware_imu_corrector/schema/imu_corrector.json diff --git a/sensing/imu_corrector/src/gyro_bias_estimation_module.cpp b/sensing/autoware_imu_corrector/src/gyro_bias_estimation_module.cpp similarity index 97% rename from sensing/imu_corrector/src/gyro_bias_estimation_module.cpp rename to sensing/autoware_imu_corrector/src/gyro_bias_estimation_module.cpp index 7bd6b38490495..18d7965470f05 100644 --- a/sensing/imu_corrector/src/gyro_bias_estimation_module.cpp +++ b/sensing/autoware_imu_corrector/src/gyro_bias_estimation_module.cpp @@ -14,11 +14,10 @@ #include "gyro_bias_estimation_module.hpp" -#include "autoware/universe_utils/geometry/geometry.hpp" - +#include #include -namespace imu_corrector +namespace autoware::imu_corrector { /** @@ -116,4 +115,4 @@ geometry_msgs::msg::Vector3 GyroBiasEstimationModule::get_bias_base_link() const return gyro_bias_base; } -} // namespace imu_corrector +} // namespace autoware::imu_corrector diff --git a/sensing/imu_corrector/src/gyro_bias_estimation_module.hpp b/sensing/autoware_imu_corrector/src/gyro_bias_estimation_module.hpp similarity index 94% rename from sensing/imu_corrector/src/gyro_bias_estimation_module.hpp rename to sensing/autoware_imu_corrector/src/gyro_bias_estimation_module.hpp index 9eff50d296a95..ed166e4daf63c 100644 --- a/sensing/imu_corrector/src/gyro_bias_estimation_module.hpp +++ b/sensing/autoware_imu_corrector/src/gyro_bias_estimation_module.hpp @@ -22,7 +22,7 @@ #include #include -namespace imu_corrector +namespace autoware::imu_corrector { class GyroBiasEstimationModule { @@ -36,6 +36,6 @@ class GyroBiasEstimationModule private: std::pair gyro_bias_pair_; }; -} // namespace imu_corrector +} // namespace autoware::imu_corrector #endif // GYRO_BIAS_ESTIMATION_MODULE_HPP_ diff --git a/sensing/imu_corrector/src/gyro_bias_estimator.cpp b/sensing/autoware_imu_corrector/src/gyro_bias_estimator.cpp similarity index 98% rename from sensing/imu_corrector/src/gyro_bias_estimator.cpp rename to sensing/autoware_imu_corrector/src/gyro_bias_estimator.cpp index 6882fbf068fd1..ec91311455911 100644 --- a/sensing/imu_corrector/src/gyro_bias_estimator.cpp +++ b/sensing/autoware_imu_corrector/src/gyro_bias_estimator.cpp @@ -14,14 +14,14 @@ #include "gyro_bias_estimator.hpp" -#include "autoware/universe_utils/geometry/geometry.hpp" +#include #include #include #include -namespace imu_corrector +namespace autoware::imu_corrector { GyroBiasEstimator::GyroBiasEstimator(const rclcpp::NodeOptions & options) : rclcpp::Node("gyro_bias_validator", options), @@ -243,7 +243,7 @@ void GyroBiasEstimator::update_diagnostics(diagnostic_updater::DiagnosticStatusW stat.add("gyro_bias_threshold", f(gyro_bias_threshold_)); } -} // namespace imu_corrector +} // namespace autoware::imu_corrector #include -RCLCPP_COMPONENTS_REGISTER_NODE(imu_corrector::GyroBiasEstimator) +RCLCPP_COMPONENTS_REGISTER_NODE(autoware::imu_corrector::GyroBiasEstimator) diff --git a/sensing/imu_corrector/src/gyro_bias_estimator.hpp b/sensing/autoware_imu_corrector/src/gyro_bias_estimator.hpp similarity index 95% rename from sensing/imu_corrector/src/gyro_bias_estimator.hpp rename to sensing/autoware_imu_corrector/src/gyro_bias_estimator.hpp index 1313f2cb06507..68539a2181fd3 100644 --- a/sensing/imu_corrector/src/gyro_bias_estimator.hpp +++ b/sensing/autoware_imu_corrector/src/gyro_bias_estimator.hpp @@ -14,9 +14,9 @@ #ifndef GYRO_BIAS_ESTIMATOR_HPP_ #define GYRO_BIAS_ESTIMATOR_HPP_ -#include "autoware/universe_utils/ros/transform_listener.hpp" #include "gyro_bias_estimation_module.hpp" +#include #include #include @@ -30,7 +30,7 @@ #include #include -namespace imu_corrector +namespace autoware::imu_corrector { class GyroBiasEstimator : public rclcpp::Node { @@ -97,6 +97,6 @@ class GyroBiasEstimator : public rclcpp::Node DiagnosticsInfo diagnostics_info_; }; -} // namespace imu_corrector +} // namespace autoware::imu_corrector #endif // GYRO_BIAS_ESTIMATOR_HPP_ diff --git a/sensing/imu_corrector/src/imu_corrector_core.cpp b/sensing/autoware_imu_corrector/src/imu_corrector_core.cpp similarity index 97% rename from sensing/imu_corrector/src/imu_corrector_core.cpp rename to sensing/autoware_imu_corrector/src/imu_corrector_core.cpp index c6e12d2481f89..a9acb45888945 100644 --- a/sensing/imu_corrector/src/imu_corrector_core.cpp +++ b/sensing/autoware_imu_corrector/src/imu_corrector_core.cpp @@ -51,7 +51,7 @@ geometry_msgs::msg::Vector3 transform_vector3( return vec_stamped_transformed.vector; } -namespace imu_corrector +namespace autoware::imu_corrector { ImuCorrector::ImuCorrector(const rclcpp::NodeOptions & options) : rclcpp::Node("imu_corrector", options), @@ -124,7 +124,7 @@ void ImuCorrector::callback_imu(const sensor_msgs::msg::Imu::ConstSharedPtr imu_ imu_pub_->publish(imu_msg_base_link); } -} // namespace imu_corrector +} // namespace autoware::imu_corrector #include -RCLCPP_COMPONENTS_REGISTER_NODE(imu_corrector::ImuCorrector) +RCLCPP_COMPONENTS_REGISTER_NODE(autoware::imu_corrector::ImuCorrector) diff --git a/sensing/imu_corrector/src/imu_corrector_core.hpp b/sensing/autoware_imu_corrector/src/imu_corrector_core.hpp similarity index 89% rename from sensing/imu_corrector/src/imu_corrector_core.hpp rename to sensing/autoware_imu_corrector/src/imu_corrector_core.hpp index c02aa88a313a7..0c4839f6b5290 100644 --- a/sensing/imu_corrector/src/imu_corrector_core.hpp +++ b/sensing/autoware_imu_corrector/src/imu_corrector_core.hpp @@ -14,9 +14,8 @@ #ifndef IMU_CORRECTOR_CORE_HPP_ #define IMU_CORRECTOR_CORE_HPP_ -#include "autoware/universe_utils/ros/msg_covariance.hpp" -#include "autoware/universe_utils/ros/transform_listener.hpp" - +#include +#include #include #include @@ -27,7 +26,7 @@ #include #include -namespace imu_corrector +namespace autoware::imu_corrector { class ImuCorrector : public rclcpp::Node { @@ -57,6 +56,6 @@ class ImuCorrector : public rclcpp::Node std::string output_frame_; }; -} // namespace imu_corrector +} // namespace autoware::imu_corrector #endif // IMU_CORRECTOR_CORE_HPP_ diff --git a/sensing/imu_corrector/test/test_gyro_bias_estimation_module.cpp b/sensing/autoware_imu_corrector/test/test_gyro_bias_estimation_module.cpp similarity index 97% rename from sensing/imu_corrector/test/test_gyro_bias_estimation_module.cpp rename to sensing/autoware_imu_corrector/test/test_gyro_bias_estimation_module.cpp index 257552e15cbab..573dbe84d6027 100644 --- a/sensing/imu_corrector/test/test_gyro_bias_estimation_module.cpp +++ b/sensing/autoware_imu_corrector/test/test_gyro_bias_estimation_module.cpp @@ -18,7 +18,7 @@ #include -namespace imu_corrector +namespace autoware::imu_corrector { class GyroBiasEstimationModuleTest : public ::testing::Test { @@ -88,4 +88,4 @@ TEST_F(GyroBiasEstimationModuleTest, GetInsufficientDataExceptionWhenVehicleMovi ASSERT_THROW(module.update_bias(pose_list, gyro_list), std::runtime_error); } } -} // namespace imu_corrector +} // namespace autoware::imu_corrector