HiepLM update

This commit is contained in:
HiepLM 2025-12-30 10:22:16 +07:00
parent d6512018ef
commit 60e9c5673f
3 changed files with 11 additions and 11 deletions

View File

@ -47,10 +47,10 @@ target_link_libraries(custom_planner
robot_visualization_msgs robot_visualization_msgs
robot_nav_msgs robot_nav_msgs
tf3 tf3
tf3_geometry_msgs robot_tf3_geometry_msgs
robot_time robot_time
data_convert data_convert
costmap_2d robot_costmap_2d
nav_core nav_core
robot_protocol_msgs robot_protocol_msgs
) )
@ -72,8 +72,8 @@ install(TARGETS custom_planner
INCLUDES DESTINATION include # Cài đt include INCLUDES DESTINATION include # Cài đt include
) )
# --- Xut export set costmap_2dTargets thành file CMake module --- # --- Xut export set robot_costmap_2dTargets thành file CMake module ---
# --- To file lib/cmake/custom_planner/costmap_2dTargets.cmake --- # --- To file lib/cmake/custom_planner/robot_costmap_2dTargets.cmake ---
# --- File này cha cu hình giúp project khác có th dùng --- # --- File này cha cu hình giúp project khác có th dùng ---
# --- Find_package(custom_planner REQUIRED) --- # --- Find_package(custom_planner REQUIRED) ---
# --- Target_link_libraries(my_app PRIVATE custom_planner::custom_planner) --- # --- Target_link_libraries(my_app PRIVATE custom_planner::custom_planner) ---

View File

@ -13,7 +13,7 @@ using namespace std;
#include <robot_visualization_msgs/Marker.h> #include <robot_visualization_msgs/Marker.h>
// Costmap used for the map representation // Costmap used for the map representation
#include <costmap_2d/costmap_2d_robot.h> #include <robot_costmap_2d/costmap_2d_robot.h>
// global representation // global representation
#include <nav_core/base_global_planner.h> #include <nav_core/base_global_planner.h>
@ -70,7 +70,7 @@ public:
* @param name The name of this planner * @param name The name of this planner
* @param costmap_ros A pointer to the ROS wrapper of the costmap to use * @param costmap_ros A pointer to the ROS wrapper of the costmap to use
*/ */
CustomPlanner(std::string name, costmap_2d::Costmap2DROBOT* costmap_robot); CustomPlanner(std::string name, robot_costmap_2d::Costmap2DROBOT* costmap_robot);
/** /**
@ -79,7 +79,7 @@ public:
* @param costmap_ros A pointer to the ROS wrapper of the costmap to use * @param costmap_ros A pointer to the ROS wrapper of the costmap to use
*/ */
virtual bool initialize(std::string name, virtual bool initialize(std::string name,
costmap_2d::Costmap2DROBOT* costmap_robot); robot_costmap_2d::Costmap2DROBOT* costmap_robot);
virtual bool makePlan(const robot_protocol_msgs::Order& msg, virtual bool makePlan(const robot_protocol_msgs::Order& msg,
const robot_geometry_msgs::PoseStamped& start, const robot_geometry_msgs::PoseStamped& start,
@ -210,7 +210,7 @@ private:
bool allow_unknown_; bool allow_unknown_;
std::string name_; std::string name_;
costmap_2d::Costmap2DROBOT* costmap_robot_; /**< manages the cost map for us */ robot_costmap_2d::Costmap2DROBOT* costmap_robot_; /**< manages the cost map for us */
std::vector<robot_geometry_msgs::Point> footprint_; std::vector<robot_geometry_msgs::Point> footprint_;
unsigned int current_env_width_; unsigned int current_env_width_;
unsigned int current_env_height_; unsigned int current_env_height_;

View File

@ -1,7 +1,7 @@
#include <custom_planner/custom_planner.h> #include <custom_planner/custom_planner.h>
#include <robot_nav_msgs/Path.h> #include <robot_nav_msgs/Path.h>
#include <robot_geometry_msgs/Point.h> #include <robot_geometry_msgs/Point.h>
#include <costmap_2d/inflation_layer.h> #include <robot_costmap_2d/inflation_layer.h>
#include <tf3/LinearMath/Quaternion.h> #include <tf3/LinearMath/Quaternion.h>
#include <boost/dll/alias.hpp> #include <boost/dll/alias.hpp>
@ -14,13 +14,13 @@ namespace custom_planner
{ {
} }
CustomPlanner::CustomPlanner(std::string name, costmap_2d::Costmap2DROBOT* costmap_robot) CustomPlanner::CustomPlanner(std::string name, robot_costmap_2d::Costmap2DROBOT* costmap_robot)
: initialized_(false), costmap_robot_(NULL) : initialized_(false), costmap_robot_(NULL)
{ {
initialize(name, costmap_robot); initialize(name, costmap_robot);
} }
bool CustomPlanner::initialize(std::string name, costmap_2d::Costmap2DROBOT* costmap_robot) bool CustomPlanner::initialize(std::string name, robot_costmap_2d::Costmap2DROBOT* costmap_robot)
{ {
if (!initialized_) if (!initialized_)
{ {