Revert "feat: tiep nhan route graph (Voronoi) cho global planner + anytime ARA* schema, don doc EnvMonitor"
This reverts commit f4f99650df.
This commit is contained in:
@@ -241,7 +241,7 @@ bool ControlLoop::configure(const ControlLoopConfig& config, const ControlLoopDe
|
||||
deps_ = deps;
|
||||
|
||||
|
||||
// EnvMonitor (Test/docs/move_base2/ENV_MONITOR_PLAN.md) — bộ giám sát môi trường duy nhất từ 6/9/2026 (PathMonitor cũ đã
|
||||
// EnvMonitor (Test/ENV_MONITOR_PLAN.md) — bộ giám sát môi trường duy nhất từ 6/9/2026 (PathMonitor cũ đã
|
||||
// xoá). Không có cổng thì tắt, nhưng phải kêu nếu config bảo bật.
|
||||
env_logger_.reset();
|
||||
if (config_.env_monitor.enabled)
|
||||
@@ -1045,7 +1045,7 @@ bool ControlLoop::step()
|
||||
}
|
||||
}
|
||||
input.travelled_since_oscillation_reset = travelled;
|
||||
// Bốn cổng của state machine do EnvMonitor cấp (Test/docs/move_base2/ENV_MONITOR_PLAN.md): cờ chỉ khác false khi
|
||||
// Bốn cổng của state machine do EnvMonitor cấp (Test/ENV_MONITOR_PLAN.md): cờ chỉ khác false khi
|
||||
// verdict tương ứng có `action: recover`. `off_path` không còn nguồn nào (phép đo cũ đã bỏ 6/9/2026).
|
||||
input.path_blocked = env_verdict_.path_blocked;
|
||||
input.collision = env_verdict_.collision;
|
||||
|
||||
@@ -427,7 +427,6 @@ bool NavigationRuntime::buildRunners(std::string& error)
|
||||
// Trước configure(): planner nạp trong configure() và có thể muốn đọc cảm biến ngay trong
|
||||
// initialize() của nó.
|
||||
controller_.setSensorReader(sensors_);
|
||||
planner_.setSensorReader(sensors_);
|
||||
|
||||
if (!planner_.configure(root_nh, global_costmap_.get(), config_.position.global_planner_name,
|
||||
error))
|
||||
|
||||
@@ -697,31 +697,6 @@ void NavigationServer::addStaticMap(const std::string& topic, robot_nav_msgs::Oc
|
||||
sensors_.pushStaticMap(topic, map);
|
||||
}
|
||||
|
||||
void NavigationServer::addRouteGraph(const std::string& topic, robot_sensor_msgs::RouteGraph graph)
|
||||
{
|
||||
// Kho chỉ, không costmap: graph là thứ planner ĐỌC KHI CẦN (đầu initialize()/makePlan), không phải
|
||||
// dữ liệu costmap ghép vào layer nào. Bản trước ở kho bị thay, đúng ngữ nghĩa "map mới thì graph
|
||||
// mới". Không giữ dưới data_mutex_ vì không getter nào trả nó ra host.
|
||||
const std::size_t nodes = graph.node_x.size();
|
||||
const std::size_t edges = graph.edge_u.size();
|
||||
const std::size_t cells = graph.cell_x.size();
|
||||
const robot::Time stamp = graph.header.stamp.isZero() ? robot::Time::now() : graph.header.stamp;
|
||||
if (!robot_sensor_ports::put(sensor_store_, topic, graph, stamp))
|
||||
{
|
||||
// put() đã log lý do một lần theo topic (chưa khai trong sensor_store_params.yaml hoặc sai kiểu).
|
||||
// Nhắc thêm ở đây vì triệu chứng phía planner chỉ là "không thấy graph" — giống hệt host quên gửi.
|
||||
robot::log_error("[move_base2] addRouteGraph('%s') rejected by the sensor store — declare the "
|
||||
"topic with data_type RouteGraph in sensor_store_params.yaml (graph %zu nodes, "
|
||||
"%zu edges dropped).\n",
|
||||
topic.c_str(), nodes, edges);
|
||||
return;
|
||||
}
|
||||
robot::log_info("[move_base2] addRouteGraph('%s'): %ux%u @ %.3f m, %zu nodes, %zu edges, %zu "
|
||||
"cells, hash %016llx, source '%s'.\n",
|
||||
topic.c_str(), graph.width, graph.height, graph.resolution, nodes, edges, cells,
|
||||
static_cast<unsigned long long>(graph.map_hash), graph.source.c_str());
|
||||
}
|
||||
|
||||
void NavigationServer::addLaserScan(const std::string& topic,
|
||||
robot_sensor_msgs::LaserScan laser_scan)
|
||||
{
|
||||
|
||||
@@ -19,8 +19,6 @@
|
||||
#include <robot/plugin_loader_helper.h>
|
||||
#include <robot/robot.h>
|
||||
#include <robot_costmap_2d/costmap_2d_robot.h>
|
||||
#include <robot_sensor_ports/sensor_consumer.h>
|
||||
#include <robot_sensor_ports/sensor_reader.h>
|
||||
|
||||
namespace move_base2
|
||||
{
|
||||
@@ -154,24 +152,6 @@ bool PlannerRunner::configure(const robot::NodeHandle& nh,
|
||||
// Nạp plugin — chỉ control thread chạm
|
||||
// ================================================================================================
|
||||
|
||||
void PlannerRunner::attachSensors(robot_nav_core::BaseGlobalPlanner* planner) const
|
||||
{
|
||||
if (planner == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
auto* consumer = dynamic_cast<robot_sensor_ports::SensorConsumer*>(planner);
|
||||
if (consumer == nullptr)
|
||||
{
|
||||
return; // Planner không khai nhận kho. Đúng với phần lớn planner, không phải lỗi.
|
||||
}
|
||||
consumer->setSensorReader(sensors_);
|
||||
// Log vì cast qua ranh giới `.so` phụ thuộc RTTI khớp giữa hai bên, và build xanh không nói gì về
|
||||
// chuyện đó. Một planner khai kế thừa mà không bao giờ thấy dòng này nghĩa là RTTI lệch.
|
||||
robot::log_info("[move_base2] PlannerRunner: global planner accepts the shared sensor store (%s).\n",
|
||||
sensors_ != nullptr ? "store attached" : "no store configured");
|
||||
}
|
||||
|
||||
robot_nav_core::BaseGlobalPlanner* PlannerRunner::acquire(const std::string& name)
|
||||
{
|
||||
const auto cached = planners_.find(name);
|
||||
@@ -196,7 +176,6 @@ robot_nav_core::BaseGlobalPlanner* PlannerRunner::acquire(const std::string& nam
|
||||
"rebuilding for the new marker.\n", name.c_str());
|
||||
return nullptr;
|
||||
}
|
||||
attachSensors(fresh.get());
|
||||
if (!fresh->initialize(name, costmap_))
|
||||
{
|
||||
robot::log_error("[move_base2] PlannerRunner: '%s' reported an initialize() failure while "
|
||||
@@ -293,8 +272,6 @@ robot_nav_core::BaseGlobalPlanner* PlannerRunner::acquire(const std::string& nam
|
||||
bool initialized = false;
|
||||
try
|
||||
{
|
||||
// Reader TRƯỚC initialize(): consumer đọc kho ngay trong initialize() (graph tiêm cùng lúc với map).
|
||||
attachSensors(loaded.instance.get());
|
||||
initialized = loaded.instance->initialize(name, costmap_);
|
||||
}
|
||||
catch (const std::exception& ex)
|
||||
|
||||
Reference in New Issue
Block a user