Skip to content

refactor(自动生态农场):分离通用和地区专用节点,功能优化#1763

Merged
MistEO merged 4 commits intov2from
refactor/AutoEcoFarm-Regioninits
Mar 31, 2026
Merged

refactor(自动生态农场):分离通用和地区专用节点,功能优化#1763
MistEO merged 4 commits intov2from
refactor/AutoEcoFarm-Regioninits

Conversation

@jwtggg
Copy link
Copy Markdown
Contributor

@jwtggg jwtggg commented Mar 30, 2026

代码重构:
重构任务,将通用节点和地区专用节点分离,并用一个json来配置专用节点,以便后续增加新农场

功能优化:
1、减少将视角拉近标记时y轴的拉近率,防止拉过头
2、给缩放地图增加缩放到最大的判定,如果缩放到最大还没找到农田,则默认没种田直接去下个地区

Summary by Sourcery

重构 AutoEcoFarm 流水线,将通用节点与区域特定节点分离,并改进自动农田检测和导航行为。

新功能:

  • 为不同的 AutoEcoFarm 区域添加区域特定的初始化流水线,作为独立的锚点节点。
  • 引入可在各区域复用的通用“前往农田”导航流水线。

改进:

  • 将 AutoEcoFarm 流水线资源重组为“通用”和“区域特定”两个文件夹,便于将来扩展新的农场。
  • 调整标记近景视图时的摄像机拉近行为,避免拉近过头超过目标。
  • 添加地图最大缩放检查:如果在完全放大时仍未找到农田,工作流将跳过当前区域,进入下一个区域。
Original summary in English

Summary by Sourcery

Refactor the AutoEcoFarm pipelines to separate common and region-specific nodes and improve the automated farmland detection and navigation behavior.

New Features:

  • Add region-specific initialization pipelines for different AutoEcoFarm areas as dedicated anchor nodes.
  • Introduce a shared pipeline for navigating to farmland that can be reused across regions.

Enhancements:

  • Restructure AutoEcoFarm pipeline assets into common and region-specific folders for easier extension with new farms.
  • Adjust camera zoom-in behavior when marking closer view to avoid over-zooming past the target.
  • Add a maximum map zoom check so that if no farmland is found at full zoom the workflow skips to the next region.

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗨——我已经查看了你的修改,看起来非常棒!


Sourcery 对开源项目是免费的——如果你喜欢我们的评审,请考虑分享 ✨
帮我变得更有用!请在每条评论上点 👍 或 👎,我会根据你的反馈来改进之后的评审。
Original comment in English

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

本 PR 对自动生态农场(AutoEcoFarm)流水线进行重构与行为优化:将通用节点与地区专用节点解耦,并通过地区初始化节点(Anchor 配置)实现复用;同时优化标记拉近策略与“地图已最大缩放仍找不到农田”的跳过逻辑。

Changes:

  • 将 AutoEcoFarm 地区入口重构为“地区 Init 文件 + Anchor 映射”,通用逻辑下沉到 CommonNodes。
  • 优化拉近标记的计算参数(降低 y 方向拉近比例),并引入“缩放到最大仍未找到农田则跳过当前地区”的判定。
  • 新增若干通用子流程(任务前准备/任务后收尾/移动并工作/拍照模式处理等)并重组资源结构。

Reviewed changes

