From 69844d13e4d6ca696e0489ca4aa6c52a4c72ea56 Mon Sep 17 00:00:00 2001 From: Maxime CLEMENT Date: Mon, 10 Jun 2024 12:53:56 +0900 Subject: [PATCH] refactor(behavior_path_sampling_planner_module): add autoware prefix Signed-off-by: Maxime CLEMENT --- .../CMakeLists.txt | 2 +- .../README.md | 0 .../config/sampling_planner.param.yaml | 0 .../manager.hpp | 17 ++++++++------- .../sampling_planner_module.hpp | 21 +++++++++++-------- .../sampling_planner_parameters.hpp | 10 ++++----- .../util.hpp | 17 ++++++++------- .../package.xml | 4 ++-- .../plugins.xml | 3 +++ .../src/manager.cpp | 10 ++++----- .../src/sampling_planner_module.cpp | 14 ++++++------- .../plugins.xml | 3 --- 12 files changed, 52 insertions(+), 49 deletions(-) rename planning/{behavior_path_sampling_planner_module => autoware_behavior_path_sampling_planner_module}/CMakeLists.txt (84%) rename planning/{behavior_path_sampling_planner_module => autoware_behavior_path_sampling_planner_module}/README.md (100%) rename planning/{behavior_path_sampling_planner_module => autoware_behavior_path_sampling_planner_module}/config/sampling_planner.param.yaml (100%) rename planning/{behavior_path_sampling_planner_module/include/behavior_path_sampling_planner_module => autoware_behavior_path_sampling_planner_module/include/autoware_behavior_path_sampling_planner_module}/manager.hpp (69%) rename planning/{behavior_path_sampling_planner_module/include/behavior_path_sampling_planner_module => autoware_behavior_path_sampling_planner_module/include/autoware_behavior_path_sampling_planner_module}/sampling_planner_module.hpp (93%) rename planning/{behavior_path_sampling_planner_module/include/behavior_path_sampling_planner_module => autoware_behavior_path_sampling_planner_module/include/autoware_behavior_path_sampling_planner_module}/sampling_planner_parameters.hpp (86%) rename planning/{behavior_path_sampling_planner_module/include/behavior_path_sampling_planner_module => autoware_behavior_path_sampling_planner_module/include/autoware_behavior_path_sampling_planner_module}/util.hpp (87%) rename planning/{behavior_path_sampling_planner_module => autoware_behavior_path_sampling_planner_module}/package.xml (91%) create mode 100644 planning/autoware_behavior_path_sampling_planner_module/plugins.xml rename planning/{behavior_path_sampling_planner_module => autoware_behavior_path_sampling_planner_module}/src/manager.cpp (95%) rename planning/{behavior_path_sampling_planner_module => autoware_behavior_path_sampling_planner_module}/src/sampling_planner_module.cpp (98%) delete mode 100644 planning/behavior_path_sampling_planner_module/plugins.xml diff --git a/planning/behavior_path_sampling_planner_module/CMakeLists.txt b/planning/autoware_behavior_path_sampling_planner_module/CMakeLists.txt similarity index 84% rename from planning/behavior_path_sampling_planner_module/CMakeLists.txt rename to planning/autoware_behavior_path_sampling_planner_module/CMakeLists.txt index 4d2198e7748c7..a9dd1ebdcb05e 100644 --- a/planning/behavior_path_sampling_planner_module/CMakeLists.txt +++ b/planning/autoware_behavior_path_sampling_planner_module/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.14) -project(behavior_path_sampling_planner_module) +project(autoware_behavior_path_sampling_planner_module) find_package(autoware_cmake REQUIRED) autoware_package() diff --git a/planning/behavior_path_sampling_planner_module/README.md b/planning/autoware_behavior_path_sampling_planner_module/README.md similarity index 100% rename from planning/behavior_path_sampling_planner_module/README.md rename to planning/autoware_behavior_path_sampling_planner_module/README.md diff --git a/planning/behavior_path_sampling_planner_module/config/sampling_planner.param.yaml b/planning/autoware_behavior_path_sampling_planner_module/config/sampling_planner.param.yaml similarity index 100% rename from planning/behavior_path_sampling_planner_module/config/sampling_planner.param.yaml rename to planning/autoware_behavior_path_sampling_planner_module/config/sampling_planner.param.yaml diff --git a/planning/behavior_path_sampling_planner_module/include/behavior_path_sampling_planner_module/manager.hpp b/planning/autoware_behavior_path_sampling_planner_module/include/autoware_behavior_path_sampling_planner_module/manager.hpp similarity index 69% rename from planning/behavior_path_sampling_planner_module/include/behavior_path_sampling_planner_module/manager.hpp rename to planning/autoware_behavior_path_sampling_planner_module/include/autoware_behavior_path_sampling_planner_module/manager.hpp index 84408f72c109c..5aa8ed04ad260 100644 --- a/planning/behavior_path_sampling_planner_module/include/behavior_path_sampling_planner_module/manager.hpp +++ b/planning/autoware_behavior_path_sampling_planner_module/include/autoware_behavior_path_sampling_planner_module/manager.hpp @@ -12,12 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__MANAGER_HPP_ -#define BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__MANAGER_HPP_ +#ifndef AUTOWARE_BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__MANAGER_HPP_ +#define AUTOWARE_BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__MANAGER_HPP_ #include "autoware_behavior_path_planner_common/interface/scene_module_manager_interface.hpp" -#include "behavior_path_sampling_planner_module/sampling_planner_module.hpp" -#include "behavior_path_sampling_planner_module/sampling_planner_parameters.hpp" +#include "autoware_behavior_path_sampling_planner_module/sampling_planner_module.hpp" +#include "autoware_behavior_path_sampling_planner_module/sampling_planner_parameters.hpp" #include @@ -26,9 +26,10 @@ #include #include -namespace behavior_path_planner +namespace autoware::behavior_path_planner { - +using namespace ::behavior_path_planner; // NOLINT TODO(Maxime): remove once moved to autoware + // namespace class SamplingPlannerModuleManager : public SceneModuleManagerInterface { public: @@ -49,6 +50,6 @@ class SamplingPlannerModuleManager : public SceneModuleManagerInterface std::shared_ptr parameters_; }; -} // namespace behavior_path_planner +} // namespace autoware::behavior_path_planner -#endif // BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__MANAGER_HPP_ +#endif // AUTOWARE_BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__MANAGER_HPP_ diff --git a/planning/behavior_path_sampling_planner_module/include/behavior_path_sampling_planner_module/sampling_planner_module.hpp b/planning/autoware_behavior_path_sampling_planner_module/include/autoware_behavior_path_sampling_planner_module/sampling_planner_module.hpp similarity index 93% rename from planning/behavior_path_sampling_planner_module/include/behavior_path_sampling_planner_module/sampling_planner_module.hpp rename to planning/autoware_behavior_path_sampling_planner_module/include/autoware_behavior_path_sampling_planner_module/sampling_planner_module.hpp index 0a5dec8d07b4f..16a36bd07af38 100644 --- a/planning/behavior_path_sampling_planner_module/include/behavior_path_sampling_planner_module/sampling_planner_module.hpp +++ b/planning/autoware_behavior_path_sampling_planner_module/include/autoware_behavior_path_sampling_planner_module/sampling_planner_module.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__SAMPLING_PLANNER_MODULE_HPP_ -#define BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__SAMPLING_PLANNER_MODULE_HPP_ +#ifndef AUTOWARE_BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__SAMPLING_PLANNER_MODULE_HPP_ +#define AUTOWARE_BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__SAMPLING_PLANNER_MODULE_HPP_ #include "autoware_behavior_path_planner_common/interface/scene_module_interface.hpp" #include "autoware_behavior_path_planner_common/marker_utils/utils.hpp" @@ -21,6 +21,8 @@ #include "autoware_behavior_path_planner_common/utils/drivable_area_expansion/static_drivable_area.hpp" #include "autoware_behavior_path_planner_common/utils/path_utils.hpp" #include "autoware_behavior_path_planner_common/utils/utils.hpp" +#include "autoware_behavior_path_sampling_planner_module/sampling_planner_parameters.hpp" +#include "autoware_behavior_path_sampling_planner_module/util.hpp" #include "autoware_bezier_sampler/bezier_sampling.hpp" #include "autoware_frenet_planner/frenet_planner.hpp" #include "autoware_sampler_common/constraints/footprint.hpp" @@ -28,8 +30,6 @@ #include "autoware_sampler_common/constraints/soft_constraint.hpp" #include "autoware_sampler_common/structures.hpp" #include "autoware_sampler_common/transform/spline_transform.hpp" -#include "behavior_path_sampling_planner_module/sampling_planner_parameters.hpp" -#include "behavior_path_sampling_planner_module/util.hpp" #include "lanelet2_extension/utility/query.hpp" #include "lanelet2_extension/utility/utilities.hpp" #include "motion_utils/trajectory/path_with_lane_id.hpp" @@ -56,8 +56,11 @@ #include #include #include -namespace behavior_path_planner +namespace autoware::behavior_path_planner { +// NOLINT +using namespace ::behavior_path_planner; // NOLINT TODO(Maxime): remove once moved to autoware + // namespace using autoware_planning_msgs::msg::TrajectoryPoint; struct SamplingPlannerData { @@ -142,8 +145,8 @@ class SamplingPlannerModule : public SceneModuleInterface } SamplingPlannerDebugData debug_data_; - behavior_path_planner::HardConstraintsFunctionVector hard_constraints_; - behavior_path_planner::SoftConstraintsFunctionVector soft_constraints_; + HardConstraintsFunctionVector hard_constraints_; + SoftConstraintsFunctionVector soft_constraints_; private: SamplingPlannerData createPlannerData( @@ -261,6 +264,6 @@ class SamplingPlannerModule : public SceneModuleInterface const std::shared_ptr & planner_data) const; }; -} // namespace behavior_path_planner +} // namespace autoware::behavior_path_planner -#endif // BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__SAMPLING_PLANNER_MODULE_HPP_ +#endif // AUTOWARE_BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__SAMPLING_PLANNER_MODULE_HPP_ diff --git a/planning/behavior_path_sampling_planner_module/include/behavior_path_sampling_planner_module/sampling_planner_parameters.hpp b/planning/autoware_behavior_path_sampling_planner_module/include/autoware_behavior_path_sampling_planner_module/sampling_planner_parameters.hpp similarity index 86% rename from planning/behavior_path_sampling_planner_module/include/behavior_path_sampling_planner_module/sampling_planner_parameters.hpp rename to planning/autoware_behavior_path_sampling_planner_module/include/autoware_behavior_path_sampling_planner_module/sampling_planner_parameters.hpp index 4ddfbf436ffaf..6344af7163577 100644 --- a/planning/behavior_path_sampling_planner_module/include/behavior_path_sampling_planner_module/sampling_planner_parameters.hpp +++ b/planning/autoware_behavior_path_sampling_planner_module/include/autoware_behavior_path_sampling_planner_module/sampling_planner_parameters.hpp @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__SAMPLING_PLANNER_PARAMETERS_HPP_ -#define BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__SAMPLING_PLANNER_PARAMETERS_HPP_ +#ifndef AUTOWARE_BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__SAMPLING_PLANNER_PARAMETERS_HPP_ +#define AUTOWARE_BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__SAMPLING_PLANNER_PARAMETERS_HPP_ #include "autoware_bezier_sampler/bezier_sampling.hpp" #include "autoware_sampler_common/structures.hpp" #include -namespace behavior_path_planner +namespace autoware::behavior_path_planner { using tier4_autoware_utils::LinearRing2d; using tier4_autoware_utils::MultiPoint2d; @@ -87,5 +87,5 @@ struct SamplingPlannerInternalParameters Sampling sampling; Preprocessing preprocessing{}; }; -} // namespace behavior_path_planner -#endif // BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__SAMPLING_PLANNER_PARAMETERS_HPP_ +} // namespace autoware::behavior_path_planner +#endif // AUTOWARE_BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__SAMPLING_PLANNER_PARAMETERS_HPP_ diff --git a/planning/behavior_path_sampling_planner_module/include/behavior_path_sampling_planner_module/util.hpp b/planning/autoware_behavior_path_sampling_planner_module/include/autoware_behavior_path_sampling_planner_module/util.hpp similarity index 87% rename from planning/behavior_path_sampling_planner_module/include/behavior_path_sampling_planner_module/util.hpp rename to planning/autoware_behavior_path_sampling_planner_module/include/autoware_behavior_path_sampling_planner_module/util.hpp index 2825ead2a9fee..fe00419d1ffde 100644 --- a/planning/behavior_path_sampling_planner_module/include/behavior_path_sampling_planner_module/util.hpp +++ b/planning/autoware_behavior_path_sampling_planner_module/include/autoware_behavior_path_sampling_planner_module/util.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__UTIL_HPP_ -#define BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__UTIL_HPP_ +#ifndef AUTOWARE_BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__UTIL_HPP_ +#define AUTOWARE_BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__UTIL_HPP_ #include "autoware_sampler_common/structures.hpp" #include "autoware_sampler_common/transform/spline_transform.hpp" @@ -26,9 +26,10 @@ #include #include #include -namespace behavior_path_planner +namespace autoware::behavior_path_planner { - +using namespace ::behavior_path_planner; // NOLINT TODO(Maxime): remove once moved to autoware + // namespace using geometry_msgs::msg::Pose; struct SoftConstraintsInputs @@ -38,8 +39,8 @@ struct SoftConstraintsInputs lanelet::ArcCoordinates ego_arc; lanelet::ArcCoordinates goal_arc; lanelet::ConstLanelets closest_lanelets_to_goal; - behavior_path_planner::PlanResult reference_path; - behavior_path_planner::PlanResult prev_module_path; + PlanResult reference_path; + PlanResult prev_module_path; std::optional prev_path; lanelet::ConstLanelets current_lanes; }; @@ -101,6 +102,6 @@ inline autoware::sampler_common::State getInitialState( return initial_state; } -} // namespace behavior_path_planner +} // namespace autoware::behavior_path_planner -#endif // BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__UTIL_HPP_ +#endif // AUTOWARE_BEHAVIOR_PATH_SAMPLING_PLANNER_MODULE__UTIL_HPP_ diff --git a/planning/behavior_path_sampling_planner_module/package.xml b/planning/autoware_behavior_path_sampling_planner_module/package.xml similarity index 91% rename from planning/behavior_path_sampling_planner_module/package.xml rename to planning/autoware_behavior_path_sampling_planner_module/package.xml index 0583056db4293..cb452cba98db2 100644 --- a/planning/behavior_path_sampling_planner_module/package.xml +++ b/planning/autoware_behavior_path_sampling_planner_module/package.xml @@ -1,9 +1,9 @@ - behavior_path_sampling_planner_module + autoware_behavior_path_sampling_planner_module 0.1.0 - The behavior_path_sampling_planner_module package + The autoware_behavior_path_sampling_planner_module package Daniel Sanchez Maxime Clement diff --git a/planning/autoware_behavior_path_sampling_planner_module/plugins.xml b/planning/autoware_behavior_path_sampling_planner_module/plugins.xml new file mode 100644 index 0000000000000..e04bad32cc0a1 --- /dev/null +++ b/planning/autoware_behavior_path_sampling_planner_module/plugins.xml @@ -0,0 +1,3 @@ + + + diff --git a/planning/behavior_path_sampling_planner_module/src/manager.cpp b/planning/autoware_behavior_path_sampling_planner_module/src/manager.cpp similarity index 95% rename from planning/behavior_path_sampling_planner_module/src/manager.cpp rename to planning/autoware_behavior_path_sampling_planner_module/src/manager.cpp index 724b87c4752e5..87dc706dd53c9 100644 --- a/planning/behavior_path_sampling_planner_module/src/manager.cpp +++ b/planning/autoware_behavior_path_sampling_planner_module/src/manager.cpp @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "behavior_path_sampling_planner_module/manager.hpp" +#include "autoware_behavior_path_sampling_planner_module/manager.hpp" #include "tier4_autoware_utils/ros/update_param.hpp" @@ -22,7 +22,7 @@ #include #include -namespace behavior_path_planner +namespace autoware::behavior_path_planner { void SamplingPlannerModuleManager::init(rclcpp::Node * node) @@ -134,9 +134,9 @@ void SamplingPlannerModuleManager::updateModuleParams( }); } -} // namespace behavior_path_planner +} // namespace autoware::behavior_path_planner #include PLUGINLIB_EXPORT_CLASS( - behavior_path_planner::SamplingPlannerModuleManager, - behavior_path_planner::SceneModuleManagerInterface) + autoware::behavior_path_planner::SamplingPlannerModuleManager, + ::behavior_path_planner::SceneModuleManagerInterface) diff --git a/planning/behavior_path_sampling_planner_module/src/sampling_planner_module.cpp b/planning/autoware_behavior_path_sampling_planner_module/src/sampling_planner_module.cpp similarity index 98% rename from planning/behavior_path_sampling_planner_module/src/sampling_planner_module.cpp rename to planning/autoware_behavior_path_sampling_planner_module/src/sampling_planner_module.cpp index 22187652bd663..3ad507a91bea8 100644 --- a/planning/behavior_path_sampling_planner_module/src/sampling_planner_module.cpp +++ b/planning/autoware_behavior_path_sampling_planner_module/src/sampling_planner_module.cpp @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "behavior_path_sampling_planner_module/sampling_planner_module.hpp" +#include "autoware_behavior_path_sampling_planner_module/sampling_planner_module.hpp" -namespace behavior_path_planner +namespace autoware::behavior_path_planner { using geometry_msgs::msg::Point; using motion_utils::calcSignedArcLength; @@ -267,7 +267,7 @@ bool SamplingPlannerModule::isReferencePathSafe() const const auto footprint = autoware::sampler_common::constraints::buildFootprintPoints( reference_path, internal_params_->constraints); - behavior_path_planner::HardConstraintsFunctionVector hard_constraints_reference_path; + HardConstraintsFunctionVector hard_constraints_reference_path; hard_constraints_reference_path.emplace_back( []( autoware::sampler_common::Path & path, @@ -415,8 +415,7 @@ BehaviorModuleOutput SamplingPlannerModule::plan() autoware::frenet_planner::SamplingParameters sampling_parameters; const auto & pose = planner_data_->self_odometry->pose.pose; - autoware::sampler_common::State initial_state = - behavior_path_planner::getInitialState(pose, reference_spline); + autoware::sampler_common::State initial_state = getInitialState(pose, reference_spline); sampling_parameters = prepareSamplingParameters(initial_state, reference_spline, *internal_params_); @@ -546,8 +545,7 @@ BehaviorModuleOutput SamplingPlannerModule::plan() const auto reused_path = get_subset(prev_path_frenet, reuse_idx); geometry_msgs::msg::Pose future_pose = reused_path.poses.back(); - autoware::sampler_common::State future_state = - behavior_path_planner::getInitialState(future_pose, reference_spline); + autoware::sampler_common::State future_state = getInitialState(future_pose, reference_spline); autoware::frenet_planner::FrenetState frenet_reuse_state; set_frenet_state(future_state, reference_spline, frenet_reuse_state); @@ -984,4 +982,4 @@ autoware::frenet_planner::SamplingParameters SamplingPlannerModule::prepareSampl return sampling_parameters; } -} // namespace behavior_path_planner +} // namespace autoware::behavior_path_planner diff --git a/planning/behavior_path_sampling_planner_module/plugins.xml b/planning/behavior_path_sampling_planner_module/plugins.xml deleted file mode 100644 index 04a8dbb3171c0..0000000000000 --- a/planning/behavior_path_sampling_planner_module/plugins.xml +++ /dev/null @@ -1,3 +0,0 @@ - - -