refactor: xoá PathMonitor và PathCheckPort, EnvMonitor là bộ giám sát duy nhất; gộp refreshSnapshot
Xoá hạ tầng giám sát cũ đã tắt từ 5/9 (path_monitor/enabled: false), −2947 dòng: - ControlLoop: PathMonitorConfig, updatePathMonitor / updateProgressMonitor / applyCollisionGuard / planIsBlocked / resetPathMonitor / rebuildPlanArcLength, toàn bộ member bốn phép đo, luật "plan mới bẩn thì giữ plan cũ" trong collectPlannerResult. Bốn cổng StateMachineInput giữ nguyên (off_path không còn nguồn, đặt false). - ports/path_check_port.h, CostmapPathCheck trong NavigationRuntime. - plan_inspector: bỏ checkPlan / checkMotion / PlanBlockResult / MotionCheckParams / MotionBlockResult; giữ planarTransform, nearestIndex, trackedNearestIndex, crossTrackError. - Config: readPathMonitor, MoveBase2Config::path_monitor, validate; xoá config/runtime/path_monitor_params.yaml; comment YAML/state_machine đổi sang tên verdict EnvMonitor. - Test: FakePathCheckPort, 30 test WalkingSkeletonPathMonitor/CollisionGuard, 13 test PlanInspectorCheck/Motion, 2 test validate thân guard. P0(b): ControlLoop::step() gọi EnvironmentPort::refresh() một lần đầu cycle (không phụ thuộc env_monitor/enabled); ControllerRunner::setSnapshotRefreshedByLoop(true) làm ba refreshSnapshot() trong runner thành no-op — monitor và controller đọc cùng một lưới, một bản copy mỗi cycle. Test: env_monitor 43, grid_analysis 33, plan_inspector 11, walking_skeleton 57, config_validation 32, scenario 12, state_machine 100, navigation_server 56, controller_runner 28, velocity_arbiter 29, planner_runner 31 — pass. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xXjFjr2DQ6rhmhHSW4fk4
This commit is contained in:
@@ -366,7 +366,12 @@ bool ControllerRunner::setPlan(const std::vector<robot_geometry_msgs::PoseStampe
|
||||
if (costmap_lock_enabled_)
|
||||
{
|
||||
if (costmap_->isSnapshotEnabled())
|
||||
costmap_->refreshSnapshot();
|
||||
{
|
||||
if (!snapshot_refreshed_by_loop_)
|
||||
{
|
||||
costmap_->refreshSnapshot();
|
||||
}
|
||||
}
|
||||
else
|
||||
costmap_lock = boost::unique_lock<robot_costmap_2d::Costmap2D::mutex_t>(
|
||||
*(costmap_->getCostmap()->getMutex()));
|
||||
@@ -526,7 +531,12 @@ bool ControllerRunner::computeVelocityCommands(robot_geometry_msgs::Twist& cmd)
|
||||
if (costmap_lock_enabled_)
|
||||
{
|
||||
if (costmap_->isSnapshotEnabled())
|
||||
costmap_->refreshSnapshot();
|
||||
{
|
||||
if (!snapshot_refreshed_by_loop_)
|
||||
{
|
||||
costmap_->refreshSnapshot();
|
||||
}
|
||||
}
|
||||
else
|
||||
costmap_lock = boost::unique_lock<robot_costmap_2d::Costmap2D::mutex_t>(
|
||||
*(costmap_->getCostmap()->getMutex()));
|
||||
@@ -585,7 +595,12 @@ bool ControllerRunner::isGoalReached()
|
||||
if (costmap_lock_enabled_)
|
||||
{
|
||||
if (costmap_->isSnapshotEnabled())
|
||||
costmap_->refreshSnapshot();
|
||||
{
|
||||
if (!snapshot_refreshed_by_loop_)
|
||||
{
|
||||
costmap_->refreshSnapshot();
|
||||
}
|
||||
}
|
||||
else
|
||||
costmap_lock = boost::unique_lock<robot_costmap_2d::Costmap2D::mutex_t>(
|
||||
*(costmap_->getCostmap()->getMutex()));
|
||||
|
||||
Reference in New Issue
Block a user