Copilot reviewed 8 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
assets/tasks/AutoEcoFarm.json 更新任务选项对新地区入口节点的开关控制(对应新的 InitStart 节点名)。
assets/resource/pipeline/AutoEcoFarm.json 主入口 next 链路切换到新的地区 InitStart 节点。
assets/resource/pipeline/AutoEcoFarm/RegionNodes/AutoEcoFarmInitValleyIV.json 新增 ValleyIV 地区初始化与 Anchor 映射(传送/寻路/OCR/循环控制)。
assets/resource/pipeline/AutoEcoFarm/RegionNodes/AutoEcoFarmInitWulin.json 新增 Wulin 地区初始化与 Anchor 映射(传送/寻路/OCR/循环控制)。
assets/resource/pipeline/AutoEcoFarm/CommonNodes/AutoEcoFarmGotoFarm.json 新增“前往农田”通用流程(通过 Anchor 调用地区专用传送/寻路)。
assets/resource/pipeline/AutoEcoFarm/CommonNodes/AutoEcoFarmFindFarmland.json 通用化地图找田逻辑,并加入“最大缩放仍无农田则跳过地区”的判定与模板。
assets/resource/pipeline/AutoEcoFarm/CommonNodes/AutoEcoFarmSwipeToTarget.json 移除地区专用入口/循环节点,改为 Anchor 驱动循环;调整 yStepRatio。
assets/resource/pipeline/AutoEcoFarm/CommonNodes/AutoEcoFarmMoveAndWork.json 新增靠近目标并识别菜单执行收获/育苗/浇水,以及拍照模式相关流程衔接。
assets/resource/pipeline/AutoEcoFarm/CommonNodes/AutoEcoFarmPhotoMode.json 新增进入/退出拍照模式、关闭工业设备显示等节点。
assets/resource/pipeline/AutoEcoFarm/CommonNodes/AutoEcoFarmPrepare.json 新增任务开始前准备子流程(含清背包入口)。
assets/resource/pipeline/AutoEcoFarm/CommonNodes/AutoEcoFarmEnd.json 新增任务结束后收尾子流程(复用清背包)。
assets/resource/pipeline/AutoEcoFarm/CommonNodes/AutoEcoFarmCommon.json 新增通用工具/异常处理/清背包/JumpBack 等节点集合。
assets/resource/pipeline/AutoEcoFarm/AutoEcoFarmGotoFarm.json 删除旧版“按地区写死”的前往农场文件(迁移到 CommonNodes + RegionNodes)。
assets/resource/image/AutoEcoFarm/AutoEcoFarmPlusGrey.png 新增地图缩放“加号变灰”模板,用于最大缩放判定。
Comments suppressed due to low confidence (1)

assets/resource/pipeline/AutoEcoFarm/CommonNodes/AutoEcoFarmSwipeToTarget.json:183

  • _AutoEcoFarmCheckTarget 设置了 max_hit: 20,但循环次数已经由地区侧的 _AutoEcoFarmSwipeLoop* 节点(max_hit: 20)控制。这里再加 max_hit 会导致该节点在 20 次后被全局跳过,后续循环将无法继续检查逻辑。建议移除这里的 max_hit(或仅由 Loop 节点限次)。

Comment on lines 47 to 50
"pipeline_override": {
"_AutoEcoFarmGotoValleyIVEcoFarmStart": {
"_AutoEcoFarmInitStartValleyIV": {
"enable": true
}
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pipeline_override 里用的是 "enable" 字段,但仓库其它 task(如 assets/tasks/AutoCollect.json)及文档用的是 "enabled"。如果保持 "enable",该开关很可能无法真正覆盖 pipeline 节点的 enabled 状态。建议改为 "enabled": true,并同步检查本文件其它 override 是否也误用了 "enable"。

Copilot uses AI. Check for mistakes.
Comment on lines 54 to 58
"name": "No",
"pipeline_override": {
"_AutoEcoFarmGotoValleyIVEcoFarmStart": {
"_AutoEcoFarmInitStartValleyIV": {
"enable": false
}
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里同样使用了 "enable": false(而非常见的 "enabled": false)。这会导致选择 "No" 时可能无法禁用 _AutoEcoFarmInitStartValleyIV,进而无法跳过该地区。建议统一改为 "enabled"(并顺带检查本文件其它开关是否也用了 "enable")。

Copilot uses AI. Check for mistakes.
Comment on lines 69 to 73
"name": "Yes",
"pipeline_override": {
"_AutoEcoFarmGotoWulinEcoFarmStart": {
"_AutoEcoFarmInitStartWulin": {
"enable": true
}
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GotoWulin 的 pipeline_override 同样使用了 "enable" 字段,可能不会覆盖 pipeline 节点的 enabled 属性,导致该开关无效。建议改为 "enabled": true,并同步检查本文件其它 override。

Copilot uses AI. Check for mistakes.
Comment on lines 77 to 81
"name": "No",
"pipeline_override": {
"_AutoEcoFarmGotoWulinEcoFarmStart": {
"_AutoEcoFarmInitStartWulin": {
"enable": false
}
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里用的是 "enable": false(而不是常用的 "enabled": false)。如果覆盖字段写错,关闭武陵入口的开关将不会生效。建议改为 "enabled" 并统一整份文件的 override 字段名。

Copilot uses AI. Check for mistakes.
@ocsin1
Copy link
Copy Markdown
Contributor

ocsin1 commented Mar 31, 2026

约定式提交不让用Refactor&Fix这种吧,changelog 会炸

@ocsin1 ocsin1 changed the title Refactor&Fix(自动生态农场):分离通用和地区专用节点,功能优化 refactor(自动生态农场):分离通用和地区专用节点,功能优化 Mar 31, 2026
@MistEO MistEO merged commit bbb51dd into v2 Mar 31, 2026
22 checks passed
@MistEO MistEO deleted the refactor/AutoEcoFarm-Regioninits branch March 31, 2026 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants