38 #include <geometry_msgs/PoseArray.h>
39 #include <mbf_abstract_nav/MoveBaseFlexConfig.h>
41 #include <nav_msgs/Path.h>
48 : AbstractNavigationServer(tf_listener_ptr)
49 , recovery_plugin_loader_(
"mbf_mesh_core",
"mbf_mesh_core::MeshRecovery")
50 , controller_plugin_loader_(
"mbf_mesh_core",
"mbf_mesh_core::MeshController")
51 , planner_plugin_loader_(
"mbf_mesh_core",
"mbf_mesh_core::MeshPlanner")
52 , mesh_ptr_(new
mesh_map::MeshMap(*tf_listener_ptr_))
53 , setup_reconfigure_(false)
64 dsrv_mesh_ = boost::make_shared<dynamic_reconfigure::Server<mbf_mesh_nav::MoveBaseFlexConfig>>(
private_nh_);
80 return boost::make_shared<mbf_mesh_nav::MeshPlannerExecution>(
81 plugin_name, boost::static_pointer_cast<mbf_mesh_core::MeshPlanner>(plugin_ptr),
mesh_ptr_,
last_config_);
87 return boost::make_shared<mbf_mesh_nav::MeshControllerExecution>(
88 plugin_name, boost::static_pointer_cast<mbf_mesh_core::MeshController>(plugin_ptr),
vel_pub_,
goal_pub_,
95 return boost::make_shared<mbf_mesh_nav::MeshRecoveryExecution>(
96 plugin_name, boost::static_pointer_cast<mbf_mesh_core::MeshRecovery>(plugin_ptr),
tf_listener_ptr_,
105 planner_ptr = boost::static_pointer_cast<mbf_abstract_core::AbstractPlanner>(
108 ROS_DEBUG_STREAM(
"mbf_mesh_core-based planner plugin " << planner_name <<
" loaded.");
112 ROS_FATAL_STREAM(
"Failed to load the " << planner_type <<
" planner, are you sure it's properly registered"
113 <<
" and that the containing library is built? " << ex_mbf_core.what());
123 boost::static_pointer_cast<mbf_mesh_core::MeshPlanner>(planner_ptr);
131 return mesh_planner_ptr->initialize(name,
mesh_ptr_);
142 ROS_DEBUG_STREAM(
"mbf_mesh_core-based controller plugin " << controller_name <<
" loaded.");
146 ROS_FATAL_STREAM(
"Failed to load the " << controller_type <<
" controller, are you sure it's properly registered"
147 <<
" and that the containing library is built? " << ex_mbf_core.what());
149 return controller_ptr;
170 boost::static_pointer_cast<mbf_mesh_core::MeshController>(controller_ptr);
182 recovery_ptr = boost::static_pointer_cast<mbf_abstract_core::AbstractRecovery>(
185 ROS_DEBUG_STREAM(
"mbf_mesh_core-based recovery behavior plugin " << recovery_name <<
" loaded.");
190 <<
" recovery behavior, are you sure it's properly registered"
191 <<
" and that the containing library is built? " << ex_mbf_core.what());
216 ROS_DEBUG_STREAM(
"Recovery behavior plugin \"" << name <<
"\" initialized.");
222 AbstractNavigationServer::stop();
242 if (config.restore_defaults)
246 config.restore_defaults =
false;
250 mbf_abstract_nav::MoveBaseFlexConfig abstract_config;
251 abstract_config.planner_frequency = config.planner_frequency;
252 abstract_config.planner_patience = config.planner_patience;
253 abstract_config.planner_max_retries = config.planner_max_retries;
254 abstract_config.controller_frequency = config.controller_frequency;
255 abstract_config.controller_patience = config.controller_patience;
256 abstract_config.controller_max_retries = config.controller_max_retries;
257 abstract_config.recovery_enabled = config.recovery_enabled;
258 abstract_config.recovery_patience = config.recovery_patience;
259 abstract_config.oscillation_timeout = config.oscillation_timeout;
260 abstract_config.oscillation_distance = config.oscillation_distance;
261 abstract_config.restore_defaults = config.restore_defaults;
268 mbf_msgs::CheckPose::Response& response)
275 mbf_msgs::CheckPath::Response& response)