@@ -81,6 +81,11 @@ ControllerServer::ControllerServer(const rclcpp::NodeOptions & options)
8181 sensor_costmap_ros_ = std::make_shared<nav2_costmap_2d::Costmap2DROS>(
8282 " sensor_local_costmap" , std::string{get_namespace ()}, " sensor_local_costmap" ,
8383 get_parameter (" use_sim_time" ).as_bool (), options.use_intra_process_comms ());
84+
85+ // The costmap node is used by BT to validate that a path can be driven on
86+ global_no_waiting_zone_costmap_ros_ = std::make_shared<nav2_costmap_2d::Costmap2DROS>(
87+ " global_no_waiting_zones_costmap" , std::string{get_namespace ()}, " global_no_waiting_zones_costmap" ,
88+ get_parameter (" use_sim_time" ).as_bool (), options.use_intra_process_comms ());
8489}
8590
8691ControllerServer::~ControllerServer ()
@@ -147,10 +152,12 @@ ControllerServer::on_configure(const rclcpp_lifecycle::State & state)
147152 costmap_ros_->configure ();
148153 narrow_costmap_ros_->configure ();
149154 sensor_costmap_ros_->configure ();
155+ global_no_waiting_zone_costmap_ros_->configure ();
150156 // Launch a thread to run the costmap node
151157 costmap_thread_ = std::make_unique<nav2_util::NodeThread>(costmap_ros_);
152158 narrow_costmap_thread_ = std::make_unique<nav2_util::NodeThread>(narrow_costmap_ros_);
153159 sensor_costmap_thread_ = std::make_unique<nav2_util::NodeThread>(sensor_costmap_ros_);
160+ global_no_waiting_zone_costmap_thread_ = std::make_unique<nav2_util::NodeThread>(global_no_waiting_zone_costmap_ros_);
154161
155162 for (size_t i = 0 ; i != progress_checker_ids_.size (); i++) {
156163 try {
@@ -294,6 +301,7 @@ ControllerServer::on_activate(const rclcpp_lifecycle::State & /*state*/)
294301 }
295302 narrow_costmap_ros_->activate ();
296303 sensor_costmap_ros_->activate ();
304+ global_no_waiting_zone_costmap_ros_->activate ();
297305 ControllerMap::iterator it;
298306 for (it = controllers_.begin (); it != controllers_.end (); ++it) {
299307 it->second ->activate ();
@@ -333,6 +341,7 @@ ControllerServer::on_deactivate(const rclcpp_lifecycle::State & /*state*/)
333341 costmap_ros_->deactivate ();
334342 narrow_costmap_ros_->deactivate ();
335343 sensor_costmap_ros_->deactivate ();
344+ global_no_waiting_zone_costmap_ros_->deactivate ();
336345
337346 // Always publish a zero velocity when deactivating the controller server
338347 geometry_msgs::msg::TwistStamped velocity;
0 commit comments