From b5a1b7b6d8367b5812b32f2ca51bbed6e2a4c99a Mon Sep 17 00:00:00 2001 From: HiepLM Date: Tue, 30 Dec 2025 10:20:42 +0700 Subject: [PATCH] Hiep update --- CMakeLists.txt | 8 ++++---- include/dock_planner/dock_calc.h | 8 ++++---- include/dock_planner/dock_planner.h | 8 ++++---- src/dock_calc.cpp | 2 +- src/dock_planner.cpp | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 44b9a16..308700b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,10 +47,10 @@ target_link_libraries(dock_planner robot_visualization_msgs robot_nav_msgs tf3 - tf3_geometry_msgs + robot_tf3_geometry_msgs robot_time data_convert - costmap_2d + robot_costmap_2d nav_core robot_cpp robot_nav_2d_utils @@ -73,8 +73,8 @@ install(TARGETS dock_planner INCLUDES DESTINATION include # Cài đặt include ) -# --- Xuất export set costmap_2dTargets thành file CMake module --- -# --- Tạo file lib/cmake/dock_planner/costmap_2dTargets.cmake --- +# --- Xuất export set robot_costmap_2dTargets thành file CMake module --- +# --- Tạo file lib/cmake/dock_planner/robot_costmap_2dTargets.cmake --- # --- File này chứa cấu hình giúp project khác có thể dùng --- # --- Find_package(dock_planner REQUIRED) --- # --- Target_link_libraries(my_app PRIVATE dock_planner::dock_planner) --- diff --git a/include/dock_planner/dock_calc.h b/include/dock_planner/dock_calc.h index 077d913..b474ad3 100644 --- a/include/dock_planner/dock_calc.h +++ b/include/dock_planner/dock_calc.h @@ -8,9 +8,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include @@ -120,7 +120,7 @@ namespace dock_planner public: //Params - costmap_2d::Costmap2D* costmap_; + robot_costmap_2d::Costmap2D* costmap_; int cost_threshold_; // Threshold for obstacle detection double safety_distance_; // Safety distance from obstacles diff --git a/include/dock_planner/dock_planner.h b/include/dock_planner/dock_planner.h index e59fa60..1721c3b 100644 --- a/include/dock_planner/dock_planner.h +++ b/include/dock_planner/dock_planner.h @@ -11,9 +11,9 @@ namespace dock_planner { { public: DockPlanner(); - DockPlanner(std::string name, costmap_2d::Costmap2DROBOT* costmap_robot); + DockPlanner(std::string name, robot_costmap_2d::Costmap2DROBOT* costmap_robot); - bool initialize(std::string name, costmap_2d::Costmap2DROBOT* costmap_robot); + bool initialize(std::string name, robot_costmap_2d::Costmap2DROBOT* costmap_robot); bool makePlan(const robot_geometry_msgs::PoseStamped& start, const robot_geometry_msgs::PoseStamped& goal, @@ -21,8 +21,8 @@ namespace dock_planner { private: // Core components - costmap_2d::Costmap2DROBOT* costmap_robot_; - costmap_2d::Costmap2D* costmap_; + robot_costmap_2d::Costmap2DROBOT* costmap_robot_; + robot_costmap_2d::Costmap2D* costmap_; bool initialized_; std::string frame_id_; // ros::Publisher plan_pub_; diff --git a/src/dock_calc.cpp b/src/dock_calc.cpp index 6d597ea..8d16450 100644 --- a/src/dock_calc.cpp +++ b/src/dock_calc.cpp @@ -728,7 +728,7 @@ namespace dock_planner // check_y >= 0 && check_y < costmap_->getSizeInCellsY()) // { // unsigned char cost = costmap_->getCost(check_x, check_y); - // if (cost >= costmap_2d::LETHAL_OBSTACLE) + // if (cost >= robot_costmap_2d::LETHAL_OBSTACLE) // { // double dx = pose.position.x - space_footprint[i].x; // double dy = pose.position.y - space_footprint[i].y; diff --git a/src/dock_planner.cpp b/src/dock_planner.cpp index ae599d5..8a5e304 100644 --- a/src/dock_planner.cpp +++ b/src/dock_planner.cpp @@ -21,7 +21,7 @@ namespace dock_planner * @param costmap_robot Pointer tới costmap ROS wrapper * Tự động gọi initialize() nếu được cung cấp costmap */ - DockPlanner::DockPlanner(std::string name, costmap_2d::Costmap2DROBOT* costmap_robot) + DockPlanner::DockPlanner(std::string name, robot_costmap_2d::Costmap2DROBOT* costmap_robot) : costmap_robot_(nullptr), costmap_(nullptr), initialized_(false), @@ -43,7 +43,7 @@ namespace dock_planner * - Load parameters từ ROS parameter server * - Đánh dấu trạng thái initialized */ - bool DockPlanner::initialize(std::string name, costmap_2d::Costmap2DROBOT* costmap_robot) + bool DockPlanner::initialize(std::string name, robot_costmap_2d::Costmap2DROBOT* costmap_robot) { if (!initialized_) {