给下列程序添加英文注释: MoveBase::~MoveBase(){ recovery_behaviors_.clear(); delete dsrv_; if(as_ != NULL) delete as_; if(planner_costmap_ros_ != NULL) delete planner_costmap_ros_; if(controller_costmap_ros_ != NULL) delete controller_costmap_ros_; planner_thread_->interrupt(); planner_thread_->join(); delete planner_thread_; delete planner_plan_; delete latest_plan_; delete controller_plan_; planner_.reset(); tc_.reset(); }
时间: 2024-03-30 16:40:59 浏览: 16
// Destructor for the MoveBase class
MoveBase::~MoveBase(){
// Clear the vector of recovery behaviors
recovery_behaviors_.clear();
// Delete the dynamic reconfigure server
delete dsrv_;
// Delete the action server
if(as_ != NULL)
delete as_;
// Delete the costmap for the planner
if(planner_costmap_ros_ != NULL)
delete planner_costmap_ros_;
// Delete the costmap for the controller
if(controller_costmap_ros_ != NULL)
delete controller_costmap_ros_;
// Interrupt the planner thread and wait for it to finish
planner_thread_->interrupt();
planner_thread_->join();
// Delete the planner thread
delete planner_thread_;
// Delete the planner plan
delete planner_plan_;
// Delete the latest plan
delete latest_plan_;
// Delete the controller plan
delete controller_plan_;
// Reset the planner and the trajectory controller
planner_.reset();
tc_.reset();
}