@ray-js/robot-map-sdk 0.0.3-beta-54 → 0.0.3-beta-56

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.
Files changed (33) hide show
  1. package/dist/constant/methods.js +1 -1
  2. package/dist/index.d.ts +101 -11
  3. package/dist/index.rjs.js +1 -1
  4. package/dist-app/assets/{index-CSMJdqyh.js → index-i46MbckZ.js} +1 -1
  5. package/dist-app/index.html +1 -1
  6. package/dist-docs/404.html +2 -2
  7. package/dist-docs/assets/{app.CJpB5cZe.js → app.DMzJUpqg.js} +1 -1
  8. package/dist-docs/assets/chunks/@localSearchIndexroot.Dxh5fsqc.js +1 -0
  9. package/dist-docs/assets/chunks/{VPLocalSearchBox.BFOgcktC.js → VPLocalSearchBox.HEVPP9qv.js} +1 -1
  10. package/dist-docs/assets/chunks/{theme.DsuVIOUN.js → theme.BwkK5uAQ.js} +2 -2
  11. package/dist-docs/assets/{guide_getting-started.md.BJ4o-pZB.js → guide_getting-started.md.BmubsPCJ.js} +1 -1
  12. package/dist-docs/assets/{reference_methods.md.DxIWUIJ-.js → reference_methods.md.Cl2prV6n.js} +57 -3
  13. package/dist-docs/assets/reference_methods.md.Cl2prV6n.lean.js +1 -0
  14. package/dist-docs/assets/reference_runtime.md.DnKqKiB4.js +19 -0
  15. package/dist-docs/assets/reference_runtime.md.DnKqKiB4.lean.js +1 -0
  16. package/dist-docs/guide/advanced-usage.html +3 -3
  17. package/dist-docs/guide/concepts.html +3 -3
  18. package/dist-docs/guide/getting-started.html +5 -5
  19. package/dist-docs/hashmap.json +1 -1
  20. package/dist-docs/index.html +3 -3
  21. package/dist-docs/reference/callbacks.html +3 -3
  22. package/dist-docs/reference/config.html +3 -3
  23. package/dist-docs/reference/data.html +3 -3
  24. package/dist-docs/reference/methods.html +60 -6
  25. package/dist-docs/reference/runtime.html +5 -5
  26. package/dist-docs/reference/types.html +3 -3
  27. package/dist-docs/reference/utils.html +3 -3
  28. package/package.json +1 -1
  29. package/dist-docs/assets/chunks/@localSearchIndexroot.CqRxXKBy.js +0 -1
  30. package/dist-docs/assets/reference_methods.md.DxIWUIJ-.lean.js +0 -1
  31. package/dist-docs/assets/reference_runtime.md.DjYqXfXl.js +0 -19
  32. package/dist-docs/assets/reference_runtime.md.DjYqXfXl.lean.js +0 -1
  33. /package/dist-docs/assets/{guide_getting-started.md.BJ4o-pZB.lean.js → guide_getting-started.md.BmubsPCJ.lean.js} +0 -0
