This commit is contained in:
HiepLM 2025-12-24 15:52:56 +07:00
parent 10379d5b16
commit 843f383470
5 changed files with 39 additions and 6 deletions

@ -1 +1 @@
Subproject commit 5b23baae3ace0f5acd7dc7e9cd346ffc75210630 Subproject commit 0da1b1b262323d0fb45208dc9edf1fab6fe15c8d

View File

@ -19,7 +19,7 @@ include_directories(
# To INTERFACE library (header-only) # To INTERFACE library (header-only)
add_library(nav_core INTERFACE) add_library(nav_core INTERFACE)
target_link_libraries(nav_core INTERFACE costmap_2d tf3) target_link_libraries(nav_core INTERFACE costmap_2d tf3 robot_protocol_msgs)
# Set include directories # Set include directories
target_include_directories(nav_core target_include_directories(nav_core

View File

@ -39,6 +39,7 @@
#include <geometry_msgs/PoseStamped.h> #include <geometry_msgs/PoseStamped.h>
#include <costmap_2d/costmap_2d_robot.h> #include <costmap_2d/costmap_2d_robot.h>
#include <robot_protocol_msgs/Order.h>
#include <memory> #include <memory>
namespace nav_core { namespace nav_core {
@ -73,7 +74,22 @@ namespace nav_core {
double& cost) double& cost)
{ {
cost = 0; cost = 0;
return makePlan(start, goal, plan); return false;
}
/**
* @brief Given a goal pose in the world, compute a plan
* @param start The start pose
* @param goal The goal pose
* @param plan The plan... filled by the planner
* @return True if a valid plan was found, false otherwise
*/
virtual bool makePlan(const robot_protocol_msgs::Order& msg,
const geometry_msgs::PoseStamped& start,
const geometry_msgs::PoseStamped& goal,
std::vector<geometry_msgs::PoseStamped>& plan)
{
return false;
} }
/** /**

View File

@ -156,23 +156,40 @@ void move_base::MoveBase::initialize(TFListenerPtr tf)
// we'll assume the radius of the robot to be consistent with what's specified for the costmaps // we'll assume the radius of the robot to be consistent with what's specified for the costmaps
// From config param // From config param
double inscribed_radius; double inscribed_radius;
robot::log_info("[%s:%d] inscribed_radius: %f", __FILE__, __LINE__, inscribed_radius);
private_nh_.getParam("local_costmap/inscribed_radius", inscribed_radius, 0.2); private_nh_.getParam("local_costmap/inscribed_radius", inscribed_radius, 0.2);
double circumscribed_radius; double circumscribed_radius;
private_nh_.getParam("local_costmap/circumscribed_radius", circumscribed_radius, 0.3); private_nh_.getParam("local_costmap/circumscribed_radius", circumscribed_radius, 0.3);
robot::log_info("[%s:%d] circumscribed_radius: %f", __FILE__, __LINE__, circumscribed_radius);
inscribed_radius_ = inscribed_radius; inscribed_radius_ = inscribed_radius;
circumscribed_radius_ = circumscribed_radius; circumscribed_radius_ = circumscribed_radius;
private_nh_.getParam("clearing_radius", clearing_radius_, 0.0); private_nh_.getParam("clearing_radius", clearing_radius_, 0.0);
robot::log_info("[%s:%d] clearing_radius: %f", __FILE__, __LINE__, clearing_radius_);
double conservative_reset_dist; double conservative_reset_dist;
private_nh_.getParam("conservative_reset_dist", conservative_reset_dist, 0.0); private_nh_.getParam("conservative_reset_dist", conservative_reset_dist, 0.0);
robot::log_info("[%s:%d] conservative_reset_dist: %f", __FILE__, __LINE__, conservative_reset_dist);
conservative_reset_dist_ = conservative_reset_dist; conservative_reset_dist_ = conservative_reset_dist;
robot::log_info("[%s:%d] shutdown_costmaps: %f", __FILE__, __LINE__, shutdown_costmaps_);
private_nh_.getParam("shutdown_costmaps", shutdown_costmaps_, false); private_nh_.getParam("shutdown_costmaps", shutdown_costmaps_, false);
robot::log_info("[%s:%d] clearing_rotation_allowed: %f", __FILE__, __LINE__, clearing_rotation_allowed_);
private_nh_.getParam("clearing_rotation_allowed", clearing_rotation_allowed_, true); private_nh_.getParam("clearing_rotation_allowed", clearing_rotation_allowed_, true);
robot::log_info("[%s:%d] recovery_behavior_enabled: %f", __FILE__, __LINE__, recovery_behavior_enabled_);
private_nh_.getParam("recovery_behavior_enabled", recovery_behavior_enabled_, true); private_nh_.getParam("recovery_behavior_enabled", recovery_behavior_enabled_, true);
// create the ros wrapper for the planner's costmap... and initializer a pointer we'll use with the underlying map // create the ros wrapper for the planner's costmap... and initializer a pointer we'll use with the underlying map
robot::log_info("[%s:%d] create the ros wrapper for the planner's costmap...");
try
{
planner_costmap_robot_ = new costmap_2d::Costmap2DROBOT("global_costmap", *tf_); planner_costmap_robot_ = new costmap_2d::Costmap2DROBOT("global_costmap", *tf_);
robot::log_info("[%s:%d] planner_costmap_robot_->pause()");
planner_costmap_robot_->pause(); planner_costmap_robot_->pause();
robot::log_info("[%s:%d] planner_costmap_robot_->pause()");
}
catch (const std::exception &ex)
{
robot::log_error("[%s:%d]\n EXCEPTION: %s", __FILE__, __LINE__, ex.what());
throw std::runtime_error("Failed to create the planner_costmap_robot_");
}
// initialize the global planner // initialize the global planner
try try
{ {