@ray-js/robot-map-sdk 0.0.17-beta.2 → 0.0.17-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/mcp-server.js +31 -15
- package/dist/constant/methods.js +1 -1
- package/dist/index.d.ts +80 -25
- package/dist/index.rjs.js +1 -1
- package/dist-app/assets/index-BVLfQBTu.js +1 -0
- package/dist-app/index.html +1 -1
- package/dist-docs/404.html +2 -2
- package/dist-docs/assets/{app.BKcB-q3l.js → app.C3BeeaYd.js} +1 -1
- package/dist-docs/assets/chunks/@localSearchIndexroot.BMKcHG_i.js +1 -0
- package/dist-docs/assets/chunks/{BitmapFont.BVQlrRID.js → BitmapFont.BQzmxL0v.js} +1 -1
- package/dist-docs/assets/chunks/{BufferResource.ccuOZM7p.js → BufferResource.CNdzQT3n.js} +1 -1
- package/dist-docs/assets/chunks/{CanvasRenderer.BjafRf72.js → CanvasRenderer.BfEovjEl.js} +1 -1
- package/dist-docs/assets/chunks/{RenderTargetSystem.CNtSJQIT.js → RenderTargetSystem.BsnW3px2.js} +1 -1
- package/dist-docs/assets/chunks/{VPLocalSearchBox.BraJ5EBN.js → VPLocalSearchBox.BV6OAhiI.js} +1 -1
- package/dist-docs/assets/chunks/{WebGLRenderer.IUUQ0Lkd.js → WebGLRenderer.BziWi5pK.js} +1 -1
- package/dist-docs/assets/chunks/{WebGPURenderer.CLtb2XY4.js → WebGPURenderer.bELKl5QM.js} +1 -1
- package/dist-docs/assets/chunks/{browserAll.BeYySQdg.js → browserAll.Cbwmm72I.js} +1 -1
- package/dist-docs/assets/chunks/index.CsLbOa5r.js +744 -0
- package/dist-docs/assets/chunks/theme.BItp-bTH.js +4 -0
- package/dist-docs/assets/chunks/{webworkerAll.Dyo1xVCt.js → webworkerAll.BqQ8oBVT.js} +1 -1
- package/dist-docs/assets/{guide_advanced-usage.md.dxD8u9v3.js → guide_advanced-usage.md.BsGRhEuG.js} +12 -9
- package/dist-docs/assets/{guide_advanced-usage.md.dxD8u9v3.lean.js → guide_advanced-usage.md.BsGRhEuG.lean.js} +1 -1
- package/dist-docs/assets/{guide_getting-started.md.ItwGZAsG.js → guide_getting-started.md.DQIIL6ql.js} +1 -1
- package/dist-docs/assets/guide_mcp.md.BYlNOxMG.js +1 -0
- package/dist-docs/assets/{guide_mcp.md.CabCiX8Z.lean.js → guide_mcp.md.BYlNOxMG.lean.js} +1 -1
- package/dist-docs/assets/{reference_config.md.CXZBV81d.js → reference_config.md.BslTlkKM.js} +4 -4
- package/dist-docs/assets/{reference_config.md.CXZBV81d.lean.js → reference_config.md.BslTlkKM.lean.js} +1 -1
- package/dist-docs/assets/{reference_data.md.DL6rfzez.js → reference_data.md.jnSR7326.js} +8 -7
- package/dist-docs/assets/{reference_data.md.DL6rfzez.lean.js → reference_data.md.jnSR7326.lean.js} +1 -1
- package/dist-docs/assets/{reference_methods.md.yWEfqPKf.js → reference_methods.md.Cv8q9vtz.js} +8 -3
- package/dist-docs/assets/{reference_methods.md.yWEfqPKf.lean.js → reference_methods.md.Cv8q9vtz.lean.js} +1 -1
- package/dist-docs/assets/reference_runtime.md.BFQ83m1B.js +20 -0
- package/dist-docs/assets/reference_runtime.md.BFQ83m1B.lean.js +1 -0
- package/dist-docs/assets/{reference_types.md.ZQU03iAA.js → reference_types.md.ifmL7IbS.js} +11 -10
- package/dist-docs/assets/{reference_types.md.ZQU03iAA.lean.js → reference_types.md.ifmL7IbS.lean.js} +1 -1
- package/dist-docs/guide/advanced-usage.html +15 -12
- package/dist-docs/guide/concepts.html +3 -3
- package/dist-docs/guide/getting-started.html +5 -5
- package/dist-docs/guide/mcp.html +5 -5
- package/dist-docs/guide/spot-room-binding.html +3 -3
- package/dist-docs/hashmap.json +1 -1
- package/dist-docs/index.html +3 -3
- package/dist-docs/plans/2026-03-04-detected-objects-visibility-design.html +3 -3
- package/dist-docs/plans/2026-03-04-show-detected-objects-implementation-plan.html +3 -3
- package/dist-docs/plans/2026-03-10-simulator-debug-design.html +3 -3
- package/dist-docs/plans/2026-03-10-simulator-events-console-design.html +3 -3
- package/dist-docs/plans/2026-03-10-simulator-events-console-implementation-plan.html +3 -3
- package/dist-docs/plans/2026-03-10-simulator-runtime-controls-design.html +3 -3
- package/dist-docs/plans/2026-03-10-simulator-runtime-controls-implementation-plan.html +3 -3
- package/dist-docs/plans/2026-03-10-testing-rollout-next-steps-plan.html +3 -3
- package/dist-docs/plans/2026-03-11-simulator-logger-dump-implementation-plan.html +3 -3
- package/dist-docs/reference/callbacks.html +3 -3
- package/dist-docs/reference/config.html +7 -7
- package/dist-docs/reference/data.html +11 -10
- package/dist-docs/reference/methods.html +11 -6
- package/dist-docs/reference/runtime.html +5 -5
- package/dist-docs/reference/types.html +14 -13
- package/dist-docs/reference/utils.html +3 -3
- package/dist-docs/simulator/index.html +3 -3
- package/package.json +1 -1
- package/dist-app/assets/index-BK1e_Ra7.js +0 -1
- package/dist-docs/adr/0001-threshold-mirrors-virtual-wall.html +0 -25
- package/dist-docs/adr/0002-threshold-edit-surface-quad-family.html +0 -25
- package/dist-docs/adr/0003-beautify-derived-presentation-geometry.html +0 -25
- package/dist-docs/adr/0004-beautify-shells-enclose-never-subtract.html +0 -25
- package/dist-docs/agents/domain.html +0 -39
- package/dist-docs/agents/issue-tracker.html +0 -25
- package/dist-docs/agents/triage-labels.html +0 -25
- package/dist-docs/assets/adr_0001-threshold-mirrors-virtual-wall.md.BGtyf9GS.js +0 -1
- package/dist-docs/assets/adr_0001-threshold-mirrors-virtual-wall.md.BGtyf9GS.lean.js +0 -1
- package/dist-docs/assets/adr_0002-threshold-edit-surface-quad-family.md.BlvHYJT5.js +0 -1
- package/dist-docs/assets/adr_0002-threshold-edit-surface-quad-family.md.BlvHYJT5.lean.js +0 -1
- package/dist-docs/assets/adr_0003-beautify-derived-presentation-geometry.md.BIaPCTDJ.js +0 -1
- package/dist-docs/assets/adr_0003-beautify-derived-presentation-geometry.md.BIaPCTDJ.lean.js +0 -1
- package/dist-docs/assets/adr_0004-beautify-shells-enclose-never-subtract.md.PRaaUF5r.js +0 -1
- package/dist-docs/assets/adr_0004-beautify-shells-enclose-never-subtract.md.PRaaUF5r.lean.js +0 -1
- package/dist-docs/assets/agents_domain.md.CYB9yWEy.js +0 -15
- package/dist-docs/assets/agents_domain.md.CYB9yWEy.lean.js +0 -1
- package/dist-docs/assets/agents_issue-tracker.md.CrjzmXmc.js +0 -1
- package/dist-docs/assets/agents_issue-tracker.md.CrjzmXmc.lean.js +0 -1
- package/dist-docs/assets/agents_triage-labels.md.Cmw0b5xB.js +0 -1
- package/dist-docs/assets/agents_triage-labels.md.Cmw0b5xB.lean.js +0 -1
- package/dist-docs/assets/chunks/@localSearchIndexroot.BiQ_oQbs.js +0 -1
- package/dist-docs/assets/chunks/index.vn3lfis1.js +0 -744
- package/dist-docs/assets/chunks/theme.CAU4HwNY.js +0 -4
- package/dist-docs/assets/guide_mcp.md.CabCiX8Z.js +0 -1
- package/dist-docs/assets/reference_runtime.md.BfmrB9c5.js +0 -20
- package/dist-docs/assets/reference_runtime.md.BfmrB9c5.lean.js +0 -1
- /package/dist-docs/assets/{guide_getting-started.md.ItwGZAsG.lean.js → guide_getting-started.md.DQIIL6ql.lean.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,c as i,o as a,aq as t}from"./chunks/framework.CBLqO2Q1.js";const g=JSON.parse('{"title":"配置","description":"","frontmatter":{},"headers":[],"relativePath":"reference/config.md","filePath":"reference/config.md","lastUpdated":
|
|
1
|
+
import{_ as e,c as i,o as a,aq as t}from"./chunks/framework.CBLqO2Q1.js";const g=JSON.parse('{"title":"配置","description":"","frontmatter":{},"headers":[],"relativePath":"reference/config.md","filePath":"reference/config.md","lastUpdated":1785747127000}'),s={name:"reference/config.md"};function l(r,o,n,c,d,h){return a(),i("div",null,[...o[0]||(o[0]=[t("",1466)])])}const u=e(s,[["render",l]]);export{g as __pageData,u as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as i,c as a,o as n,aq as h}from"./chunks/framework.CBLqO2Q1.js";const g=JSON.parse('{"title":"数据","description":"","frontmatter":{},"headers":[],"relativePath":"reference/data.md","filePath":"reference/data.md","lastUpdated":
|
|
1
|
+
import{_ as i,c as a,o as n,aq as h}from"./chunks/framework.CBLqO2Q1.js";const g=JSON.parse('{"title":"数据","description":"","frontmatter":{},"headers":[],"relativePath":"reference/data.md","filePath":"reference/data.md","lastUpdated":1785747127000}'),p={name:"reference/data.md"};function l(t,s,k,e,E,r){return n(),a("div",null,[...s[0]||(s[0]=[h(`<h1 id="数据" tabindex="-1">数据 <a class="header-anchor" href="#数据" aria-label="Permalink to "数据""></a></h1><p>了解 RobotMap 支持的各种数据类型和格式。</p><h2 id="map" tabindex="-1">map <a class="header-anchor" href="#map" aria-label="Permalink to "map""></a></h2><p>地图栅格数据,通常为编码后的字符串格式。</p><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">RobotMap</span></span>
|
|
2
2
|
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> map</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"<原始地图数据字符串>"</span></span>
|
|
3
3
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // ... 其他属性</span></span>
|
|
4
4
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">/></span></span></code></pre></div><p><strong>类型</strong>: <code>string</code></p><p><strong>说明</strong>:</p><ul><li>包含地图尺寸、分辨率、原点等基础信息。</li><li>包含障碍物、房间、地毯等图形数据。</li><li>通常是来源于p2p通道获取的数据,无需做任何处理,直接传入即可。</li></ul><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>目前地图数据协议分为两种,一种是点阵协议,一种是结构化协议。</p><p><code>map</code> 已经兼容支持两种协议,你只需要传入原始数据字符串即可。</p></div><h2 id="path" tabindex="-1">path <a class="header-anchor" href="#path" aria-label="Permalink to "path""></a></h2><p>机器人路径数据,包含清扫轨迹和当前位置。</p><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">RobotMap</span></span>
|
|
@@ -92,19 +92,20 @@ import{_ as i,c as a,o as n,aq as h}from"./chunks/framework.CBLqO2Q1.js";const g
|
|
|
92
92
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
|
93
93
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]</span></span>
|
|
94
94
|
<span class="line"></span>
|
|
95
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">RobotMap</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> virtualWalls</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{virtualWalls} /></span></span></code></pre></div><p><strong>类型</strong>: <a href="/reference/types.html#virtualwallparam"><code>VirtualWallParam[]</code></a></p><h2 id="thresholds" tabindex="-1">thresholds <a class="header-anchor" href="#thresholds" aria-label="Permalink to "thresholds""></a></h2><p
|
|
95
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">RobotMap</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> virtualWalls</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{virtualWalls} /></span></span></code></pre></div><p><strong>类型</strong>: <a href="/reference/types.html#virtualwallparam"><code>VirtualWallParam[]</code></a></p><h2 id="thresholds" tabindex="-1">thresholds <a class="header-anchor" href="#thresholds" aria-label="Permalink to "thresholds""></a></h2><p>门槛数据。门槛是四角坐标描述的斜纹条带,用可通行 / 不可通行两种类型标记机器人能否跨越的通道。<code>points</code> 为四个角点(顺时针 左上→右上→右下→左下,与禁区 / 家具同序),<code>type</code> 为类型(可选,缺省 <code>passable</code>)。</p><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> thresholds</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> ThresholdParam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [</span></span>
|
|
96
96
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
|
97
97
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> id: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'threshold1'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
98
98
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> points: [</span></span>
|
|
99
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">100</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, y: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">
|
|
100
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">200</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, y: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">
|
|
99
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">100</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, y: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">90</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }, </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// 左上</span></span>
|
|
100
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">200</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, y: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">90</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }, </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// 右上</span></span>
|
|
101
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">200</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, y: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">110</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }, </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// 右下</span></span>
|
|
102
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">100</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, y: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">110</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }, </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// 左下</span></span>
|
|
101
103
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ],</span></span>
|
|
102
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> height: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">20</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// 可选,条带厚度(地图像素)</span></span>
|
|
103
104
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> type: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'impassable'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// 可选,缺省 'passable'</span></span>
|
|
104
105
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
105
106
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]</span></span>
|
|
106
107
|
<span class="line"></span>
|
|
107
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">RobotMap</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> thresholds</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{thresholds} /></span></span></code></pre></div><p><strong>类型</strong>: <a href="/reference/types.html#thresholdparam"><code>ThresholdParam[]</code></a></p><h2 id="spots" tabindex="-1">spots <a class="header-anchor" href="#spots" aria-label="Permalink to "spots""></a></h2><p>定点清洁数据,定义需要定点清洁的位置。</p><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> spots</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> SpotParam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [</span></span>
|
|
108
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">RobotMap</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> thresholds</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{thresholds} /></span></span></code></pre></div><div class="warning custom-block"><p class="custom-block-title">数据格式变更</p><p>0.0.18 起门槛数据由「中心线两点 + <code>height</code>」改为四角坐标(与主流厂商协议对齐)。传入两个点的旧数据会被丢弃并打一条 warn 日志,不再渲染。</p></div><p>绘制时点集会被归一化:绕向纠正为顺时针、较长的一条边规范到 0→1(长度方向)、长与厚分别钳制到 <code>controls.threshold</code> 的 <code>minLength</code>/<code>maxLength</code> 与 <code>minHeight</code>/<code>maxHeight</code>(米)区间,再拉直成标准矩形。因此 <code>getThresholds()</code> 与 <code>onUpdateThreshold</code> 回吐的点集是归一化后的结果,不一定与传入的原始点逐字相同。</p><p><strong>类型</strong>: <a href="/reference/types.html#thresholdparam"><code>ThresholdParam[]</code></a></p><h2 id="spots" tabindex="-1">spots <a class="header-anchor" href="#spots" aria-label="Permalink to "spots""></a></h2><p>定点清洁数据,定义需要定点清洁的位置。</p><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> spots</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> SpotParam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [</span></span>
|
|
108
109
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
|
109
110
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> id: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'spot1'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
110
111
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> name: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'主卧床边'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
@@ -224,4 +225,4 @@ import{_ as i,c as a,o as n,aq as h}from"./chunks/framework.CBLqO2Q1.js";const g
|
|
|
224
225
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">RobotMap</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> furnitures</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{furnitures} /></span></span></code></pre></div><p><strong>类型</strong>: <a href="/reference/types.html#furnitureparam"><code>FurnitureParam[]</code></a></p><p><strong>说明</strong>:</p><ul><li><code>furnitureType</code> 需要与 <code>config.furniture.assets</code> 中配置的家具类型编号匹配。</li><li><code>points</code> 为四个顶点坐标(顺时针: 左上→右上→右下→左下)。</li></ul><h2 id="heatmap" tabindex="-1">heatmap <a class="header-anchor" href="#heatmap" aria-label="Permalink to "heatmap""></a></h2><p>地图热力图数据,通常为编码后的字符串格式。</p><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">RobotMap</span></span>
|
|
225
226
|
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> heatmap</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"<原始热力图数据字符串>"</span></span>
|
|
226
227
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // ... 其他属性</span></span>
|
|
227
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">/></span></span></code></pre></div><p><strong>类型</strong>: <code>string</code></p><p><strong>说明</strong>:</p><ul><li>包含热力图点的坐标和信号强度信息。</li><li>通常来源于p2p通道获取的数据,直接传入即可。</li><li>热力图的视觉样式可通过 <code>config.heatmap</code> 进行配置。</li></ul>`,
|
|
228
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">/></span></span></code></pre></div><p><strong>类型</strong>: <code>string</code></p><p><strong>说明</strong>:</p><ul><li>包含热力图点的坐标和信号强度信息。</li><li>通常来源于p2p通道获取的数据,直接传入即可。</li><li>热力图的视觉样式可通过 <code>config.heatmap</code> 进行配置。</li></ul>`,75)])])}const y=i(p,[["render",l]]);export{g as __pageData,y as default};
|
package/dist-docs/assets/{reference_data.md.DL6rfzez.lean.js → reference_data.md.jnSR7326.lean.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as i,c as a,o as n,aq as h}from"./chunks/framework.CBLqO2Q1.js";const g=JSON.parse('{"title":"数据","description":"","frontmatter":{},"headers":[],"relativePath":"reference/data.md","filePath":"reference/data.md","lastUpdated":
|
|
1
|
+
import{_ as i,c as a,o as n,aq as h}from"./chunks/framework.CBLqO2Q1.js";const g=JSON.parse('{"title":"数据","description":"","frontmatter":{},"headers":[],"relativePath":"reference/data.md","filePath":"reference/data.md","lastUpdated":1785747127000}'),p={name:"reference/data.md"};function l(t,s,k,e,E,r){return n(),a("div",null,[...s[0]||(s[0]=[h("",75)])])}const y=i(p,[["render",l]]);export{g as __pageData,y as default};
|
package/dist-docs/assets/{reference_methods.md.yWEfqPKf.js → reference_methods.md.Cv8q9vtz.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as i,c as a,o as n,aq as t}from"./chunks/framework.CBLqO2Q1.js";const g=JSON.parse('{"title":"地图方法","description":"","frontmatter":{},"headers":[],"relativePath":"reference/methods.md","filePath":"reference/methods.md","lastUpdated":
|
|
1
|
+
import{_ as i,c as a,o as n,aq as t}from"./chunks/framework.CBLqO2Q1.js";const g=JSON.parse('{"title":"地图方法","description":"","frontmatter":{},"headers":[],"relativePath":"reference/methods.md","filePath":"reference/methods.md","lastUpdated":1785747127000}'),e={name:"reference/methods.md"};function p(h,s,l,k,r,d){return n(),a("div",null,[...s[0]||(s[0]=[t(`<h1 id="地图方法" tabindex="-1">地图方法 <a class="header-anchor" href="#地图方法" aria-label="Permalink to "地图方法""></a></h1><p>了解 RobotMap 提供的 API 方法。</p><h2 id="使用示例" tabindex="-1">使用示例 <a class="header-anchor" href="#使用示例" aria-label="Permalink to "使用示例""></a></h2><p>通过 <code>onMapReady</code> 回调获得 <code>MapApi</code> 实例,该实例包含所有可调用的地图方法。这些方法让你可以主动控制地图行为、查询数据和执行各种操作。</p><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { MapApi } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '@ray-js/robot-map'</span></span>
|
|
2
2
|
<span class="line"></span>
|
|
3
3
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> MapPage</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span></span>
|
|
4
4
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> mapApi</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> useRef</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">MapApi</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">>(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">null</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span>
|
|
@@ -58,7 +58,12 @@ import{_ as i,c as a,o as n,aq as t}from"./chunks/framework.CBLqO2Q1.js";const g
|
|
|
58
58
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> size</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
|
|
59
59
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> offsetX</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
|
|
60
60
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> offsetY</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
|
|
61
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Promise</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">Point</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[]></span></span></code></pre></div><p><strong>参数</strong>:</p><ul><li><code>options</code> - 配置选项</li><li><code>options.size</code>: <code>number</code> - 区域大小,单位米,默认使用配置中的最小尺寸</li><li><code>options.offsetX</code>: <code>number</code> - X方向像素偏移,支持负数,默认为 0</li><li><code>options.offsetY</code>: <code>number</code> - Y方向像素偏移,支持负数,默认为 0</li></ul><p><strong>返回值</strong>: <a href="/reference/types.html#point"><code>Promise<Point[]></code></a></p><h2 id="
|
|
61
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Promise</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">Point</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[]></span></span></code></pre></div><p><strong>参数</strong>:</p><ul><li><code>options</code> - 配置选项</li><li><code>options.size</code>: <code>number</code> - 区域大小,单位米,默认使用配置中的最小尺寸</li><li><code>options.offsetX</code>: <code>number</code> - X方向像素偏移,支持负数,默认为 0</li><li><code>options.offsetY</code>: <code>number</code> - Y方向像素偏移,支持负数,默认为 0</li></ul><p><strong>返回值</strong>: <a href="/reference/types.html#point"><code>Promise<Point[]></code></a></p><h2 id="getthresholdpointsbyviewportcenter" tabindex="-1">getThresholdPointsByViewportCenter() <a class="header-anchor" href="#getthresholdpointsbyviewportcenter" aria-label="Permalink to "getThresholdPointsByViewportCenter()""></a></h2><p>基于视口中心生成门槛的四个角点坐标,可直接作为 <a href="/reference/types.html#thresholdparam"><code>ThresholdParam</code></a> 的 <code>points</code>。</p><p>缺省尺寸 <strong>1m × 0.15m</strong>(长 × 厚)—— 这是「新建门槛」的初始尺寸,不是配置项;需要别的初始尺寸就传 <code>width</code> / <code>height</code>。传入值会被钳制到 <code>controls.threshold</code> 的 <code>minLength</code>/<code>maxLength</code> 与 <code>minHeight</code>/<code>maxHeight</code>(米)区间内,避免生成一个绘制时又要被修正的尺寸。</p><p><strong>类型</strong>:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> getThresholdPointsByViewportCenter</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">options</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
|
62
|
+
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> width</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
|
|
63
|
+
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> height</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
|
|
64
|
+
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> offsetX</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
|
|
65
|
+
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> offsetY</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
|
|
66
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">})</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Promise</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">Point</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[]></span></span></code></pre></div><p><strong>参数</strong>:</p><ul><li><code>options</code> - 配置选项</li><li><code>options.width</code>: <code>number</code> - 门槛长度,单位米,默认 <code>1</code></li><li><code>options.height</code>: <code>number</code> - 门槛厚度,单位米,默认 <code>0.15</code></li><li><code>options.offsetX</code>: <code>number</code> - X方向像素偏移,支持负数,默认为 0</li><li><code>options.offsetY</code>: <code>number</code> - Y方向像素偏移,支持负数,默认为 0</li></ul><p><strong>返回值</strong>: <a href="/reference/types.html#point"><code>Promise<Point[]></code></a> — 顺时针 [左上, 右上, 右下, 左下],顶点 0→1 为长度方向,0→3 为厚度方向。</p><h2 id="drawfurnitures" tabindex="-1">drawFurnitures() <a class="header-anchor" href="#drawfurnitures" aria-label="Permalink to "drawFurnitures()""></a></h2><p>绘制家具。</p><p><strong>类型</strong>:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> drawFurnitures</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">items</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> FurnitureParam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[])</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Promise</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">void</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span></code></pre></div><p><strong>参数</strong>:</p><ul><li><code>items</code>: <a href="/reference/types.html#furnitureparam"><code>FurnitureParam[]</code></a> - 家具数据数组。新 ID 会被添加,已有 ID 的数据变化会被更新,不在列表中的已有 ID 会被移除。传入空数组即清空所有家具。</li></ul><p><strong>返回值</strong>: <code>Promise<void></code></p><h2 id="getfurniturepointsbyviewportcenter" tabindex="-1">getFurniturePointsByViewportCenter() <a class="header-anchor" href="#getfurniturepointsbyviewportcenter" aria-label="Permalink to "getFurniturePointsByViewportCenter()""></a></h2><p>基于视口中心生成家具的四个顶点坐标。初始尺寸来源于 <code>config.furniture.assets</code> 中对应类型的 <code>width</code>/<code>height</code>(单位为米),SDK 内部根据地图 <code>resolution</code> 自动转换为像素坐标。</p><p><strong>类型</strong>:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> getFurniturePointsByViewportCenter</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">options</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
|
62
67
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> furnitureType</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
|
|
63
68
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> offsetX</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
|
|
64
69
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> offsetY</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
|
|
@@ -185,4 +190,4 @@ import{_ as i,c as a,o as n,aq as t}from"./chunks/framework.CBLqO2Q1.js";const g
|
|
|
185
190
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
186
191
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> runtime</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> DeepPartialRuntimeConfig</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
187
192
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> options</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">backgroundColor</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> ColorSource</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
188
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Promise</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span></code></pre></div><p><strong>参数</strong>:</p><ul><li><code>data</code> - 地图数据对象</li><li><code>data.map</code>: <code>string</code> - 地图字符串数据 (支持结构化协议和栅格协议)</li><li><code>data.path</code>: <code>string</code> - 可选的路径数据</li><li><code>data.roomProperties</code>: <code>RoomProperty[]</code> - 可选的房间属性数据</li><li><code>data.customElements</code>: <code>CustomElementParam[]</code> - 可选的自定义元素数据</li><li><code>data.forbiddenSweepZones</code>: <code>ZoneParam[]</code> - 可选的禁扫区域数据</li><li><code>data.forbiddenMopZones</code>: <code>ZoneParam[]</code> - 可选的禁拖区域数据</li><li><code>data.virtualWalls</code>: <code>VirtualWallParam[]</code> - 可选的虚拟墙数据</li><li><code>data.detectedObjects</code>: <code>DetectedObjectParam[]</code> - 可选的检测物体数据</li><li><code>data.furnitures</code>: <a href="/reference/types.html#furnitureparam"><code>FurnitureParam[]</code></a> - 可选的家具数据</li><li><code>data.carpets</code>: <a href="/reference/types.html#customcarpetparam"><code>CustomCarpetParam[]</code></a> - 可选的自定义地毯数据</li><li><code>runtime</code> - 可选的运行时配置 (DeepPartialRuntimeConfig)</li><li><code>options</code> - 截图配置选项</li><li><code>options.backgroundColor</code>: <code>ColorSource</code> - 指定生成截图时的背景颜色。若不指定,将默认使用 <code>config.global.backgroundColor</code>。</li></ul><p><strong>返回值</strong>: <a href="/reference/types.html#string"><code>Promise<string></code></a> - Base64 格式的图片数据 (Data URL)。</p><h2 id="forceendgesture" tabindex="-1">forceEndGesture() <a class="header-anchor" href="#forceendgesture" aria-label="Permalink to "forceEndGesture()""></a></h2><p>强制结束当前正在进行的手势交互。</p><p><strong>类型</strong>:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> forceEndGesture</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">()</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Promise</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">void</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span></code></pre></div><p><strong>返回值</strong>: <code>Promise<void></code></p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>该方法主要用于解决小程序异层渲染导致的 <code>touchend</code> 事件丢失问题。如果小程序侧通过原生手势监听到松手,但 SDK 由于层级劫持未收到事件,可调用此方法手动终止 SDK 内部的手势状态。这会触发当前的控制元素(如禁区)执行最终的位置更新并抛出 <code>onUpdateXxx</code> 回调。</p></div>`,
|
|
193
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Promise</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span></code></pre></div><p><strong>参数</strong>:</p><ul><li><code>data</code> - 地图数据对象</li><li><code>data.map</code>: <code>string</code> - 地图字符串数据 (支持结构化协议和栅格协议)</li><li><code>data.path</code>: <code>string</code> - 可选的路径数据</li><li><code>data.roomProperties</code>: <code>RoomProperty[]</code> - 可选的房间属性数据</li><li><code>data.customElements</code>: <code>CustomElementParam[]</code> - 可选的自定义元素数据</li><li><code>data.forbiddenSweepZones</code>: <code>ZoneParam[]</code> - 可选的禁扫区域数据</li><li><code>data.forbiddenMopZones</code>: <code>ZoneParam[]</code> - 可选的禁拖区域数据</li><li><code>data.virtualWalls</code>: <code>VirtualWallParam[]</code> - 可选的虚拟墙数据</li><li><code>data.detectedObjects</code>: <code>DetectedObjectParam[]</code> - 可选的检测物体数据</li><li><code>data.furnitures</code>: <a href="/reference/types.html#furnitureparam"><code>FurnitureParam[]</code></a> - 可选的家具数据</li><li><code>data.carpets</code>: <a href="/reference/types.html#customcarpetparam"><code>CustomCarpetParam[]</code></a> - 可选的自定义地毯数据</li><li><code>runtime</code> - 可选的运行时配置 (DeepPartialRuntimeConfig)</li><li><code>options</code> - 截图配置选项</li><li><code>options.backgroundColor</code>: <code>ColorSource</code> - 指定生成截图时的背景颜色。若不指定,将默认使用 <code>config.global.backgroundColor</code>。</li></ul><p><strong>返回值</strong>: <a href="/reference/types.html#string"><code>Promise<string></code></a> - Base64 格式的图片数据 (Data URL)。</p><h2 id="forceendgesture" tabindex="-1">forceEndGesture() <a class="header-anchor" href="#forceendgesture" aria-label="Permalink to "forceEndGesture()""></a></h2><p>强制结束当前正在进行的手势交互。</p><p><strong>类型</strong>:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> forceEndGesture</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">()</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Promise</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">void</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span></code></pre></div><p><strong>返回值</strong>: <code>Promise<void></code></p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>该方法主要用于解决小程序异层渲染导致的 <code>touchend</code> 事件丢失问题。如果小程序侧通过原生手势监听到松手,但 SDK 由于层级劫持未收到事件,可调用此方法手动终止 SDK 内部的手势状态。这会触发当前的控制元素(如禁区)执行最终的位置更新并抛出 <code>onUpdateXxx</code> 回调。</p></div>`,234)])])}const E=i(e,[["render",p]]);export{g as __pageData,E as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as i,c as a,o as n,aq as t}from"./chunks/framework.CBLqO2Q1.js";const g=JSON.parse('{"title":"地图方法","description":"","frontmatter":{},"headers":[],"relativePath":"reference/methods.md","filePath":"reference/methods.md","lastUpdated":
|
|
1
|
+
import{_ as i,c as a,o as n,aq as t}from"./chunks/framework.CBLqO2Q1.js";const g=JSON.parse('{"title":"地图方法","description":"","frontmatter":{},"headers":[],"relativePath":"reference/methods.md","filePath":"reference/methods.md","lastUpdated":1785747127000}'),e={name:"reference/methods.md"};function p(h,s,l,k,r,d){return n(),a("div",null,[...s[0]||(s[0]=[t("",234)])])}const E=i(e,[["render",p]]);export{g as __pageData,E as default};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import{_ as e,c as i,o as s,aq as a}from"./chunks/framework.CBLqO2Q1.js";const g=JSON.parse('{"title":"运行时配置","description":"","frontmatter":{},"headers":[],"relativePath":"reference/runtime.md","filePath":"reference/runtime.md","lastUpdated":1785747127000}'),t={name:"reference/runtime.md"};function n(l,o,r,d,c,h){return s(),i("div",null,[...o[0]||(o[0]=[a(`<h1 id="运行时配置" tabindex="-1">运行时配置 <a class="header-anchor" href="#运行时配置" aria-label="Permalink to "运行时配置""></a></h1><p>了解 RobotMap 的运行时配置项,用于控制地图在运行过程中的动态行为和状态。</p><h2 id="使用示例" tabindex="-1">使用示例 <a class="header-anchor" href="#使用示例" aria-label="Permalink to "使用示例""></a></h2><p>运行时配置通过 <code>runtime</code> 传递,所有配置项都是可选的,你可以只覆盖需要修改的部分。</p><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> React </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 'react'</span></span>
|
|
2
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { RobotMap } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '@ray-js/robot-map'</span></span>
|
|
3
|
+
<span class="line"></span>
|
|
4
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> MapPage</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span></span>
|
|
5
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (</span></span>
|
|
6
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> <</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">RobotMap</span></span>
|
|
7
|
+
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> runtime</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{{</span></span>
|
|
8
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> showPath: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
9
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> showChargingStation: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
10
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> showRoomName: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
11
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> showRoomProperty: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
12
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> showRoomOrder: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
13
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> showDetectedObjects: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
14
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> enableRoomSelection: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">false</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
15
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // ... 其他运行时配置</span></span>
|
|
16
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }}</span></span>
|
|
17
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // ... 其他props</span></span>
|
|
18
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> /></span></span>
|
|
19
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> )</span></span>
|
|
20
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="dividingroomid" tabindex="-1">dividingRoomId <a class="header-anchor" href="#dividingroomid" aria-label="Permalink to "dividingRoomId""></a></h2><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>-1</code></li></ul><p>正在分割的房间ID。</p><p>你可以通过将 <code>dividingRoomId</code> 设置为 <code>-1</code> 来移除分割线。</p><h2 id="enableroomselection" tabindex="-1">enableRoomSelection <a class="header-anchor" href="#enableroomselection" aria-label="Permalink to "enableRoomSelection""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>false</code></li></ul><p>是否启用房间选择功能</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><ul><li><strong>当 <code>enableRoomSelection</code> 为 <code>false</code> 时</strong>:房间使用普通展示模式的颜色(对应 <code>room.colors.normal</code>,若未定义则使用 <code>room.colors.active</code>)。</li><li><strong>当 <code>enableRoomSelection</code> 为 <code>true</code> 时</strong>:进入房间选择模式。房间颜色根据是否被选中(是否在 <code>selectRoomIds</code> 中)在 <code>active</code> 和 <code>inactive</code> 之间切换。</li></ul></div><h2 id="enableinteraction" tabindex="-1">enableInteraction <a class="header-anchor" href="#enableinteraction" aria-label="Permalink to "enableInteraction""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>false</code></li></ul><p>是否启用交互功能。</p><p>当 <code>enableInteraction</code> 为 <code>false</code> 时,地图不会响应任何交互事件。</p><h2 id="enablemapclickcapture" tabindex="-1">enableMapClickCapture <a class="header-anchor" href="#enablemapclickcapture" aria-label="Permalink to "enableMapClickCapture""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>false</code></li></ul><p>是否启用地图点击捕获功能。</p><p>开启地图点击捕获功能后,用户点击地图时会触发 <code>onClickMap</code> 回调。</p><h2 id="editingforbiddensweepzoneids" tabindex="-1">editingForbiddenSweepZoneIds <a class="header-anchor" href="#editingforbiddensweepzoneids" aria-label="Permalink to "editingForbiddenSweepZoneIds""></a></h2><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>[]</code></li></ul><p>正在编辑的禁扫区域ID列表。</p><h2 id="editingforbiddenmopzoneids" tabindex="-1">editingForbiddenMopZoneIds <a class="header-anchor" href="#editingforbiddenmopzoneids" aria-label="Permalink to "editingForbiddenMopZoneIds""></a></h2><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>[]</code></li></ul><p>正在编辑的禁拖区域ID列表。</p><h2 id="editingcleanzoneids" tabindex="-1">editingCleanZoneIds <a class="header-anchor" href="#editingcleanzoneids" aria-label="Permalink to "editingCleanZoneIds""></a></h2><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>[]</code></li></ul><p>正在编辑的清扫区域ID列表。</p><h2 id="editingcustomzoneids" tabindex="-1">editingCustomZoneIds <a class="header-anchor" href="#editingcustomzoneids" aria-label="Permalink to "editingCustomZoneIds""></a></h2><ul><li><strong>类型</strong>: <code>Record<string, string[]></code></li><li><strong>默认值</strong>: <code>{}</code></li></ul><p>正在编辑的自定义区域ID列表,按自定义类型分组。key 为通过 <a href="/reference/config.html#customzonetypes"><code>config.customZoneTypes</code></a> 声明的类型名,value 为该类型下处于编辑态的区域 ID 列表。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>三种内置区域(forbiddenSweepZone / forbiddenMopZone / cleanZone)继续使用各自的 <code>editingForbiddenSweepZoneIds</code> / <code>editingForbiddenMopZoneIds</code> / <code>editingCleanZoneIds</code>,不会出现在这里。</p></div><h2 id="editingvirtualwallids" tabindex="-1">editingVirtualWallIds <a class="header-anchor" href="#editingvirtualwallids" aria-label="Permalink to "editingVirtualWallIds""></a></h2><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>[]</code></li></ul><p>正在编辑的虚拟墙ID列表。</p><h2 id="editingthresholdids" tabindex="-1">editingThresholdIds <a class="header-anchor" href="#editingthresholdids" aria-label="Permalink to "editingThresholdIds""></a></h2><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>[]</code></li></ul><p>正在编辑的门槛ID列表。列入的门槛显示编辑控件 —— 虚线轮廓、尺寸标签(长×厚)与四角按钮(删除左上 / 旋转右上 / 缩放右下 / 移动左下,与禁区等四边形元素同一套编辑面):旋转按钮拖拽绕中心连续旋转;缩放按钮拖拽同时改变长与厚,两个维度各自被钳制在 <code>minLength</code> / <code>maxLength</code> 与 <code>minHeight</code> / <code>maxHeight</code>(米)区间内,达到临界值即停;移动按钮或直接拖拽条带整体平移(尺寸朝向不变)。拖拽期间手势被门槛独占(地图不会随手指平移缩放),一次操作结束后触发 <a href="/reference/callbacks.html#onupdatethreshold"><code>onUpdateThreshold</code></a>。未列入的门槛不显示编辑控件;点击会触发 <a href="/reference/callbacks.html#onclickthreshold"><code>onClickThreshold</code></a>,宿主可借此实现「点击进入编辑」。只读展示设备识别的门槛时,不把其 id 加入本列表即可。</p><h2 id="editingspotids" tabindex="-1">editingSpotIds <a class="header-anchor" href="#editingspotids" aria-label="Permalink to "editingSpotIds""></a></h2><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>[]</code></li></ul><p>正在编辑的定点清扫ID列表。</p><h2 id="editingroomanchorids" tabindex="-1">editingRoomAnchorIds <a class="header-anchor" href="#editingroomanchorids" aria-label="Permalink to "editingRoomAnchorIds""></a></h2><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>[]</code></li></ul><p>正在编辑的房间锚点ID列表。与 <code>editingSpotIds</code> 相互独立、互不影响:房间锚点仅由本列表驱动编辑态(可拖拽;携带 <code>roomId</code> 时被硬约束在所属房间内)。</p><h2 id="editingwaypointids" tabindex="-1">editingWayPointIds <a class="header-anchor" href="#editingwaypointids" aria-label="Permalink to "editingWayPointIds""></a></h2><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>[]</code></li></ul><p>正在编辑的途径点ID列表。</p><h2 id="editingcarpetids" tabindex="-1">editingCarpetIds <a class="header-anchor" href="#editingcarpetids" aria-label="Permalink to "editingCarpetIds""></a></h2><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>[]</code></li></ul><p>正在编辑的地毯ID列表。</p><h2 id="editingfurnitureids" tabindex="-1">editingFurnitureIds <a class="header-anchor" href="#editingfurnitureids" aria-label="Permalink to "editingFurnitureIds""></a></h2><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>[]</code></li></ul><p>正在编辑的家具ID列表。</p><h2 id="maprotation" tabindex="-1">mapRotation <a class="header-anchor" href="#maprotation" aria-label="Permalink to "mapRotation""></a></h2><ul><li><strong>类型</strong>: <code>number</code></li><li><strong>默认值</strong>: <code>0</code></li><li><strong>单位</strong>: <code>度(°)</code></li></ul><p>地图旋转角度。</p><h2 id="roompropertyfoldids" tabindex="-1">roomPropertyFoldIds <a class="header-anchor" href="#roompropertyfoldids" aria-label="Permalink to "roomPropertyFoldIds""></a></h2><ul><li><strong>类型</strong>: <code>number[]</code></li><li><strong>默认值</strong>: <code>[]</code></li></ul><p>处于折叠状态的房间ID列表。</p><h2 id="roomselectionmode" tabindex="-1">roomSelectionMode <a class="header-anchor" href="#roomselectionmode" aria-label="Permalink to "roomSelectionMode""></a></h2><ul><li><strong>类型</strong>: <code>'checkmark' | 'order'</code></li><li><strong>默认值</strong>: <code>'checkmark'</code></li></ul><p>房间选中的指示方式。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>当 <code>roomSelectionMode</code> 为 <code>'checkmark'</code> 时,房间选中后会显示选择指示器。</p><p>当 <code>roomSelectionMode</code> 为 <code>'order'</code> 时,房间选中后会显示清扫顺序数字。</p></div><h2 id="selectroomids" tabindex="-1">selectRoomIds <a class="header-anchor" href="#selectroomids" aria-label="Permalink to "selectRoomIds""></a></h2><ul><li><strong>类型</strong>: <code>number[]</code></li><li><strong>默认值</strong>: <code>[]</code></li></ul><p>选中的房间ID列表。只有当 <code>enableRoomSelection</code> 为 <code>true</code> 时,这个值才会生效。</p><h2 id="selectedcarpetids" tabindex="-1">selectedCarpetIds <a class="header-anchor" href="#selectedcarpetids" aria-label="Permalink to "selectedCarpetIds""></a></h2><ul><li><strong>类型</strong>: <code>string[]</code></li><li><strong>默认值</strong>: <code>[]</code></li></ul><p>选中的地毯ID列表。</p><h2 id="showroomproperty" tabindex="-1">showRoomProperty <a class="header-anchor" href="#showroomproperty" aria-label="Permalink to "showRoomProperty""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>false</code></li></ul><p>是否显示房间属性。</p><h2 id="showroomorder" tabindex="-1">showRoomOrder <a class="header-anchor" href="#showroomorder" aria-label="Permalink to "showRoomOrder""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>true</code></li></ul><p>是否显示房间清扫顺序。</p><h2 id="showroomname" tabindex="-1">showRoomName <a class="header-anchor" href="#showroomname" aria-label="Permalink to "showRoomName""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>true</code></li></ul><p>是否显示房间名称。</p><h2 id="showroomtype" tabindex="-1">showRoomType <a class="header-anchor" href="#showroomtype" aria-label="Permalink to "showRoomType""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>true</code></li></ul><p>是否显示房间类型图标。</p><h2 id="showpath" tabindex="-1">showPath <a class="header-anchor" href="#showpath" aria-label="Permalink to "showPath""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>true</code></li></ul><p>是否显示机器人路径。</p><h2 id="showrobot" tabindex="-1">showRobot <a class="header-anchor" href="#showrobot" aria-label="Permalink to "showRobot""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>true</code></li></ul><p>是否显示扫地机器人。</p><h2 id="showchargingstation" tabindex="-1">showChargingStation <a class="header-anchor" href="#showchargingstation" aria-label="Permalink to "showChargingStation""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>true</code></li></ul><p>是否显示充电桩。</p><h2 id="showroomfloortype" tabindex="-1">showRoomFloorType <a class="header-anchor" href="#showroomfloortype" aria-label="Permalink to "showRoomFloorType""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>true</code></li></ul><p>是否显示房间地板材质。</p><h2 id="showcarpet" tabindex="-1">showCarpet <a class="header-anchor" href="#showcarpet" aria-label="Permalink to "showCarpet""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>true</code></li></ul><p>是否显示地毯。</p><h2 id="showdetectedobjects" tabindex="-1">showDetectedObjects <a class="header-anchor" href="#showdetectedobjects" aria-label="Permalink to "showDetectedObjects""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>true</code></li></ul><p>是否显示 AI 检测物体。</p><h2 id="showfurnitures" tabindex="-1">showFurnitures <a class="header-anchor" href="#showfurnitures" aria-label="Permalink to "showFurnitures""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>true</code></li></ul><p>是否显示家具。</p><h2 id="showcustomcarpets" tabindex="-1">showCustomCarpets <a class="header-anchor" href="#showcustomcarpets" aria-label="Permalink to "showCustomCarpets""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>true</code></li></ul><p>是否显示自定义地毯。</p><h2 id="showchargingstationring" tabindex="-1">showChargingStationRing <a class="header-anchor" href="#showchargingstationring" aria-label="Permalink to "showChargingStationRing""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>false</code></li></ul><p>是否显示充电桩预警圈。</p><h2 id="showrobotring" tabindex="-1">showRobotRing <a class="header-anchor" href="#showrobotring" aria-label="Permalink to "showRobotRing""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>false</code></li></ul><p>是否显示机器人预警圈。</p><h2 id="showrobotsleepanimation" tabindex="-1">showRobotSleepAnimation <a class="header-anchor" href="#showrobotsleepanimation" aria-label="Permalink to "showRobotSleepAnimation""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>false</code></li></ul><p>是否显示机器人睡眠动画。</p><h2 id="showrobotpulsecircle" tabindex="-1">showRobotPulseCircle <a class="header-anchor" href="#showrobotpulsecircle" aria-label="Permalink to "showRobotPulseCircle""></a></h2><ul><li><strong>类型</strong>: <code>boolean</code></li><li><strong>默认值</strong>: <code>false</code></li></ul><p>是否显示机器人脉冲圈(呼吸效果)。</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>机器人脉冲圈会在机器人图标下方显示一个呼吸动画效果,可用于充电等状态的视觉提示。</p></div><h2 id="unit" tabindex="-1">unit <a class="header-anchor" href="#unit" aria-label="Permalink to "unit""></a></h2><ul><li><strong>类型</strong>: <code>meter | feet | centimeter</code></li><li><strong>默认值</strong>: <code>'meter'</code></li></ul><p>尺寸标签单位。</p><p>尺寸标签的显示会根据这个单位进行转换计算。</p><h2 id="unitlabel" tabindex="-1">unitLabel <a class="header-anchor" href="#unitlabel" aria-label="Permalink to "unitLabel""></a></h2><ul><li><strong>类型</strong>: <code>string</code></li><li><strong>默认值</strong>: <code>'m'</code></li></ul><p>尺寸标签单位显示文本。</p>`,127)])])}const u=e(t,[["render",n]]);export{g as __pageData,u as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as e,c as i,o as s,aq as a}from"./chunks/framework.CBLqO2Q1.js";const g=JSON.parse('{"title":"运行时配置","description":"","frontmatter":{},"headers":[],"relativePath":"reference/runtime.md","filePath":"reference/runtime.md","lastUpdated":1785747127000}'),t={name:"reference/runtime.md"};function n(l,o,r,d,c,h){return s(),i("div",null,[...o[0]||(o[0]=[a("",127)])])}const u=e(t,[["render",n]]);export{g as __pageData,u as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as i,c as a,o as n,aq as p}from"./chunks/framework.CBLqO2Q1.js";const y=JSON.parse('{"title":"类型定义","description":"","frontmatter":{},"headers":[],"relativePath":"reference/types.md","filePath":"reference/types.md","lastUpdated":
|
|
1
|
+
import{_ as i,c as a,o as n,aq as p}from"./chunks/framework.CBLqO2Q1.js";const y=JSON.parse('{"title":"类型定义","description":"","frontmatter":{},"headers":[],"relativePath":"reference/types.md","filePath":"reference/types.md","lastUpdated":1785747127000}'),h={name:"reference/types.md"};function l(t,s,k,e,r,d){return n(),a("div",null,[...s[0]||(s[0]=[p(`<h1 id="类型定义" tabindex="-1">类型定义 <a class="header-anchor" href="#类型定义" aria-label="Permalink to "类型定义""></a></h1><p>了解 RobotMap 支持的各种数据类型和格式。</p><h2 id="point" tabindex="-1">Point <a class="header-anchor" href="#point" aria-label="Permalink to "Point {#point}""></a></h2><p>坐标点类型。</p><div class="language-typescript vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">typescript</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">type</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Point</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
|
2
2
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** X坐标 */</span></span>
|
|
3
3
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> x</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
|
|
4
4
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** Y坐标 */</span></span>
|
|
@@ -88,20 +88,21 @@ import{_ as i,c as a,o as n,aq as p}from"./chunks/framework.CBLqO2Q1.js";const y
|
|
|
88
88
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> id</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> string</span></span>
|
|
89
89
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 点集合,包含起点和终点坐标 */</span></span>
|
|
90
90
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> points</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Point</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[] </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// 长度必须为 2</span></span>
|
|
91
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="thresholdtype" tabindex="-1">ThresholdType <a class="header-anchor" href="#thresholdtype" aria-label="Permalink to "ThresholdType {#thresholdtype}""></a></h2><p>门槛类型。<code>passable</code>
|
|
91
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="thresholdtype" tabindex="-1">ThresholdType <a class="header-anchor" href="#thresholdtype" aria-label="Permalink to "ThresholdType {#thresholdtype}""></a></h2><p>门槛类型。<code>passable</code> 为可通行(默认蓝白斜纹),<code>impassable</code> 为不可通行(默认红白斜纹)。</p><div class="language-typescript vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">typescript</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">type</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> ThresholdType</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 'passable'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 'impassable'</span></span></code></pre></div><h2 id="thresholdparam" tabindex="-1">ThresholdParam <a class="header-anchor" href="#thresholdparam" aria-label="Permalink to "ThresholdParam {#thresholdparam}""></a></h2><p>门槛参数类型。门槛是四角坐标描述的矩形条带元素(数据形态与禁区 / 家具一致)。</p><div class="language-typescript vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">typescript</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">type</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> ThresholdParam</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
|
92
92
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 门槛ID */</span></span>
|
|
93
93
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> id</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> string</span></span>
|
|
94
|
-
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 中心线两端点坐标(起点、终点),与其他元素同为地图像素坐标系 */</span></span>
|
|
95
|
-
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> points</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">Point</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">Point</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]</span></span>
|
|
96
94
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /**</span></span>
|
|
97
|
-
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> *
|
|
98
|
-
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> *
|
|
99
|
-
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">
|
|
95
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> * 四角坐标(地图像素坐标系),顺时针 左上→右上→右下→左下:</span></span>
|
|
96
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> * 顶点 0→1 为长度方向,0→3 为厚度方向。</span></span>
|
|
97
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> *</span></span>
|
|
98
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> * 入口处会归一化:绕向纠正为顺时针、较长的一条边规范到 0→1、长与厚</span></span>
|
|
99
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> * 分别钳制到 controls.threshold 的 minLength/maxLength 与</span></span>
|
|
100
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> * minHeight/maxHeight(米)区间,再拉直成标准矩形。</span></span>
|
|
100
101
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> */</span></span>
|
|
101
|
-
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">
|
|
102
|
+
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> points</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Point</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[]</span></span>
|
|
102
103
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 门槛类型(可通行 / 不可通行)。缺省为 passable(可通行)。 */</span></span>
|
|
103
104
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> type</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> ThresholdType</span></span>
|
|
104
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="spotparam" tabindex="-1">SpotParam <a class="header-anchor" href="#spotparam" aria-label="Permalink to "SpotParam {#spotparam}""></a></h2><p>定点清扫参数类型。</p><div class="language-typescript vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">typescript</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">type</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> SpotParam</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
|
105
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><div class="warning custom-block"><p class="custom-block-title">数据格式变更</p><p>0.0.18 起由「中心线两点 + <code>height</code>」改为四角坐标;<code>height</code> 字段已移除,传入两点的旧数据会被丢弃并打 warn 日志。</p></div><h2 id="spotparam" tabindex="-1">SpotParam <a class="header-anchor" href="#spotparam" aria-label="Permalink to "SpotParam {#spotparam}""></a></h2><p>定点清扫参数类型。</p><div class="language-typescript vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">typescript</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">type</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> SpotParam</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
|
105
106
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 定点清洁ID */</span></span>
|
|
106
107
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> id</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> string</span></span>
|
|
107
108
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 定点清洁名称;name?.trim() 非空时可通过 controls.spot.nameLabel 显示,展示文本为 trim 后的值 */</span></span>
|
|
@@ -302,4 +303,4 @@ import{_ as i,c as a,o as n,aq as p}from"./chunks/framework.CBLqO2Q1.js";const y
|
|
|
302
303
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="heatmappoint" tabindex="-1">HeatmapPoint <a class="header-anchor" href="#heatmappoint" aria-label="Permalink to "HeatmapPoint {#heatmappoint}""></a></h2><p>热力图数据点类型。</p><div class="language-typescript vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">typescript</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">type</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> HeatmapPoint</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> Point</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> &</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
|
303
304
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> /** 信号强度 */</span></span>
|
|
304
305
|
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> signal</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> number</span></span>
|
|
305
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div>`,
|
|
306
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div>`,75)])])}const F=i(h,[["render",l]]);export{y as __pageData,F as default};
|
package/dist-docs/assets/{reference_types.md.ZQU03iAA.lean.js → reference_types.md.ifmL7IbS.lean.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as i,c as a,o as n,aq as p}from"./chunks/framework.CBLqO2Q1.js";const y=JSON.parse('{"title":"类型定义","description":"","frontmatter":{},"headers":[],"relativePath":"reference/types.md","filePath":"reference/types.md","lastUpdated":
|
|
1
|
+
import{_ as i,c as a,o as n,aq as p}from"./chunks/framework.CBLqO2Q1.js";const y=JSON.parse('{"title":"类型定义","description":"","frontmatter":{},"headers":[],"relativePath":"reference/types.md","filePath":"reference/types.md","lastUpdated":1785747127000}'),h={name:"reference/types.md"};function l(t,s,k,e,r,d){return n(),a("div",null,[...s[0]||(s[0]=[p("",75)])])}const F=i(h,[["render",l]]);export{y as __pageData,F as default};
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
<link rel="preload stylesheet" href="/assets/style.hiWmcVfN.css" as="style">
|
|
10
10
|
<link rel="preload stylesheet" href="/vp-icons.css" as="style">
|
|
11
11
|
|
|
12
|
-
<script type="module" src="/assets/app.
|
|
12
|
+
<script type="module" src="/assets/app.C3BeeaYd.js"></script>
|
|
13
13
|
<link rel="preload" href="/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
|
|
14
|
-
<link rel="modulepreload" href="/assets/chunks/theme.
|
|
14
|
+
<link rel="modulepreload" href="/assets/chunks/theme.BItp-bTH.js">
|
|
15
15
|
<link rel="modulepreload" href="/assets/chunks/framework.CBLqO2Q1.js">
|
|
16
|
-
<link rel="modulepreload" href="/assets/guide_advanced-usage.md.
|
|
16
|
+
<link rel="modulepreload" href="/assets/guide_advanced-usage.md.BsGRhEuG.lean.js">
|
|
17
17
|
<script id="check-dark-mode">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
|
|
18
18
|
<script id="check-mac-os">document.documentElement.classList.toggle("mac",/Mac|iPhone|iPod|iPad/i.test(navigator.platform));</script>
|
|
19
19
|
</head>
|
|
@@ -304,7 +304,9 @@
|
|
|
304
304
|
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> onClickVirtualWall</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{handleClickVirtualWall}</span></span>
|
|
305
305
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> /></span></span>
|
|
306
306
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> )</span></span>
|
|
307
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h3 id="门槛" tabindex="-1">门槛 <a class="header-anchor" href="#门槛" aria-label="Permalink to "门槛""></a></h3><p>门槛分为可通行(<code>passable</code>)与不可通行(<code>impassable</code
|
|
307
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h3 id="门槛" tabindex="-1">门槛 <a class="header-anchor" href="#门槛" aria-label="Permalink to "门槛""></a></h3><p>门槛分为可通行(<code>passable</code>)与不可通行(<code>impassable</code>)两种类型,数据由四个角点(<code>points</code>,顺时针 左上→右上→右下→左下,与禁区同序)与类型(<code>type</code>)构成。编辑交互通过 <code>editingThresholdIds</code> 门控,列入的门槛显示删除 / 旋转 / 缩放 / 移动控件。</p><div class="warning custom-block"><p class="custom-block-title">数据格式变更</p><p>0.0.18 起门槛数据由「中心线两点 + <code>height</code>」改为四角坐标(与主流厂商协议对齐)。传入两个点的旧数据会被丢弃并打一条 warn 日志,不再渲染;<code>controls.threshold.defaultHeight</code> 同时被移除。</p></div><p>新建门槛不用自己算四个角:<a href="/reference/methods.html#getthresholdpointsbyviewportcenter"><code>getThresholdPointsByViewportCenter()</code></a> 在当前视口中心生成一条门槛的角点,缺省 1m × 0.15m(长 × 厚),可传 <code>width</code> / <code>height</code> 覆盖。</p><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// 例:用户点「添加门槛」时在视口中心放一条默认尺寸的门槛</span></span>
|
|
308
|
+
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> points</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> await</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> mapApi.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">getThresholdPointsByViewportCenter</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">()</span></span>
|
|
309
|
+
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">setThresholds</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">([</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">...</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">thresholds, { id: </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">nextId</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(), points, type: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'passable'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }])</span></span></code></pre></div><div class="language-tsx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">tsx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> React, { useState } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 'react'</span></span>
|
|
308
310
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { RobotMap, ThresholdParam } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '@ray-js/robot-map'</span></span>
|
|
309
311
|
<span class="line"></span>
|
|
310
312
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> MapPage</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> () </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
|
@@ -312,11 +314,13 @@
|
|
|
312
314
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> const</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">thresholds</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">setThresholds</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> useState</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">ThresholdParam</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[]>([</span></span>
|
|
313
315
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
|
314
316
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> id: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'threshold1'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
317
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // 四角坐标:顶点 0→1 为长度方向,0→3 为厚度方向</span></span>
|
|
315
318
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> points: [</span></span>
|
|
316
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, y: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">
|
|
317
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">20</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, y: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">
|
|
319
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, y: </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">4</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
320
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">20</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, y: </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">4</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
321
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">20</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, y: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">4</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
322
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> { x: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, y: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">4</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
318
323
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ],</span></span>
|
|
319
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> height: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">20</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// 可选,缺省取 controls.threshold.defaultHeight</span></span>
|
|
320
324
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> type: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'impassable'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// 可选,缺省 'passable'</span></span>
|
|
321
325
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
322
326
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ])</span></span>
|
|
@@ -357,12 +361,11 @@
|
|
|
357
361
|
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> config</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{{</span></span>
|
|
358
362
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> controls: {</span></span>
|
|
359
363
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> threshold: {</span></span>
|
|
360
|
-
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> //
|
|
361
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> minLength: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0.
|
|
364
|
+
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // 长度与厚度的米区间(缩放到临界值即停)</span></span>
|
|
365
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> minLength: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0.4</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
362
366
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> maxLength: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">3</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
363
367
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> minHeight: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0.1</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
364
368
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> maxHeight: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0.4</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
365
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> defaultHeight: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0.2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
|
366
369
|
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // ... 其他配置见 config 参考</span></span>
|
|
367
370
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
368
371
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
|
@@ -1285,8 +1288,8 @@
|
|
|
1285
1288
|
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (mapApi) {</span></span>
|
|
1286
1289
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> mapApi.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">forceEndGesture</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">()</span></span>
|
|
1287
1290
|
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
|
1288
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><div class="tip custom-block"><p class="custom-block-title">提示</p><p>地图 SDK 内部已针对双指缩放时的快速松手做了防抖缓冲处理,搭配上述方案可获得最佳手势体验。</p></div></div></div></main><footer class="VPDocFooter" data-v-39a288b8 data-v-e257564d><!--[--><!--]--><div class="edit-info" data-v-e257564d><!----><div class="last-updated" data-v-e257564d><p class="VPLastUpdated" data-v-e257564d data-v-e98dd255>最后更新于: <time datetime="2026-
|
|
1289
|
-
<script>window.__VP_HASH_MAP__=JSON.parse("{\"
|
|
1291
|
+
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><div class="tip custom-block"><p class="custom-block-title">提示</p><p>地图 SDK 内部已针对双指缩放时的快速松手做了防抖缓冲处理,搭配上述方案可获得最佳手势体验。</p></div></div></div></main><footer class="VPDocFooter" data-v-39a288b8 data-v-e257564d><!--[--><!--]--><div class="edit-info" data-v-e257564d><!----><div class="last-updated" data-v-e257564d><p class="VPLastUpdated" data-v-e257564d data-v-e98dd255>最后更新于: <time datetime="2026-08-03T08:52:07.000Z" data-v-e98dd255></time></p></div></div><nav class="prev-next" aria-labelledby="doc-footer-aria-label" data-v-e257564d><span class="visually-hidden" id="doc-footer-aria-label" data-v-e257564d>Pager</span><div class="pager" data-v-e257564d><a class="VPLink link pager-link prev" href="/guide/getting-started.html" data-v-e257564d><!--[--><span class="desc" data-v-e257564d>Previous page</span><span class="title" data-v-e257564d>快速开始</span><!--]--></a></div><div class="pager" data-v-e257564d><!----></div></nav></footer><!--[--><!--]--></div></div></div><!--[--><!--]--></div></div><!----><!--[--><!--]--></div></div>
|
|
1292
|
+
<script>window.__VP_HASH_MAP__=JSON.parse("{\"guide_advanced-usage.md\":\"BsGRhEuG\",\"guide_concepts.md\":\"CJ87tk-r\",\"guide_getting-started.md\":\"DQIIL6ql\",\"guide_mcp.md\":\"BYlNOxMG\",\"guide_spot-room-binding.md\":\"CZGLnxCe\",\"index.md\":\"wTsFvv0N\",\"plans_2026-03-04-detected-objects-visibility-design.md\":\"Dqboot5W\",\"plans_2026-03-04-show-detected-objects-implementation-plan.md\":\"CDWwQtWj\",\"plans_2026-03-10-simulator-debug-design.md\":\"BZibn7uw\",\"plans_2026-03-10-simulator-events-console-design.md\":\"BVmEzCbR\",\"plans_2026-03-10-simulator-events-console-implementation-plan.md\":\"S2f1zs9-\",\"plans_2026-03-10-simulator-runtime-controls-design.md\":\"mqeNaYgg\",\"plans_2026-03-10-simulator-runtime-controls-implementation-plan.md\":\"BXG1UWFt\",\"plans_2026-03-10-testing-rollout-next-steps-plan.md\":\"CGR6uZic\",\"plans_2026-03-11-simulator-logger-dump-implementation-plan.md\":\"Ck5BGdoX\",\"reference_callbacks.md\":\"Cm_LNx97\",\"reference_config.md\":\"BslTlkKM\",\"reference_data.md\":\"jnSR7326\",\"reference_methods.md\":\"Cv8q9vtz\",\"reference_runtime.md\":\"BFQ83m1B\",\"reference_types.md\":\"ifmL7IbS\",\"reference_utils.md\":\"Dy6XKVWh\",\"simulator_index.md\":\"CF95Y_c9\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"Tuya Robot Map\",\"description\":\"涂鸦扫地机地图组件\",\"base\":\"/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"siteTitle\":\"Tuya Robot Map\",\"outline\":{\"level\":[2,6],\"label\":\"页面导航\"},\"nav\":[{\"text\":\"首页\",\"link\":\"/\"},{\"text\":\"指南\",\"link\":\"/guide/concepts\",\"activeMatch\":\"^/guide/\"},{\"text\":\"参考\",\"link\":\"/reference/data\",\"activeMatch\":\"^/reference/\"},{\"text\":\"模拟调试\",\"link\":\"/simulator/\",\"activeMatch\":\"^/simulator/\"}],\"sidebar\":{\"/guide/\":[{\"text\":\"指南\",\"items\":[{\"text\":\"基本概念\",\"link\":\"/guide/concepts\"},{\"text\":\"快速开始\",\"link\":\"/guide/getting-started\"},{\"text\":\"进阶使用\",\"link\":\"/guide/advanced-usage\"}]}],\"/reference/\":[{\"text\":\"组件Props\",\"items\":[{\"text\":\"数据\",\"link\":\"/reference/data\"},{\"text\":\"配置\",\"link\":\"/reference/config\"},{\"text\":\"运行时\",\"link\":\"/reference/runtime\"},{\"text\":\"地图事件回调\",\"link\":\"/reference/callbacks\"}]},{\"text\":\"方法\",\"items\":[{\"text\":\"地图方法\",\"link\":\"/reference/methods\"},{\"text\":\"工具方法\",\"link\":\"/reference/utils\"}]},{\"text\":\"类型定义\",\"items\":[{\"text\":\"类型定义\",\"link\":\"/reference/types\"}]}],\"/simulator/\":[{\"text\":\"模拟调试\",\"items\":[{\"text\":\"实时模拟调试\",\"link\":\"/simulator/\"}]}]},\"search\":{\"provider\":\"local\"},\"lastUpdated\":{\"text\":\"最后更新于\",\"formatOptions\":{\"dateStyle\":\"short\",\"timeStyle\":\"short\"}}},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
|
|
1290
1293
|
|
|
1291
1294
|
</body>
|
|
1292
1295
|
</html>
|