Third per-marker key alongside footprint_dock and dock_anchor, so a marker can override which direction the final straight leg into the dock is driven.
574 lines
20 KiB
C++
574 lines
20 KiB
C++
/*********************************************************************
|
|
*
|
|
* Software License Agreement (BSD License)
|
|
*
|
|
* move_base2 — cài đặt PlannerRunner.
|
|
*
|
|
* Author: DuongTD
|
|
*********************************************************************/
|
|
#include <move_base2/runners/planner_runner.h>
|
|
|
|
#include <cmath>
|
|
#include <exception>
|
|
#include <utility>
|
|
|
|
#include <boost/dll/import.hpp>
|
|
#include <boost/system/system_error.hpp>
|
|
#include <boost/thread/locks.hpp>
|
|
|
|
#include <robot/plugin_loader_helper.h>
|
|
#include <robot/robot.h>
|
|
#include <robot_costmap_2d/costmap_2d_robot.h>
|
|
|
|
namespace move_base2
|
|
{
|
|
namespace
|
|
{
|
|
|
|
/// @brief Pose có dùng được để lập plan không — NaN/Inf lọt vào SBPL là hỏng ở tầng khó truy nhất.
|
|
bool isFinitePose(const robot_geometry_msgs::PoseStamped& pose)
|
|
{
|
|
return std::isfinite(pose.pose.position.x) && std::isfinite(pose.pose.position.y) &&
|
|
std::isfinite(pose.pose.orientation.z) && std::isfinite(pose.pose.orientation.w);
|
|
}
|
|
|
|
/// @brief Các khoá được phép chép từ profile marker sang namespace của global planner.
|
|
///
|
|
/// Danh sách đóng, không chép cả cụm: `docking_marker_profiles/<marker>` còn chứa `global_planner`
|
|
/// và `local_planner`, chép sang sẽ đè lên `library_path`-lân cận và tạo ra khoá vô nghĩa trong
|
|
/// namespace planner. Thêm khoá mới ở đây thì thêm cả doc trong `maker_sources.yaml`.
|
|
///
|
|
/// `footprint_dock` chứ không phải `footprint`: đây là kích thước ĐỐI TƯỢNG DOCK, còn `footprint`
|
|
/// trong hệ này luôn có nghĩa là footprint robot (costmap, recovery, collision check). Hai thứ vào
|
|
/// hai công thức khác nhau, trùng tên là mời gọi đặt nhầm giá trị.
|
|
///
|
|
/// `dock_anchor` khai goal pose của marker nằm ở tâm footprint dock (`center`) hay ngay trên mặt
|
|
/// tiếp cận (`face`). `face` thì DockPlanner bỏ qua `footprint_dock` hoàn toàn.
|
|
/// `terminal_direction` chọn chiều chuyển động trên đoạn thẳng cuối: forward/reverse/auto.
|
|
constexpr const char* kMarkerPlannerParams[] = {
|
|
"footprint_dock", "dock_anchor", "terminal_direction"
|
|
};
|
|
|
|
/**
|
|
* @brief Chép MỘT khoá giữa hai namespace của param tree, giữ nguyên kiểu.
|
|
*
|
|
* Cùng ý với `robot_costmap_2d::move_parameter`, khác hai điểm:
|
|
* - dùng `YAML::Node` nên chép được cả cấu trúc lồng (footprint là sequence của sequence), không
|
|
* phải khai sẵn kiểu C++ cho từng khoá;
|
|
* - trả về việc có chép hay không, để bên gọi biết khi nào phải dựng lại instance.
|
|
*
|
|
* @return true nếu khoá tồn tại ở nguồn và đã được ghi sang đích.
|
|
*/
|
|
bool copyParamNode(const robot::NodeHandle& from, robot::NodeHandle& to, const std::string& key)
|
|
{
|
|
if (!from.hasParam(key))
|
|
{
|
|
return false;
|
|
}
|
|
|
|
YAML::Node value;
|
|
if (!from.getParam(key, value) || !value.IsDefined())
|
|
{
|
|
return false;
|
|
}
|
|
|
|
to.setParam(key, value);
|
|
return true;
|
|
}
|
|
|
|
} // namespace
|
|
|
|
PlannerRunner::PlannerRunner() = default;
|
|
|
|
PlannerRunner::~PlannerRunner()
|
|
{
|
|
{
|
|
std::lock_guard<std::mutex> lock(mutex_);
|
|
shutdown_ = true;
|
|
discard_ = true;
|
|
}
|
|
cv_.notify_all();
|
|
|
|
if (thread_.joinable())
|
|
{
|
|
// Chờ có chủ đích: plugin là hộp đen nạp lúc chạy, không có đường cắt ngang một phép tính đang
|
|
// chạy. Detach thay vì join sẽ để thread chạm vào `planning_`/`handoff_` sau khi chúng đã bị
|
|
// huỷ — hỏng ở chỗ không thể truy được.
|
|
thread_.join();
|
|
}
|
|
}
|
|
|
|
void PlannerRunner::attachStats(RuntimeStats* stats)
|
|
{
|
|
stats_ = stats;
|
|
section_make_plan_ = (stats_ != nullptr) ? stats_->section("planner.makePlan")
|
|
: RuntimeStats::kInvalidSection;
|
|
}
|
|
|
|
bool PlannerRunner::configure(const robot::NodeHandle& nh,
|
|
robot_costmap_2d::Costmap2DROBOT* costmap,
|
|
const std::string& initial_planner, std::string& error)
|
|
{
|
|
if (configured_)
|
|
{
|
|
error = "PlannerRunner::configure() called twice";
|
|
return false;
|
|
}
|
|
|
|
if (costmap == nullptr)
|
|
{
|
|
// Không có costmap thì `BaseGlobalPlanner::initialize` nhận nullptr và mọi plugin tự quyết định
|
|
// làm gì với nó — thường là sập. Chặn ở đây, nơi còn nói được lý do.
|
|
error = "PlannerRunner needs a non-null global costmap";
|
|
return false;
|
|
}
|
|
|
|
nh_ = nh;
|
|
costmap_ = costmap;
|
|
configured_ = true;
|
|
|
|
if (!initial_planner.empty() && !swapPlanner(initial_planner))
|
|
{
|
|
error = "could not load the initial global planner '" + initial_planner + "'";
|
|
configured_ = false;
|
|
return false;
|
|
}
|
|
|
|
thread_ = std::thread(&PlannerRunner::threadBody, this);
|
|
return true;
|
|
}
|
|
|
|
// ================================================================================================
|
|
// Nạp plugin — chỉ control thread chạm
|
|
// ================================================================================================
|
|
|
|
robot_nav_core::BaseGlobalPlanner* PlannerRunner::acquire(const std::string& name)
|
|
{
|
|
const auto cached = planners_.find(name);
|
|
if (cached != planners_.end())
|
|
{
|
|
if (!marker_dirty_)
|
|
{
|
|
return cached->second.instance.get();
|
|
}
|
|
|
|
// Marker vừa đổi: instance này đọc footprint của dock trong initialize() và không bao giờ đọc
|
|
// lại. Dựng lại từ factory sẵn có (không dlopen lại). Instance mới chỉ thay chỗ khi
|
|
// initialize() thành công — thất bại thì giữ nguyên cache và trả lỗi để bên gọi từ chối yêu
|
|
// cầu, không để lại trạng thái nửa vời.
|
|
robot_nav_core::BaseGlobalPlanner::Ptr fresh;
|
|
try
|
|
{
|
|
fresh = cached->second.factory();
|
|
if (!fresh)
|
|
{
|
|
robot::log_error("[move_base2] PlannerRunner: factory of '%s' returned nullptr while "
|
|
"rebuilding for the new marker.\n", name.c_str());
|
|
return nullptr;
|
|
}
|
|
if (!fresh->initialize(name, costmap_))
|
|
{
|
|
robot::log_error("[move_base2] PlannerRunner: '%s' reported an initialize() failure while "
|
|
"rebuilding for the new marker.\n", name.c_str());
|
|
return nullptr;
|
|
}
|
|
}
|
|
catch (const std::exception& ex)
|
|
{
|
|
robot::log_error("[move_base2] PlannerRunner: rebuilding '%s' for the new marker failed: %s\n",
|
|
name.c_str(), ex.what());
|
|
return nullptr;
|
|
}
|
|
|
|
// Instance cũ được GIỮ, không huỷ: thread lập plan có thể đang ở trong makePlan() của nó với
|
|
// mutex đã nhả. Xem doc của `Loaded::retired`.
|
|
cached->second.retired.push_back(std::move(cached->second.instance));
|
|
cached->second.instance = std::move(fresh);
|
|
marker_dirty_ = false;
|
|
return cached->second.instance.get();
|
|
}
|
|
|
|
robot::PluginLoaderHelper loader(nh_);
|
|
const std::string library_path = loader.findLibraryPath(name);
|
|
|
|
if (library_path.empty())
|
|
{
|
|
robot::log_error("[move_base2] PlannerRunner: no library found for '%s' — check the key "
|
|
"'%s/library_path' in the YAML and that the .so file exists in devel/lib.\n",
|
|
name.c_str(), name.c_str());
|
|
return nullptr;
|
|
}
|
|
|
|
Loaded loaded;
|
|
|
|
try
|
|
{
|
|
loaded.factory = boost::dll::import_alias<robot_nav_core::BaseGlobalPlanner::Ptr()>(
|
|
library_path, name, boost::dll::load_mode::append_decorations);
|
|
}
|
|
catch (const boost::system::system_error& ex)
|
|
{
|
|
robot::log_error("[move_base2] PlannerRunner: could not load symbol '%s' from '%s': %s\n",
|
|
name.c_str(), library_path.c_str(), ex.what());
|
|
return nullptr;
|
|
}
|
|
catch (const std::exception& ex)
|
|
{
|
|
robot::log_error("[move_base2] PlannerRunner: error while loading '%s': %s\n",
|
|
name.c_str(), ex.what());
|
|
return nullptr;
|
|
}
|
|
|
|
try
|
|
{
|
|
loaded.instance = loaded.factory();
|
|
}
|
|
catch (const std::exception& ex)
|
|
{
|
|
robot::log_error("[move_base2] PlannerRunner: factory of '%s' threw an exception: %s\n",
|
|
name.c_str(), ex.what());
|
|
return nullptr;
|
|
}
|
|
|
|
if (!loaded.instance)
|
|
{
|
|
robot::log_error("[move_base2] PlannerRunner: factory of '%s' returned nullptr.\n",
|
|
name.c_str());
|
|
return nullptr;
|
|
}
|
|
|
|
bool initialized = false;
|
|
try
|
|
{
|
|
initialized = loaded.instance->initialize(name, costmap_);
|
|
}
|
|
catch (const std::exception& ex)
|
|
{
|
|
robot::log_error("[move_base2] PlannerRunner: initialize() of '%s' threw an exception: %s\n",
|
|
name.c_str(), ex.what());
|
|
return nullptr;
|
|
}
|
|
|
|
if (!initialized)
|
|
{
|
|
// Bản cũ chỉ log rồi đi tiếp với một planner chưa khởi tạo. Ở đây coi là thất bại: một planner
|
|
// báo "tôi chưa sẵn sàng" mà vẫn được gọi makePlan là đường dẫn tới hành vi không xác định.
|
|
robot::log_error("[move_base2] PlannerRunner: '%s' reported an initialize() failure.\n",
|
|
name.c_str());
|
|
return nullptr;
|
|
}
|
|
|
|
// Chỉ đưa vào cache khi đã khởi tạo xong — cache một instance hỏng nghĩa là mọi lần thử lại sau
|
|
// đều nhận lại đúng cái hỏng đó mà không báo gì.
|
|
const auto inserted = planners_.emplace(name, std::move(loaded));
|
|
// Instance mới vừa initialize() với param marker hiện hành — marker không còn "chưa được đọc".
|
|
marker_dirty_ = false;
|
|
return inserted.first->second.instance.get();
|
|
}
|
|
|
|
bool PlannerRunner::bindDockingMarker(const std::string& marker, const std::string& planner_name)
|
|
{
|
|
if (!configured_)
|
|
{
|
|
robot::log_error("[move_base2] PlannerRunner: bindDockingMarker() before configure().\n");
|
|
return false;
|
|
}
|
|
|
|
if (marker.empty() || planner_name.empty())
|
|
{
|
|
return true; // Chặng không phải docking, hoặc profile không khai global planner riêng.
|
|
}
|
|
|
|
const std::string profile_ns = "docking_marker_profiles/" + marker;
|
|
if (!nh_.hasParam(profile_ns))
|
|
{
|
|
// Marker hợp lệ nhưng không có profile riêng: cặp planner mặc định, không có gì để chép. Không
|
|
// phải lỗi — `maker_sources` mới là allow-list, bảng profile chỉ là override.
|
|
return true;
|
|
}
|
|
|
|
// Namespace phải được kiểm TRƯỚC khi dựng NodeHandle: `robot::NodeHandle` không báo lỗi khi
|
|
// namespace không resolve được mà lặng lẽ rơi về namespace cha. Bỏ qua bước này thì marker gõ sai
|
|
// sẽ đọc `footprint` ở ROOT — tức footprint ROBOT — rồi dùng nó làm kích thước trạm dock.
|
|
robot::NodeHandle marker_nh(nh_, profile_ns);
|
|
robot::NodeHandle planner_nh(nh_, planner_name);
|
|
if (marker_nh.getNamespace() == nh_.getNamespace() ||
|
|
planner_nh.getNamespace() == nh_.getNamespace())
|
|
{
|
|
robot::log_error("[move_base2] PlannerRunner: namespace '%s' or '%s' does not resolve in the "
|
|
"param tree; refusing to bind marker '%s'.\n",
|
|
profile_ns.c_str(), planner_name.c_str(), marker.c_str());
|
|
return false;
|
|
}
|
|
|
|
bool copied = false;
|
|
for (const char* key : kMarkerPlannerParams)
|
|
{
|
|
copied = copyParamNode(marker_nh, planner_nh, key) || copied;
|
|
}
|
|
|
|
if (!copied)
|
|
{
|
|
return true; // Profile có tồn tại nhưng không khai khoá nào của planner — giữ nguyên cấu hình.
|
|
}
|
|
|
|
// Dựng lại instance CHỈ khi marker nối vào planner này thực sự đổi. Dock lại đúng marker cũ thì
|
|
// param tree không đổi, initialize() lại cũng ra đúng ngần ấy — đánh dấu dirty vô điều kiện là mỗi
|
|
// chặng docking một lần initialize() thừa. Bảng theo TỪNG planner vì hai marker có thể trỏ về hai
|
|
// planner khác nhau và không được xoá dấu của nhau.
|
|
const auto bound = bound_marker_.find(planner_name);
|
|
if (bound == bound_marker_.end() || bound->second != marker)
|
|
{
|
|
bound_marker_[planner_name] = marker;
|
|
marker_dirty_ = true;
|
|
robot::log_info("[move_base2] PlannerRunner: bound marker '%s' params into '%s'.\n",
|
|
marker.c_str(), planner_name.c_str());
|
|
}
|
|
return true;
|
|
}
|
|
|
|
bool PlannerRunner::swapPlanner(const std::string& planner_name)
|
|
{
|
|
if (!configured_)
|
|
{
|
|
robot::log_error("[move_base2] PlannerRunner: swapPlanner() before configure().\n");
|
|
return false;
|
|
}
|
|
|
|
if (planner_name.empty())
|
|
{
|
|
robot::log_error("[move_base2] PlannerRunner: empty planner name.\n");
|
|
return false;
|
|
}
|
|
|
|
if (planner_name == active_name_ && !marker_dirty_)
|
|
{
|
|
std::lock_guard<std::mutex> lock(mutex_);
|
|
if (active_ != nullptr)
|
|
{
|
|
return true; // Đã đúng planner; không log để khỏi spam ở cửa vào mỗi yêu cầu.
|
|
}
|
|
}
|
|
// Marker vừa đổi thì KHÔNG được đi tắt kể cả khi tên planner không đổi: phải rơi xuống acquire()
|
|
// để instance được dựng lại và initialize() đọc footprint mới.
|
|
|
|
robot_nav_core::BaseGlobalPlanner* planner = acquire(planner_name);
|
|
if (planner == nullptr)
|
|
{
|
|
// Giữ nguyên planner đang chạy. Bên gọi từ chối yêu cầu dựa vào giá trị trả về; chuyển sang
|
|
// trạng thái "không có planner" ở đây sẽ làm hỏng luôn cả yêu cầu đang chạy dở.
|
|
return false;
|
|
}
|
|
|
|
{
|
|
std::lock_guard<std::mutex> lock(mutex_);
|
|
// Lượt đang chạy thuộc về planner cũ — kết quả của nó không còn nghĩa. Không cắt ngang được
|
|
// phép tính, chỉ đánh dấu vứt kết quả. Con trỏ planner cũ vẫn hợp lệ vì cache không xoá entry.
|
|
if (running_ || pending_)
|
|
{
|
|
discard_ = true;
|
|
}
|
|
active_ = planner;
|
|
}
|
|
|
|
active_name_ = planner_name;
|
|
robot::log_info("[move_base2] PlannerRunner: active global planner is '%s'.\n",
|
|
planner_name.c_str());
|
|
return true;
|
|
}
|
|
|
|
std::string PlannerRunner::activePlanner() const
|
|
{
|
|
std::lock_guard<std::mutex> lock(mutex_);
|
|
return active_ != nullptr ? active_name_ : std::string();
|
|
}
|
|
|
|
// ================================================================================================
|
|
// Vòng đời một lượt lập plan
|
|
// ================================================================================================
|
|
|
|
bool PlannerRunner::startPlan(const robot_geometry_msgs::PoseStamped& start,
|
|
const robot_geometry_msgs::PoseStamped& goal,
|
|
const robot_protocol_msgs::Order* order, std::uint64_t tag)
|
|
{
|
|
if (!configured_)
|
|
{
|
|
robot::log_error_throttle(5.0, "[move_base2] PlannerRunner: startPlan() before configure().\n");
|
|
return false;
|
|
}
|
|
|
|
if (!isFinitePose(start) || !isFinitePose(goal))
|
|
{
|
|
robot::log_error_throttle(5.0, "[move_base2] PlannerRunner: start or goal contains NaN/Inf, "
|
|
"not starting a planning attempt.\n");
|
|
return false;
|
|
}
|
|
|
|
std::lock_guard<std::mutex> lock(mutex_);
|
|
|
|
if (active_ == nullptr)
|
|
{
|
|
robot::log_error_throttle(5.0, "[move_base2] PlannerRunner: startPlan() with no planner "
|
|
"loaded.\n");
|
|
return false;
|
|
}
|
|
|
|
if (pending_ || running_)
|
|
{
|
|
return false; // Đã có lượt đang chạy; bên gọi phải chờ hoặc huỷ trước.
|
|
}
|
|
|
|
request_start_ = start;
|
|
request_goal_ = goal;
|
|
// Sao chép Order: con trỏ chỉ hợp lệ trong lời gọi này, còn lượt lập plan sống lâu hơn thế.
|
|
request_order_ = (order != nullptr) ? std::make_shared<robot_protocol_msgs::Order>(*order)
|
|
: nullptr;
|
|
request_tag_ = tag;
|
|
|
|
pending_ = true;
|
|
discard_ = false;
|
|
has_result_ = false;
|
|
|
|
cv_.notify_one();
|
|
return true;
|
|
}
|
|
|
|
bool PlannerRunner::isPlanning() const
|
|
{
|
|
std::lock_guard<std::mutex> lock(mutex_);
|
|
return pending_ || running_;
|
|
}
|
|
|
|
bool PlannerRunner::pollPlan(PlanResult& result)
|
|
{
|
|
std::lock_guard<std::mutex> lock(mutex_);
|
|
|
|
if (!has_result_)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
has_result_ = false;
|
|
result.tag = result_tag_;
|
|
result.succeeded = result_ok_;
|
|
|
|
// Hoán vị chứ không copy: vector cũ của bên gọi quay lại làm hộp thư và giữ nguyên capacity, nên
|
|
// ở trạng thái ổn định không có lần cấp phát nào cho việc bàn giao plan.
|
|
result.plan.swap(handoff_);
|
|
handoff_.clear();
|
|
return true;
|
|
}
|
|
|
|
void PlannerRunner::cancelPlan()
|
|
{
|
|
std::lock_guard<std::mutex> lock(mutex_);
|
|
if (pending_ || running_)
|
|
{
|
|
discard_ = true;
|
|
}
|
|
// Kết quả đã nằm sẵn trong hộp thư cũng bỏ luôn: bên gọi vừa nói nó không còn cần plan này.
|
|
has_result_ = false;
|
|
handoff_.clear();
|
|
}
|
|
|
|
// ================================================================================================
|
|
// Thread planner
|
|
// ================================================================================================
|
|
|
|
void PlannerRunner::threadBody()
|
|
{
|
|
if (stats_ != nullptr)
|
|
{
|
|
// Phải đăng ký TỪ chính thread này: nhãn được gắn theo tid của thread đang chạy.
|
|
stats_->registerCurrentThread("move_base2/planner");
|
|
}
|
|
|
|
std::unique_lock<std::mutex> lock(mutex_);
|
|
|
|
while (true)
|
|
{
|
|
cv_.wait(lock, [this] { return shutdown_ || pending_; });
|
|
|
|
if (shutdown_)
|
|
{
|
|
return;
|
|
}
|
|
|
|
// Chụp lại yêu cầu rồi NHẢ MUTEX trước khi gọi plugin. Đây là điểm mấu chốt của cả mô hình:
|
|
// control thread không bao giờ phải chờ một lượt lập plan.
|
|
robot_nav_core::BaseGlobalPlanner* planner = active_;
|
|
const robot_geometry_msgs::PoseStamped start = request_start_;
|
|
const robot_geometry_msgs::PoseStamped goal = request_goal_;
|
|
const std::shared_ptr<robot_protocol_msgs::Order> order = request_order_;
|
|
const std::uint64_t tag = request_tag_;
|
|
|
|
pending_ = false;
|
|
running_ = true;
|
|
|
|
lock.unlock();
|
|
|
|
planning_.clear();
|
|
bool ok = false;
|
|
|
|
try
|
|
{
|
|
ScopedSection timer(stats_, section_make_plan_);
|
|
// Khoá lưới costmap suốt makePlan — cùng giao thức với gen-1 (move_base.cpp:1921,1959):
|
|
// LayeredCostmap::updateMap ghi lưới, và resizeMap REALLOC cả mảng, dưới đúng mutex này.
|
|
// Không khoá thì planner đọc cost đang bị ghi dở, hoặc tệ hơn là đọc vào vùng nhớ vừa bị
|
|
// resize giải phóng khi static map được nhận lại. Lấy getCostmap() mỗi lượt, không cache —
|
|
// con trỏ đó có thể bị thay (bài học double-free của workspace).
|
|
boost::unique_lock<robot_costmap_2d::Costmap2D::mutex_t> costmap_lock;
|
|
if (costmap_lock_enabled_)
|
|
{
|
|
costmap_lock = boost::unique_lock<robot_costmap_2d::Costmap2D::mutex_t>(
|
|
*(costmap_->getCostmap()->getMutex()));
|
|
}
|
|
// Hai overload của interface gốc gộp lại: "có Order hay không" là một nhánh, không phải hai
|
|
// contract. Plugin nào không hiểu Order thì overload mặc định của nó tự lo.
|
|
ok = (order != nullptr) ? planner->makePlan(*order, start, goal, planning_)
|
|
: planner->makePlan(start, goal, planning_);
|
|
}
|
|
catch (const std::exception& ex)
|
|
{
|
|
// Plugin bên thứ ba ném ra thì đây là biên duy nhất chặn được — exception thoát khỏi thân
|
|
// thread là std::terminate, tức mất cả tiến trình navigation vì một lượt lập plan hỏng.
|
|
robot::log_error_throttle(5.0, "[move_base2] PlannerRunner: plugin threw an exception while "
|
|
"making a plan: %s\n", ex.what());
|
|
ok = false;
|
|
}
|
|
catch (...)
|
|
{
|
|
robot::log_error_throttle(5.0, "[move_base2] PlannerRunner: plugin threw an unknown "
|
|
"exception while making a plan.\n");
|
|
ok = false;
|
|
}
|
|
|
|
if (!ok || planning_.empty())
|
|
{
|
|
// Contract của PlannerPort: thành công nghĩa là plan KHÔNG rỗng. Một số plugin trả true kèm
|
|
// vector rỗng; quy về thất bại ngay tại đây để tầng trên không gọi front()/back() trên nó.
|
|
planning_.clear();
|
|
ok = false;
|
|
}
|
|
|
|
lock.lock();
|
|
running_ = false;
|
|
|
|
if (discard_)
|
|
{
|
|
// Lượt này đã bị huỷ hoặc planner đã bị đổi giữa chừng. Vứt lặng lẽ — không phải lỗi.
|
|
discard_ = false;
|
|
planning_.clear();
|
|
continue;
|
|
}
|
|
|
|
planning_.swap(handoff_);
|
|
result_tag_ = tag;
|
|
result_ok_ = ok;
|
|
has_result_ = true;
|
|
}
|
|
}
|
|
|
|
} // namespace move_base2
|