@@ -1 +1 @@
1
- const e=["areRoomsAdjacent","getForbiddenSweepZones","getForbiddenMopZones","getCleanZones","getVirtualWalls","getSpots","getWayPoints","getViewportCenterPoint","getMapCenterPoint","getWallPointsByViewportCenter","getForbiddenSweepZonePointsByViewportCenter","getForbiddenMopZonePointsByViewportCenter","getCleanZonePointsByViewportCenter","getSpotPointByViewportCenter","getEffectiveDividerPoints","getDividerEndPoints","isNearChargerOrRobot","isPointInAnyRoom","resetPanZoom","snapshot","snapshotByData"],o=["onMapFirstDrawed","onMapDrawed","onPathDrawed","onRoomPropertiesDrawed","onClickRoom","onClickRoomProperties","onRemoveForbiddenSweepZone","onRemoveForbiddenMopZone","onRemoveCleanZone","onRemoveVirtualWall","onUpdateForbiddenSweepZone","onUpdateForbiddenMopZone","onUpdateCleanZone","onUpdateVirtualWall","onUpdateSpot","onUpdateWayPoint","onUpdateDivider","onClickForbiddenSweepZone","onClickForbiddenMopZone","onClickCleanZone","onClickVirtualWall","onClickSpot","onClickWayPoint","onClickDetectedObject","onClickCustomElement","onClickMap"];export{e as MAP_API_METHODS,o as MAP_CALLBACK_METHODS};
1
+ const e=["areRoomsAdjacent","getForbiddenSweepZones","getForbiddenMopZones","getCleanZones","getVirtualWalls","getSpots","getWayPoints","getViewportCenterPoint","getMapCenterPoint","getWallPointsByViewportCenter","getForbiddenSweepZonePointsByViewportCenter","getForbiddenMopZonePointsByViewportCenter","getCleanZonePointsByViewportCenter","getSpotPointByViewportCenter","getEffectiveDividerPoints","getDividerEndPoints","isNearChargerOrRobot","isPointInAnyRoom","isWallIntersectsAnyRoom","isZoneIntersectsAnyRoom","resetPanZoom","snapshot","snapshotByData"],o=["onMapFirstDrawed","onMapDrawed","onPathDrawed","onRoomPropertiesDrawed","onClickRoom","onClickRoomProperties","onRemoveForbiddenSweepZone","onRemoveForbiddenMopZone","onRemoveCleanZone","onRemoveVirtualWall","onUpdateForbiddenSweepZone","onUpdateForbiddenMopZone","onUpdateCleanZone","onUpdateVirtualWall","onUpdateSpot","onUpdateWayPoint","onUpdateDivider","onClickForbiddenSweepZone","onClickForbiddenMopZone","onClickCleanZone","onClickVirtualWall","onClickSpot","onClickWayPoint","onClickDetectedObject","onClickCustomElement","onClickMap"];export{e as MAP_API_METHODS,o as MAP_CALLBACK_METHODS};
package/dist/index.d.ts CHANGED
@@ -1500,7 +1500,13 @@ declare class Interaction extends Container {
1500
1500
  private debouncedLogWheelScale;
1501
1501
  private interactionState;
1502
1502
  private throttledAntiScale;
1503
+ private unsubscribeEnableInteraction;
1503
1504
  constructor();
1505
+ /**
1506
+ * 更新交互模式
1507
+ * @param enabled 是否启用交互
1508
+ */
1509
+ private updateInteractionMode;
1504
1510
  setupInteraction(): void;
1505
1511
  resetPan(targetPosition: {
1506
1512
  x: number;
@@ -1587,7 +1593,7 @@ declare type Managers = {
1587
1593
  roomsManager: RoomManager;
1588
1594
  };
1589
1595
 
1590
- export declare const MAP_API_METHODS: readonly ["areRoomsAdjacent", "getForbiddenSweepZones", "getForbiddenMopZones", "getCleanZones", "getVirtualWalls", "getSpots", "getWayPoints", "getViewportCenterPoint", "getMapCenterPoint", "getWallPointsByViewportCenter", "getForbiddenSweepZonePointsByViewportCenter", "getForbiddenMopZonePointsByViewportCenter", "getCleanZonePointsByViewportCenter", "getSpotPointByViewportCenter", "getEffectiveDividerPoints", "getDividerEndPoints", "isNearChargerOrRobot", "isPointInAnyRoom", "resetPanZoom", "snapshot", "snapshotByData"];
1596
+ export declare const MAP_API_METHODS: readonly ["areRoomsAdjacent", "getForbiddenSweepZones", "getForbiddenMopZones", "getCleanZones", "getVirtualWalls", "getSpots", "getWayPoints", "getViewportCenterPoint", "getMapCenterPoint", "getWallPointsByViewportCenter", "getForbiddenSweepZonePointsByViewportCenter", "getForbiddenMopZonePointsByViewportCenter", "getCleanZonePointsByViewportCenter", "getSpotPointByViewportCenter", "getEffectiveDividerPoints", "getDividerEndPoints", "isNearChargerOrRobot", "isPointInAnyRoom", "isWallIntersectsAnyRoom", "isZoneIntersectsAnyRoom", "resetPanZoom", "snapshot", "snapshotByData"];
1591
1597
 
1592
1598
  export declare const MAP_CALLBACK_METHODS: readonly ["onMapFirstDrawed", "onMapDrawed", "onPathDrawed", "onRoomPropertiesDrawed", "onClickRoom", "onClickRoomProperties", "onRemoveForbiddenSweepZone", "onRemoveForbiddenMopZone", "onRemoveCleanZone", "onRemoveVirtualWall", "onUpdateForbiddenSweepZone", "onUpdateForbiddenMopZone", "onUpdateCleanZone", "onUpdateVirtualWall", "onUpdateSpot", "onUpdateWayPoint", "onUpdateDivider", "onClickForbiddenSweepZone", "onClickForbiddenMopZone", "onClickCleanZone", "onClickVirtualWall", "onClickSpot", "onClickWayPoint", "onClickDetectedObject", "onClickCustomElement", "onClickMap"];
1593
1599
 
@@ -1772,14 +1778,36 @@ export declare interface MapApi {
1772
1778
  /**
1773
1779
  * 判断一个点是否在任意房间内
1774
1780
  *
1775
- * 接受原点坐标系的点(相对于origin的坐标),遍历所有房间,
1781
+ * 接受机器坐标系的点(相对于origin的坐标),遍历所有房间,
1776
1782
  * 判断该点是否在某个房间内。支持结构化地图和点阵地图两种协议。
1777
- * 方法内部会自动将原点坐标系转换为地图坐标系进行检测。
1783
+ * 方法内部会自动将机器坐标系转换为地图坐标系进行检测。
1778
1784
  *
1779
- * @param point - 待检测的点坐标(原点坐标系,与Zone、VirtualWall等使用相同的坐标系)
1785
+ * @param point - 待检测的点坐标(机器坐标系,与Zone、VirtualWall等使用相同的坐标系)
1780
1786
  * @returns 如果点在某个房间内,返回该房间的RoomData;否则返回null
1781
1787
  */
1782
1788
  isPointInAnyRoom(point: Point): RoomData | null;
1789
+ /**
1790
+ * 判断墙体(线段)是否与任意房间有交集
1791
+ *
1792
+ * 接受机器坐标系的墙体端点(相对于origin的坐标),遍历所有房间,
1793
+ * 判断墙体是否与某个房间有交集。支持结构化地图和点阵地图两种协议。
1794
+ * 方法内部会自动将机器坐标系转换为地图坐标系进行检测。
1795
+ *
1796
+ * @param points - 墙体的两个端点坐标(机器坐标系,与VirtualWall等使用相同的坐标系)
1797
+ * @returns 如果有交集返回 true,否则返回 false
1798
+ */
1799
+ isWallIntersectsAnyRoom(points: [Point, Point]): boolean;
1800
+ /**
1801
+ * 判断区域(矩形)是否与任意房间有交集
1802
+ *
1803
+ * 接受机器坐标系的区域顶点(相对于origin的坐标),遍历所有房间,
1804
+ * 判断区域是否与某个房间有交集。支持结构化地图和点阵地图两种协议。
1805
+ * 方法内部会自动将机器坐标系转换为地图坐标系进行检测。
1806
+ *
1807
+ * @param points - 区域的四个顶点坐标(机器坐标系,与Zone等使用相同的坐标系)
1808
+ * @returns 如果有交集返回 true,否则返回 false
1809
+ */
1810
+ isZoneIntersectsAnyRoom(points: [Point, Point, Point, Point]): boolean;
1783
1811
  /**
1784
1812
  * 地图截图
1785
1813
  *
@@ -2177,22 +2205,46 @@ declare class MapApplication extends Application implements MapApi {
2177
2205
  /**
2178
2206
  * 判断一个点是否在任意房间内
2179
2207
  *
2180
- * 接受原点坐标系的点(相对于origin的坐标),遍历所有房间,
2208
+ * 接受机器坐标系的点(相对于origin的坐标),遍历所有房间,
2181
2209
  * 判断该点是否在某个房间内。支持结构化地图和点阵地图两种协议。
2182
- * 方法内部会自动将原点坐标系转换为地图坐标系进行检测。
2210
+ * 方法内部会自动将机器坐标系转换为地图坐标系进行检测。
2183
2211
  *
2184
- * @param point - 待检测的点坐标(原点坐标系,与Zone、VirtualWall等使用相同的坐标系)
2212
+ * @param point - 待检测的点坐标(机器坐标系,与Zone、VirtualWall等使用相同的坐标系)
2185
2213
  * @returns 如果点在某个房间内,返回该房间的RoomData;否则返回null
2186
2214
  *
2187
2215
  */
2188
2216
  isPointInAnyRoom(point: Point): RoomData | null;
2217
+ /**
2218
+ * 判断墙体(线段)是否与任意房间有交集
2219
+ *
2220
+ * 接受机器坐标系的墙体端点(相对于origin的坐标),遍历所有房间,
2221
+ * 判断墙体是否与某个房间有交集。支持结构化地图和点阵地图两种协议。
2222
+ * 方法内部会自动将机器坐标系转换为地图坐标系进行检测。
2223
+ *
2224
+ * @param points - 墙体的两个端点坐标(机器坐标系,与VirtualWall等使用相同的坐标系)
2225
+ * @returns 如果有交集返回 true,否则返回 false
2226
+ *
2227
+ */
2228
+ isWallIntersectsAnyRoom(points: Point[]): boolean;
2229
+ /**
2230
+ * 判断区域(矩形)是否与任意房间有交集
2231
+ *
2232
+ * 接受机器坐标系的区域顶点(相对于origin的坐标),遍历所有房间,
2233
+ * 判断区域是否与某个房间有交集。支持结构化地图和点阵地图两种协议。
2234
+ * 方法内部会自动将机器坐标系转换为地图坐标系进行检测。
2235
+ *
2236
+ * @param points - 区域的四个顶点坐标(机器坐标系,与Zone等使用相同的坐标系)
2237
+ * @returns 如果有交集返回 true,否则返回 false
2238
+ *
2239
+ */
2240
+ isZoneIntersectsAnyRoom(points: Point[]): boolean;
2189
2241
  /**
2190
2242
  * 判断点、墙体或区域是否距离充电桩或机器人位置过近
2191
2243
  *
2192
2244
  * 根据给定的坐标集合(点1个、墙体2个点或区域4个点)和判定阈值,
2193
2245
  * 计算其与充电桩和/或机器人位置的最小距离,判断是否在阈值范围内。
2194
2246
  *
2195
- * @param points - 点(1个)、墙体(2个点)或区域(4个点)的坐标集合(原点坐标系)
2247
+ * @param points - 点(1个)、墙体(2个点)或区域(4个点)的坐标集合(机器坐标系)
2196
2248
  * @param thresholdMeters - 判定阈值,单位为米
2197
2249
  * @param options - 配置选项
2198
2250
  * @param options.checkCharger - 是否检查与充电桩的距离,默认为 true
@@ -2520,7 +2572,7 @@ export declare interface MapCallbacks {
2520
2572
  * 地图点击回调
2521
2573
  *
2522
2574
  * 当启用地图点击捕获(enableMapClickCapture)后,用户点击地图时触发。
2523
- * 返回点击位置的地图坐标(基于原点坐标系)。
2575
+ * 返回点击位置的地图坐标(基于机器坐标系)。
2524
2576
  *
2525
2577
  * @param point - 点击位置的地图坐标
2526
2578
  *
@@ -3243,6 +3295,42 @@ declare class RoomFill extends Container {
3243
3295
  * 获取地图宽度(用于像素索引转换)
3244
3296
  */
3245
3297
  getMapWidth(): number;
3298
+ /**
3299
+ * 判断墙体(线段)是否与任意房间有交集
3300
+ * @param points 墙体的两个端点坐标(机器坐标系)
3301
+ * @returns 如果有交集返回 true,否则返回 false
3302
+ */
3303
+ isWallIntersectsAnyRoom(points: Point[]): boolean;
3304
+ /**
3305
+ * 判断区域(矩形)是否与任意房间有交集
3306
+ * @param points 区域的四个顶点坐标(机器坐标系)
3307
+ * @returns 如果有交集返回 true,否则返回 false
3308
+ */
3309
+ isZoneIntersectsAnyRoom(points: Point[]): boolean;
3310
+ /**
3311
+ * 栅格地图:判断线段是否与任意房间有交集
3312
+ */
3313
+ private isWallIntersectsAnyRoomRaster;
3314
+ /**
3315
+ * 结构化地图:判断线段是否与任意房间有交集
3316
+ */
3317
+ private isWallIntersectsAnyRoomStructured;
3318
+ /**
3319
+ * 栅格地图:判断矩形是否与任意房间有交集
3320
+ */
3321
+ private isZoneIntersectsAnyRoomRaster;
3322
+ /**
3323
+ * 结构化地图:判断矩形是否与任意房间有交集
3324
+ */
3325
+ private isZoneIntersectsAnyRoomStructured;
3326
+ /**
3327
+ * 获取线段覆盖的像素点索引
3328
+ */
3329
+ private getLinePixels;
3330
+ /**
3331
+ * 获取矩形覆盖的像素点索引
3332
+ */
3333
+ private getZonePixels;
3246
3334
  /**
3247
3335
  * 清除所有房间
3248
3336
  */
@@ -3371,6 +3459,10 @@ export declare type RuntimeConfig = {
3371
3459
  * 进入房间选择模式后,房间颜色会根据selectRoomIds是否包含该房间ID来变化
3372
3460
  */
3373
3461
  enableRoomSelection: boolean
3462
+ /** 是否启用交互 */
3463
+ enableInteraction: boolean
3464
+ /** 启用地图点击坐标捕获 */
3465
+ enableMapClickCapture: boolean
3374
3466
  /** 正在编辑的禁扫区域ID列表 */
3375
3467
  editingForbiddenSweepZoneIds: string[]
3376
3468
  /** 正在编辑的禁拖区域ID列表 */
@@ -3383,8 +3475,6 @@ export declare type RuntimeConfig = {
3383
3475
  editingSpotIds: string[]
3384
3476
  /** 正在编辑的途径点ID列表 */
3385
3477
  editingWayPointIds: string[]
3386
- /** 启用地图点击坐标捕获 */
3387
- enableMapClickCapture: boolean
3388
3478
  /** 地图旋转角度(度) */
3389
3479
  mapRotation: number
3390
3480
  /** 房间属性折叠的房间ID列表 */