feat: tiep nhan route graph (Voronoi) cho global planner + anytime ARA* schema, don doc EnvMonitor
- navigation_server: them addRouteGraph(topic, RouteGraph), day vao sensor_store cung namespace addStaticMap; consumer (SBPLLatticePlanner) tu doi chieu map_hash. - PlannerRunner: them setSensorReader()/attachSensors() - trao SensorReader cho global planner nao ke thua robot_sensor_ports::SensorConsumer, goi TRUOC initialize() (dynamic_cast, giong co che ControllerRunner dang dung). - sensor_store_params.yaml: khai topic /route_graph (data_type RouteGraph, capacity 1). - sbpl_global_params.yaml (config/runtime): dong bo schema initial_epsilon/final_epsilon/ eps_step/repair_time/return_first_solution + khoi voronoi_corridor (xem pnkx_nav_core c52cbe5, Test/sbpl_lattice_planner cho code doc cac khoa nay). - launch: them arg launch_prefix (vd "stdbuf -oL" - robot::log_* dung printf khong flush, qua `| tee` bi block-buffer 8 KB lam log dung o dong cu du node con chay); them route_graph_maps_dir/route_graph_topic cho amr_node doc file voronoi.json theo map dang kich hoat. - docs: xoa PLAN_LIFECYCLE_CANCEL_PAUSE_RESUME.md (don sang Test/docs/move_base2/), sua duong dan ENV_MONITOR_PLAN.md trong comment cac header EnvMonitor lien quan.
This commit is contained in:
@@ -157,7 +157,7 @@ struct MoveBase2Config
|
||||
/// Lỗi schema của `docking_marker_profiles`, giữ lại để @ref validate chặn boot an toàn.
|
||||
std::string docking_marker_profiles_error;
|
||||
|
||||
// --- EnvMonitor (Test/ENV_MONITOR_PLAN.md) — namespace con `env_monitor` ------------------------
|
||||
// --- EnvMonitor (Test/docs/move_base2/ENV_MONITOR_PLAN.md) — namespace con `env_monitor` ------------------------
|
||||
EnvMonitorConfig env_monitor; ///< lõi quyết định (stall / unreachable / contact / ngân sách).
|
||||
EnvSamplingConfig env_sampling; ///< lấy mẫu ở cổng (nhịp, thân, hình học, quỹ đạo).
|
||||
EnvLoggerConfig env_logger; ///< ghi JSONL cho replay/ML. Tắt mặc định.
|
||||
|
||||
@@ -67,7 +67,7 @@ struct ControlLoopDeps
|
||||
|
||||
|
||||
/**
|
||||
* Nguồn dữ liệu của EnvMonitor (Test/ENV_MONITOR_PLAN.md). **Có thể null** — null thì EnvMonitor tắt
|
||||
* Nguồn dữ liệu của EnvMonitor (Test/docs/move_base2/ENV_MONITOR_PLAN.md). **Có thể null** — null thì EnvMonitor tắt
|
||||
* hoàn toàn, mọi bộ test dùng cổng giả rơi vào nhánh này.
|
||||
*/
|
||||
EnvironmentPort* environment = nullptr;
|
||||
@@ -159,7 +159,7 @@ struct ControlLoopConfig
|
||||
DockingMarkerProfiles docking_marker_profiles;
|
||||
|
||||
|
||||
// --- EnvMonitor (Test/ENV_MONITOR_PLAN.md) — bộ giám sát môi trường duy nhất từ 6/9/2026 ----------
|
||||
// --- 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 ----------
|
||||
EnvMonitorConfig env_monitor;
|
||||
EnvSamplingConfig env_sampling;
|
||||
EnvLoggerConfig env_logger;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
*
|
||||
* Software License Agreement (BSD License)
|
||||
*
|
||||
* move_base2 — lõi quyết định của EnvMonitor (Test/ENV_MONITOR_PLAN.md §2.3, P2).
|
||||
* move_base2 — lõi quyết định của EnvMonitor (Test/docs/move_base2/ENV_MONITOR_PLAN.md §2.3, P2).
|
||||
*
|
||||
* Thuần: không costmap, không TF, không log, không cấp phát sau `configure`. Vào là một @ref EnvSample
|
||||
* mỗi control cycle (feature đã tính ở cổng bằng `grid_analysis`), ra là một @ref EnvVerdict: các cờ
|
||||
@@ -33,7 +33,7 @@ namespace move_base2
|
||||
/**
|
||||
* @struct EnvMonitorConfig
|
||||
* @brief Tham số lõi. Đơn vị trong tên hoặc comment. Mọi ngưỡng số là GIÁ TRỊ KHỞI ĐIỂM rút từ hai bag
|
||||
* sim 5/9/2026 (ENV_MONITOR_PLAN.md §4.4); chốt lại bằng shadow/replay, không bằng tay.
|
||||
* sim 5/9/2026 (Test/docs/move_base2/ENV_MONITOR_PLAN.md §4.4); chốt lại bằng shadow/replay, không bằng tay.
|
||||
*/
|
||||
struct EnvMonitorConfig
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
*
|
||||
* Software License Agreement (BSD License)
|
||||
*
|
||||
* move_base2 — phân tích hình học trên local costmap cho EnvMonitor (Test/ENV_MONITOR_PLAN.md, P1).
|
||||
* move_base2 — phân tích hình học trên local costmap cho EnvMonitor (Test/docs/move_base2/ENV_MONITOR_PLAN.md, P1).
|
||||
*
|
||||
* Hàm thuần trên `robot_costmap_2d::Costmap2D`, không giữ trạng thái ngoài @ref GridScratch (bộ đệm
|
||||
* tái dùng để không cấp phát trong control loop). Không log, không TF, không quyết định gì — người
|
||||
@@ -156,7 +156,7 @@ struct CostToGoParams
|
||||
|
||||
/**
|
||||
* @struct CostToGoResult
|
||||
* @brief Kết quả @ref costToGo — thước đo tiến độ địa trắc (v1 trong ENV_MONITOR_PLAN.md §4.4).
|
||||
* @brief Kết quả @ref costToGo — thước đo tiến độ địa trắc (v1 trong Test/docs/move_base2/ENV_MONITOR_PLAN.md §4.4).
|
||||
*/
|
||||
struct CostToGoResult
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
*
|
||||
* Software License Agreement (BSD License)
|
||||
*
|
||||
* move_base2 — ghi feature + verdict của EnvMonitor ra JSONL (Test/ENV_MONITOR_PLAN.md §2.6).
|
||||
* move_base2 — ghi feature + verdict của EnvMonitor ra JSONL (Test/docs/move_base2/ENV_MONITOR_PLAN.md §2.6).
|
||||
*
|
||||
* Mục đích: replay offline để chỉnh ngưỡng không cần sim, và là dữ liệu huấn luyện ML sau này. Mỗi
|
||||
* dòng là một tick nặng (5 Hz) hoặc một sườn sự kiện. Tắt mặc định; khi tắt không cấp phát, không mở
|
||||
|
||||
@@ -190,6 +190,7 @@ public:
|
||||
std::vector<robot_geometry_msgs::Point> getRobotFootprint() override;
|
||||
|
||||
void addStaticMap(const std::string& topic, robot_nav_msgs::OccupancyGrid map) override;
|
||||
void addRouteGraph(const std::string& topic, robot_sensor_msgs::RouteGraph graph) override;
|
||||
void addLaserScan(const std::string& topic,
|
||||
robot_sensor_msgs::LaserScan laser_scan) override;
|
||||
void addPointCloud(const std::string& topic,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* move_base2 — cổng môi trường cho EnvMonitor: "quanh robot lúc này trông thế nào".
|
||||
*
|
||||
* Kế thừa vai trò của `PathCheckPort` (Test/ENV_MONITOR_PLAN.md §2.5): lõi hỏi, hạ tầng trả lời.
|
||||
* Kế thừa vai trò của `PathCheckPort` (Test/docs/move_base2/ENV_MONITOR_PLAN.md §2.5): lõi hỏi, hạ tầng trả lời.
|
||||
* Cổng lo costmap + TF; toán nằm ở `core/grid_analysis`; quyết định nằm ở `core/env_monitor`. Nhờ vậy
|
||||
* `ControlLoop` kiểm được bằng cổng giả (mặc định = "không kết luận được").
|
||||
*
|
||||
|
||||
@@ -29,6 +29,11 @@
|
||||
#include <move_base2/io/runtime_stats.h>
|
||||
#include <move_base2/ports/planner_port.h>
|
||||
|
||||
namespace robot_sensor_ports
|
||||
{
|
||||
class SensorReader;
|
||||
} // namespace robot_sensor_ports
|
||||
|
||||
namespace robot_costmap_2d
|
||||
{
|
||||
class Costmap2D;
|
||||
@@ -150,6 +155,18 @@ public:
|
||||
*/
|
||||
void attachStatusBoard(ComponentStatusBoard* board);
|
||||
|
||||
/**
|
||||
* @brief Cấp kho cảm biến dùng chung cho global planner nào khai nhận nó (route graph tiêm từ
|
||||
* host là ca đầu tiên). Phải gọi TRƯỚC @ref configure: planner nạp trong configure() và đọc
|
||||
* kho ngay trong initialize(). Planner không kế thừa `robot_sensor_ports::SensorConsumer`
|
||||
* thì không có gì xảy ra — cùng cơ chế `dynamic_cast` với ControllerRunner.
|
||||
* @param reader Non-owning, được phép null. Sống lâu hơn mọi planner instance.
|
||||
*/
|
||||
void setSensorReader(const robot_sensor_ports::SensorReader* reader)
|
||||
{
|
||||
sensors_ = reader;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Tắt việc khoá costmap mutex quanh makePlan — CHỈ dành cho unit test.
|
||||
*
|
||||
@@ -224,6 +241,9 @@ private:
|
||||
/// @brief Nạp @p name nếu chưa có trong cache. @return nullptr khi thất bại (đã log lý do).
|
||||
robot_nav_core::BaseGlobalPlanner* acquire(const std::string& name);
|
||||
|
||||
/// @brief Trao reader cho planner nếu nó là SensorConsumer. Gọi TRƯỚC initialize() của instance.
|
||||
void attachSensors(robot_nav_core::BaseGlobalPlanner* planner) const;
|
||||
|
||||
/// @brief Thân thread: ngủ tới khi có yêu cầu, chạy plugin, đặt kết quả vào hộp thư.
|
||||
void threadBody();
|
||||
|
||||
@@ -238,6 +258,9 @@ private:
|
||||
/// Khoá costmap mutex quanh makePlan. Chỉ unit test với costmap placeholder mới được tắt.
|
||||
bool costmap_lock_enabled_ = true;
|
||||
|
||||
/// Kho cảm biến dùng chung, non-owning, null = không có kho. Đặt qua @ref setSensorReader.
|
||||
const robot_sensor_ports::SensorReader* sensors_ = nullptr;
|
||||
|
||||
/// Telemetry non-owning, null = tắt đo. Chỉ đọc sau khi @ref attachStats.
|
||||
RuntimeStats* stats_ = nullptr;
|
||||
ComponentStatusBoard* status_board_ = nullptr; ///< Non-owning, null = không khai.
|
||||
|
||||
Reference in New Issue
Block a user