From 5e5b1a08ab0ef7a978c5f95a7e91f0f810b4ecc2 Mon Sep 17 00:00:00 2001 From: Hirokazu Ishida Date: Sat, 14 May 2022 21:10:57 +0900 Subject: [PATCH] Rename --- planning/freespace_planning_algorithms/CMakeLists.txt | 2 +- .../include/freespace_planning_algorithms/rrtstar.hpp | 4 ++-- planning/freespace_planning_algorithms/src/rrtstar.cpp | 9 ++++----- .../test/src/test_freespace_planning_algorithms.cpp | 5 ++--- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/planning/freespace_planning_algorithms/CMakeLists.txt b/planning/freespace_planning_algorithms/CMakeLists.txt index ff8ce24f0feb3..c25569ff04249 100644 --- a/planning/freespace_planning_algorithms/CMakeLists.txt +++ b/planning/freespace_planning_algorithms/CMakeLists.txt @@ -28,7 +28,7 @@ target_link_libraries(rrtstar_core ament_auto_add_library(freespace_planning_algorithms SHARED src/abstract_algorithm.cpp src/astar_search.cpp - src/informed_rrtstar.cpp + src/rrtstar.cpp ) target_link_libraries(freespace_planning_algorithms diff --git a/planning/freespace_planning_algorithms/include/freespace_planning_algorithms/rrtstar.hpp b/planning/freespace_planning_algorithms/include/freespace_planning_algorithms/rrtstar.hpp index 5cf12cb96bee4..428d89e4a2e86 100644 --- a/planning/freespace_planning_algorithms/include/freespace_planning_algorithms/rrtstar.hpp +++ b/planning/freespace_planning_algorithms/include/freespace_planning_algorithms/rrtstar.hpp @@ -30,10 +30,10 @@ struct RRTStarParam double margin; // [m] }; -class GridInformedRRTStar : public AbstractPlanningAlgorithm +class RRTStar : public AbstractPlanningAlgorithm { public: - explicit GridInformedRRTStar( + explicit RRTStar( const PlannerCommonParam & planner_common_param, const VehicleShape & original_vehicle_shape, const RRTStarParam & rrtstar_param); bool makePlan( diff --git a/planning/freespace_planning_algorithms/src/rrtstar.cpp b/planning/freespace_planning_algorithms/src/rrtstar.cpp index bb9bffd298279..3f82ff3927ec3 100644 --- a/planning/freespace_planning_algorithms/src/rrtstar.cpp +++ b/planning/freespace_planning_algorithms/src/rrtstar.cpp @@ -27,7 +27,7 @@ rrtstar_core::Pose posemsgToPose(const geometry_msgs::msg::Pose & pose_msg) namespace freespace_planning_algorithms { -GridInformedRRTStar::GridInformedRRTStar( +RRTStar::RRTStar( const PlannerCommonParam & planner_common_param, const VehicleShape & original_vehicle_shape, const RRTStarParam & rrtstar_param) : AbstractPlanningAlgorithm( @@ -47,7 +47,7 @@ GridInformedRRTStar::GridInformedRRTStar( } } -bool GridInformedRRTStar::makePlan( +bool RRTStar::makePlan( const geometry_msgs::msg::Pose & start_pose, const geometry_msgs::msg::Pose & goal_pose) { const rclcpp::Time begin = rclcpp::Clock(RCL_ROS_TIME).now(); @@ -105,8 +105,7 @@ bool GridInformedRRTStar::makePlan( return true; } -bool GridInformedRRTStar::hasObstacleOnTrajectory( - const geometry_msgs::msg::PoseArray & trajectory) const +bool RRTStar::hasObstacleOnTrajectory(const geometry_msgs::msg::PoseArray & trajectory) const { for (const auto & pose : trajectory.poses) { const auto pose_local = global2local(costmap_, pose); @@ -119,7 +118,7 @@ bool GridInformedRRTStar::hasObstacleOnTrajectory( return false; } -void GridInformedRRTStar::setRRTPath(const std::vector & waypoints) +void RRTStar::setRRTPath(const std::vector & waypoints) { std_msgs::msg::Header header; header.stamp = rclcpp::Clock(RCL_ROS_TIME).now(); diff --git a/planning/freespace_planning_algorithms/test/src/test_freespace_planning_algorithms.cpp b/planning/freespace_planning_algorithms/test/src/test_freespace_planning_algorithms.cpp index 423c37238635f..019823c1268c4 100644 --- a/planning/freespace_planning_algorithms/test/src/test_freespace_planning_algorithms.cpp +++ b/planning/freespace_planning_algorithms/test/src/test_freespace_planning_algorithms.cpp @@ -14,7 +14,7 @@ #include "freespace_planning_algorithms/abstract_algorithm.hpp" #include "freespace_planning_algorithms/astar_search.hpp" -#include "freespace_planning_algorithms/informed_rrtstar.hpp" +#include "freespace_planning_algorithms/rrtstar.hpp" #include #include @@ -191,8 +191,7 @@ std::unique_ptr configure_rrtstar(bool update) const double mu = 12.0; const double margin = 0.2; const auto rrtstar_param = fpa::RRTStarParam{enable_update, mu, margin}; - auto algo = - std::make_unique(planner_common_param, vehicle_shape, rrtstar_param); + auto algo = std::make_unique(planner_common_param, vehicle_shape, rrtstar_param); return algo; }