@aibee/crc-bmap 0.1.6 → 0.1.8
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/lib/bmap.cjs.min.js +3743 -28
- package/lib/bmap.cjs.min.js.map +4 -4
- package/lib/bmap.esm.js +1335 -237
- package/lib/bmap.esm.js.map +4 -4
- package/lib/bmap.esm.min.js +27 -27
- package/lib/bmap.esm.min.js.map +4 -4
- package/lib/bmap.min.js +28 -28
- package/lib/bmap.min.js.map +4 -4
- package/lib/src/elements/poi2.d.ts +1 -0
- package/lib/src/plugins/cr-nav-path/index.d.ts +1 -1
- package/lib/src/plugins/index.d.ts +1 -0
- package/lib/src/plugins/navigation/navigation.d.ts +21 -30
- package/lib/src/plugins/navigation/position-navigation.d.ts +72 -0
- package/lib/src/plugins/pdr-position/enum.d.ts +6 -0
- package/lib/src/plugins/pdr-position/imu-position.d.ts +56 -0
- package/lib/src/plugins/pdr-position/particle.d.ts +74 -0
- package/lib/src/plugins/pdr-position/pdr.d.ts +48 -0
- package/lib/src/plugins/pdr-position/position.d.ts +27 -0
- package/lib/src/plugins/{position → pdr-position}/sensor.d.ts +11 -6
- package/lib/src/plugins/pdr-position/utils.d.ts +21 -0
- package/lib/src/utils/road.d.ts +1 -0
- package/package.json +1 -1
- package/lib/src/plugins/position/particle.d.ts +0 -0
- package/lib/src/plugins/position/pdr.d.ts +0 -0
- package/lib/src/plugins/position/position.d.ts +0 -11
- /package/lib/src/plugins/cr-nav-path/{nav-path.d.ts → cr-nav-path.d.ts} +0 -0
- /package/lib/src/plugins/cr-nav-path/{path.worker.d.ts → cr-path.worker.d.ts} +0 -0
- /package/lib/src/plugins/{position → pdr-position}/index.d.ts +0 -0
|
@@ -30,6 +30,7 @@ export declare class Poi2 extends Object3D<PoiEventMap2> {
|
|
|
30
30
|
spriteIcon?: Sprite;
|
|
31
31
|
box: Box2;
|
|
32
32
|
boxHelper?: HTMLDivElement;
|
|
33
|
+
private _initIconPromise;
|
|
33
34
|
constructor(context: Context, options: PoiOptionsParam2);
|
|
34
35
|
get durIconAndText(): 2 | 0;
|
|
35
36
|
get offset(): 0 | 0.5;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './nav-path';
|
|
1
|
+
export * from './cr-nav-path';
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import { BMap } from "../../bmap";
|
|
2
2
|
import { Plugin } from "../base";
|
|
3
3
|
import { Path, PathConfig } from "./path";
|
|
4
|
-
import { PathData2, TweenUtil } from "../../utils";
|
|
4
|
+
import { PathData2, TweenUtil, PathData } from "../../utils";
|
|
5
5
|
import { Floor, Poi2, PoiOptions2 } from "../../elements";
|
|
6
|
-
import { PathDirection } from "../../utils/path";
|
|
7
6
|
import { Tween } from "@tweenjs/tween.js";
|
|
7
|
+
import { NavigationProcessInfo, PositionNavigation, PositionNavigationConfig } from "./position-navigation";
|
|
8
8
|
export type Point = [number, number];
|
|
9
|
-
export interface NavigationProcessInfo {
|
|
10
|
-
distance: number;
|
|
11
|
-
dir: PathDirection;
|
|
12
|
-
nextDirDistance: number;
|
|
13
|
-
pos: [number, number];
|
|
14
|
-
}
|
|
15
9
|
interface EventMap {
|
|
16
10
|
"fetch-road-status": {
|
|
17
11
|
status: boolean;
|
|
@@ -23,16 +17,23 @@ interface EventMap {
|
|
|
23
17
|
"render-path": {
|
|
24
18
|
path: Path;
|
|
25
19
|
};
|
|
26
|
-
"navigation-info":
|
|
20
|
+
"navigation-info": {
|
|
21
|
+
info: NavigationProcessInfo;
|
|
22
|
+
};
|
|
23
|
+
"add-path": {
|
|
24
|
+
paths: PathData2 | PathData;
|
|
25
|
+
};
|
|
27
26
|
}
|
|
28
27
|
export interface NavigationConfig {
|
|
29
28
|
path?: Partial<PathConfig>;
|
|
30
29
|
cheapMaximumDistance: number;
|
|
31
30
|
startPoi: Partial<PoiOptions2>;
|
|
31
|
+
positionNavigation: Partial<PositionNavigationConfig>;
|
|
32
32
|
needStartPoi: boolean;
|
|
33
33
|
offsetY: number;
|
|
34
34
|
directionEmitThreshold: number;
|
|
35
35
|
disablePathAnimation: boolean;
|
|
36
|
+
speed: number;
|
|
36
37
|
}
|
|
37
38
|
export declare class Navigation extends Plugin<EventMap> {
|
|
38
39
|
path: Path | null;
|
|
@@ -52,10 +53,16 @@ export declare class Navigation extends Plugin<EventMap> {
|
|
|
52
53
|
cPathIndex: number;
|
|
53
54
|
};
|
|
54
55
|
cPath: Point[];
|
|
56
|
+
positionNavigation: PositionNavigation;
|
|
57
|
+
pathMoving: boolean;
|
|
58
|
+
nextPoint: Point | null;
|
|
55
59
|
constructor(bmap: BMap, project?: string | Partial<NavigationConfig>, options?: Partial<NavigationConfig>);
|
|
56
60
|
get curFloorPathLength(): number;
|
|
57
61
|
get curFloorPathPoints(): [number, number][];
|
|
58
62
|
registryEvent(): void;
|
|
63
|
+
onNavigationInfo: ({ info }: {
|
|
64
|
+
info: NavigationProcessInfo;
|
|
65
|
+
}) => void;
|
|
59
66
|
pauseAnimation(): void;
|
|
60
67
|
continueAnimation(): void;
|
|
61
68
|
unRegistryEvent(): void;
|
|
@@ -72,32 +79,16 @@ export declare class Navigation extends Plugin<EventMap> {
|
|
|
72
79
|
translatePoints(points: Point[]): Point[];
|
|
73
80
|
renderPath(points: Point[]): void;
|
|
74
81
|
catmullRomCurve3(points: Point[]): [number, number][];
|
|
75
|
-
/**
|
|
76
|
-
* 按照指定速度移动到目标位置
|
|
77
|
-
* @param point 目标位置
|
|
78
|
-
* @param speed 移动速度 / 米/s
|
|
79
|
-
*/
|
|
80
|
-
animationTo(point: {
|
|
81
|
-
floor: string;
|
|
82
|
-
pos: [number, number];
|
|
83
|
-
}, speed: number): Promise<unknown>;
|
|
84
82
|
getPathDirection(): number | null;
|
|
85
83
|
changeCameraToPathUp(duration?: number): Promise<unknown>;
|
|
86
84
|
initNavigationCamera(): Promise<void>;
|
|
87
85
|
translateCameraToStartPoi(duration?: number): Promise<unknown>;
|
|
88
86
|
initCameraZoom(duration?: number): Promise<unknown>;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
} | null;
|
|
95
|
-
getRemainDistance(): number;
|
|
96
|
-
getNextDirDistance(): {
|
|
97
|
-
dir: PathDirection;
|
|
98
|
-
distance: number;
|
|
99
|
-
} | null;
|
|
100
|
-
private emitNavigationInfo;
|
|
87
|
+
toPosition(floor: string, pos: [number, number]): void;
|
|
88
|
+
startSimulation(): void;
|
|
89
|
+
setSimulationSpeed(speed: number): void;
|
|
90
|
+
toPositionBySpeed(position: [number, number], speed: number): Promise<void | null>;
|
|
91
|
+
moveDistance(distance: number, tween?: Tween<any>): Promise<void>;
|
|
101
92
|
setStartPoiRotate(rotate: number): void;
|
|
102
93
|
dispose(): void;
|
|
103
94
|
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { EventDispatcher } from "three";
|
|
2
|
+
import { Navigation } from "./navigation";
|
|
3
|
+
import { PathData, PathDirection, Timer, TweenUtil } from "../../utils";
|
|
4
|
+
import { Tween } from "@tweenjs/tween.js";
|
|
5
|
+
export interface PositionNavigationConfig {
|
|
6
|
+
offsetDistance: number;
|
|
7
|
+
offsetToResetTime: number;
|
|
8
|
+
directionEmitThreshold: number;
|
|
9
|
+
simulationSpeed: number;
|
|
10
|
+
}
|
|
11
|
+
export interface NavigationProcessInfo {
|
|
12
|
+
distance: number;
|
|
13
|
+
curRouteDistance: number;
|
|
14
|
+
nextDirDistance: number;
|
|
15
|
+
dir: PathDirection;
|
|
16
|
+
pos: [number, number];
|
|
17
|
+
routeIndex: number;
|
|
18
|
+
offset: boolean;
|
|
19
|
+
reset: boolean;
|
|
20
|
+
}
|
|
21
|
+
interface PositionNavigationEvent {
|
|
22
|
+
"navigation-info": {
|
|
23
|
+
info: NavigationProcessInfo;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export declare class PositionNavigation extends EventDispatcher<PositionNavigationEvent> {
|
|
27
|
+
navigation: Navigation;
|
|
28
|
+
offset: boolean;
|
|
29
|
+
reset: boolean;
|
|
30
|
+
position: [number, number];
|
|
31
|
+
routeIndex: number;
|
|
32
|
+
pointIndex: number;
|
|
33
|
+
paths: PathData;
|
|
34
|
+
options: PositionNavigationConfig;
|
|
35
|
+
timer: Timer;
|
|
36
|
+
resetTimer: number | null;
|
|
37
|
+
tweenUtil: TweenUtil;
|
|
38
|
+
simulationTween?: Tween<any>;
|
|
39
|
+
constructor(navigation: Navigation, options: Partial<PositionNavigationConfig>);
|
|
40
|
+
get curRoutePath(): PathData[0] | null;
|
|
41
|
+
get curRoutePathPoints(): [number, number][];
|
|
42
|
+
registryEvent(): void;
|
|
43
|
+
unRegistryEvent(): void;
|
|
44
|
+
onAddPaths: ({ paths }: {
|
|
45
|
+
paths: PathData;
|
|
46
|
+
}) => void;
|
|
47
|
+
onUpdate: () => void;
|
|
48
|
+
resetStatus(paths: PathData): void;
|
|
49
|
+
emitNavigationStatus(): void;
|
|
50
|
+
adsorb(floor: string, _position: [number, number]): {
|
|
51
|
+
distance: number;
|
|
52
|
+
closestPoint: [number, number];
|
|
53
|
+
routeIndex: number;
|
|
54
|
+
pointIndex: number;
|
|
55
|
+
} | null;
|
|
56
|
+
toPosition(floor: string, pos: [number, number]): void;
|
|
57
|
+
startSimulation(): void;
|
|
58
|
+
startCurRouteSimulation(): Promise<unknown>;
|
|
59
|
+
changeSimulationSpeed(speed: number): void;
|
|
60
|
+
getCurRouteRemainDistance(): number;
|
|
61
|
+
getRemainDistance(): {
|
|
62
|
+
total: number;
|
|
63
|
+
curRoute: number;
|
|
64
|
+
};
|
|
65
|
+
getNextDirDistance(): {
|
|
66
|
+
dir: PathDirection;
|
|
67
|
+
distance: number;
|
|
68
|
+
} | null;
|
|
69
|
+
private getNavigationInfo;
|
|
70
|
+
dispose(): void;
|
|
71
|
+
}
|
|
72
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export declare class ImuPosition {
|
|
2
|
+
private fre;
|
|
3
|
+
private accH_fifo;
|
|
4
|
+
private accH_time_fifo;
|
|
5
|
+
private accH_fifo_len;
|
|
6
|
+
private step_count;
|
|
7
|
+
private state_count;
|
|
8
|
+
private last_valley_time;
|
|
9
|
+
private last_peak_time;
|
|
10
|
+
private last_step_time;
|
|
11
|
+
private min_step_time;
|
|
12
|
+
private max_step_time;
|
|
13
|
+
private min_peak;
|
|
14
|
+
private max_valley;
|
|
15
|
+
private peak_num;
|
|
16
|
+
private valley_num;
|
|
17
|
+
private fft_min_amp;
|
|
18
|
+
private fft_min_fre;
|
|
19
|
+
private fft_max_fre;
|
|
20
|
+
private last_fft_amp;
|
|
21
|
+
private abnor_start_time;
|
|
22
|
+
private abnor_fft_detected;
|
|
23
|
+
private abnor_time_threshod;
|
|
24
|
+
private abnor_peak_time;
|
|
25
|
+
private abnor_peak_accH;
|
|
26
|
+
private const_step_length;
|
|
27
|
+
private last_rot;
|
|
28
|
+
private delta_rot;
|
|
29
|
+
private last_yaw;
|
|
30
|
+
private delta_yaw;
|
|
31
|
+
private delta_rot_sum_fifo;
|
|
32
|
+
private delta_rot_sum_time_fifo;
|
|
33
|
+
private delta_yaw_accum;
|
|
34
|
+
private delta_yaw_accum_timestamp;
|
|
35
|
+
private delta_yaw_time_threshold;
|
|
36
|
+
private last_px;
|
|
37
|
+
private last_py;
|
|
38
|
+
private delta_px;
|
|
39
|
+
private delta_py;
|
|
40
|
+
constructor();
|
|
41
|
+
private reset;
|
|
42
|
+
set_init_pose(pose?: [number, number]): void;
|
|
43
|
+
set_init_yaw(yaw?: number): void;
|
|
44
|
+
getPos(timestamp: number, acc: number[], rot: number[]): [number, number];
|
|
45
|
+
get_delta_pose(): [number, number];
|
|
46
|
+
getStepLength(timestamp: number, acc: number[]): number;
|
|
47
|
+
private imuFreUpdate;
|
|
48
|
+
private recheckState;
|
|
49
|
+
private PVstepDetec;
|
|
50
|
+
private FFTstepDetec;
|
|
51
|
+
private mean;
|
|
52
|
+
private rfft;
|
|
53
|
+
private getFrequencies;
|
|
54
|
+
getDeltaYaw_fromRot(timestamp: number, rot: number[]): number;
|
|
55
|
+
private limit_yaw;
|
|
56
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
interface Parameters {
|
|
2
|
+
NumParticle: number;
|
|
3
|
+
reSampNumParticle: number;
|
|
4
|
+
initial_xy_uncertainty: number;
|
|
5
|
+
initial_yaw_uncertainty: number;
|
|
6
|
+
step_noise_sigma: number;
|
|
7
|
+
yaw_noise_sigma: number;
|
|
8
|
+
compass_update_interval: number;
|
|
9
|
+
sigmaCompass: number;
|
|
10
|
+
delta_yaw: number;
|
|
11
|
+
sigmaBeacon: number;
|
|
12
|
+
unaccess_weight: number;
|
|
13
|
+
}
|
|
14
|
+
declare class ParticleFilter {
|
|
15
|
+
private NumParticle;
|
|
16
|
+
private reSampNumParticle;
|
|
17
|
+
private initial_xy_uncertainty;
|
|
18
|
+
private initial_yaw_uncertainty;
|
|
19
|
+
private step_noise_sigma;
|
|
20
|
+
private yaw_noise_sigma;
|
|
21
|
+
private compass_update_interval;
|
|
22
|
+
private sigmaCompass;
|
|
23
|
+
private delta_yaw;
|
|
24
|
+
private sigmaBeacon;
|
|
25
|
+
private unaccess_weight;
|
|
26
|
+
private particle_PosInitFlag;
|
|
27
|
+
private particle_yawInitFlag;
|
|
28
|
+
private xEst;
|
|
29
|
+
private particleX;
|
|
30
|
+
private particleWeight;
|
|
31
|
+
private last_compass_time;
|
|
32
|
+
constructor(parameters: Parameters);
|
|
33
|
+
/**
|
|
34
|
+
* motionModelRotYaw 更新粒子的航向角。
|
|
35
|
+
*/
|
|
36
|
+
motionModelRotYaw(delta_yaw: number): void;
|
|
37
|
+
/**
|
|
38
|
+
* motionModelStepLength 更新粒子的位移并处理不可达区域。
|
|
39
|
+
* @param step_len
|
|
40
|
+
* @param check_accessible
|
|
41
|
+
* @returns
|
|
42
|
+
*/
|
|
43
|
+
motionModelStepLength(step_len: number, check_accessible: (x: number, y: number) => boolean): void;
|
|
44
|
+
/**
|
|
45
|
+
* motionModelCompassYaw 根据罗盘的航向角更新粒子的权重。
|
|
46
|
+
* @param compass_yaw
|
|
47
|
+
* @param time
|
|
48
|
+
*/
|
|
49
|
+
motionModelCompassYaw(compass_yaw: number, time: number): void;
|
|
50
|
+
resampling(): void;
|
|
51
|
+
update(observe_pos: {
|
|
52
|
+
x: number;
|
|
53
|
+
y: number;
|
|
54
|
+
}, sigma_noise: number): void;
|
|
55
|
+
updateCar(observe_pos: {
|
|
56
|
+
x: number;
|
|
57
|
+
y: number;
|
|
58
|
+
}, sigma_noise: number): void;
|
|
59
|
+
getPosInitFlag(): boolean;
|
|
60
|
+
getYawInitFlag(): boolean;
|
|
61
|
+
setPosInitFlag(flag: boolean): void;
|
|
62
|
+
setYawInitFlag(flag: boolean): void;
|
|
63
|
+
getResultX(): number;
|
|
64
|
+
getResultY(): number;
|
|
65
|
+
getResultYaw(): number;
|
|
66
|
+
getEstConfidence(): number;
|
|
67
|
+
getParticleNum(): number;
|
|
68
|
+
getParticleX(): number[][];
|
|
69
|
+
setLastCompassTime(time: number): void;
|
|
70
|
+
getLastCompassTime(): number;
|
|
71
|
+
initParticlesByPos(x: number, y: number, check_accessable: (x: number, y: number) => boolean): void;
|
|
72
|
+
initParticlesByCompass(compass: number): void;
|
|
73
|
+
}
|
|
74
|
+
export { ParticleFilter };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { SensorData } from "./sensor";
|
|
2
|
+
export declare class PositioningSystem {
|
|
3
|
+
private particleFilter;
|
|
4
|
+
private pdr;
|
|
5
|
+
private sigmaBeacon;
|
|
6
|
+
private gps_horizontalAccuracy;
|
|
7
|
+
private using_gps;
|
|
8
|
+
private last_beacon_time;
|
|
9
|
+
private last_pos_time?;
|
|
10
|
+
private position_count;
|
|
11
|
+
private gps_max_horizontalAccuracy;
|
|
12
|
+
private MaxEstimateErr;
|
|
13
|
+
private outTrustRegionNum;
|
|
14
|
+
private TrustNum;
|
|
15
|
+
private cacheSensorData;
|
|
16
|
+
constructor();
|
|
17
|
+
/**
|
|
18
|
+
* 基于 PDR、iBeacon、罗盘和语义地图的粒子滤波器。
|
|
19
|
+
*
|
|
20
|
+
* 输入:
|
|
21
|
+
* sensorsData -- 来自手机的传感器读数,
|
|
22
|
+
* 包含加速度计、陀螺仪、罗盘、iBeacon。
|
|
23
|
+
* grid_map -- 离线生成的 iBeacon 网格地图。
|
|
24
|
+
*
|
|
25
|
+
* 输出:
|
|
26
|
+
* pxMesh, pyMesh -- 网格坐标中的位置。
|
|
27
|
+
*/
|
|
28
|
+
pfFusionPDRiBeacon(sensorData: SensorData): [boolean, number, number];
|
|
29
|
+
/**
|
|
30
|
+
* 根据服务端返回的beacon定位结果,重新设置pdr
|
|
31
|
+
* @param pos { x: number, y: number } 定位结果
|
|
32
|
+
* @param time { number } 开始定位的时间戳
|
|
33
|
+
*/
|
|
34
|
+
setBeaconPosition(pos: {
|
|
35
|
+
x: number;
|
|
36
|
+
y: number;
|
|
37
|
+
}, time: number): number[];
|
|
38
|
+
/**
|
|
39
|
+
* 根据gps数据获取定位
|
|
40
|
+
* @param data
|
|
41
|
+
* @returns
|
|
42
|
+
*/
|
|
43
|
+
getGpsPosition(data: [number, number, number]): null | {
|
|
44
|
+
x: number;
|
|
45
|
+
y: number;
|
|
46
|
+
};
|
|
47
|
+
private resetParticleFilterDist;
|
|
48
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { EventDispatcher } from "three";
|
|
2
|
+
import { PositioningSystem } from "./pdr";
|
|
3
|
+
import { Sensor, SensorOptions } from "./sensor";
|
|
4
|
+
export interface PdrPositionOptions {
|
|
5
|
+
sensor?: Partial<SensorOptions>;
|
|
6
|
+
}
|
|
7
|
+
interface PdrPositionEventMap {
|
|
8
|
+
position: {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export declare class PdrPosition extends EventDispatcher<PdrPositionEventMap> {
|
|
14
|
+
sensor: Sensor;
|
|
15
|
+
pdr: PositioningSystem;
|
|
16
|
+
constructor(options?: PdrPositionOptions);
|
|
17
|
+
checkSensor(): Promise<{
|
|
18
|
+
deviceOrientation: boolean;
|
|
19
|
+
}>;
|
|
20
|
+
start(): void;
|
|
21
|
+
setBeaconPosition(pos: {
|
|
22
|
+
x: number;
|
|
23
|
+
y: number;
|
|
24
|
+
}, time: number): void;
|
|
25
|
+
dispose(): void;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -1,36 +1,40 @@
|
|
|
1
1
|
import { Timer } from "../../utils";
|
|
2
2
|
import { EventDispatcher } from "three";
|
|
3
|
+
import { SENSOR_TYPE } from "./enum";
|
|
3
4
|
interface SensorEventMap {
|
|
4
5
|
"start": {};
|
|
5
6
|
"stop": {};
|
|
6
7
|
"sensor-data": {
|
|
7
8
|
data: SensorData[];
|
|
8
9
|
};
|
|
10
|
+
"add-data-item": {
|
|
11
|
+
item: SensorData;
|
|
12
|
+
};
|
|
9
13
|
}
|
|
10
14
|
interface DeviceMotionData {
|
|
11
|
-
type:
|
|
15
|
+
type: SENSOR_TYPE.DEVICE_MOTION;
|
|
12
16
|
timestamp: number;
|
|
13
17
|
res: [number, number, number];
|
|
14
18
|
}
|
|
15
19
|
interface AccelerationData {
|
|
16
|
-
type:
|
|
20
|
+
type: SENSOR_TYPE.ACCELERATION;
|
|
17
21
|
timestamp: number;
|
|
18
22
|
res: [number, number, number];
|
|
19
23
|
}
|
|
20
24
|
interface GpsData {
|
|
21
|
-
type:
|
|
25
|
+
type: SENSOR_TYPE.GPS;
|
|
22
26
|
timestamp: number;
|
|
23
27
|
res: [number, number, number];
|
|
24
28
|
}
|
|
25
29
|
interface CompassData {
|
|
26
|
-
type:
|
|
30
|
+
type: SENSOR_TYPE.COMPASS;
|
|
27
31
|
timestamp: number;
|
|
28
32
|
res: number;
|
|
29
33
|
}
|
|
30
|
-
type SensorData = DeviceMotionData | AccelerationData | GpsData | CompassData;
|
|
34
|
+
export type SensorData = DeviceMotionData | AccelerationData | GpsData | CompassData;
|
|
31
35
|
export interface SensorOptions {
|
|
32
36
|
time: number;
|
|
33
|
-
elements:
|
|
37
|
+
elements: SENSOR_TYPE[];
|
|
34
38
|
}
|
|
35
39
|
export declare class Sensor extends EventDispatcher<SensorEventMap> {
|
|
36
40
|
options: SensorOptions;
|
|
@@ -40,6 +44,7 @@ export declare class Sensor extends EventDispatcher<SensorEventMap> {
|
|
|
40
44
|
dispatchTimer: number | null;
|
|
41
45
|
constructor(options?: Partial<SensorOptions>);
|
|
42
46
|
start(): void;
|
|
47
|
+
addDataItem(item: SensorData): void;
|
|
43
48
|
addDeviceMotion: import("lodash").DebouncedFunc<(data: DeviceMotionData) => void>;
|
|
44
49
|
addAcceleration: import("lodash").DebouncedFunc<(data: AccelerationData) => void>;
|
|
45
50
|
deviceOrientationAbsHandler: (e: DeviceOrientationEvent) => void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 计算输入测量的高斯概率。
|
|
3
|
+
* 输入:
|
|
4
|
+
* avg -- 测量误差。
|
|
5
|
+
* std -- 测量的标准差。
|
|
6
|
+
* 输出:
|
|
7
|
+
* p -- 高斯概率。
|
|
8
|
+
*/
|
|
9
|
+
export declare function gaussLikelihood(avg: number, std: number): number;
|
|
10
|
+
export declare function limitYaw(yaw: number): number;
|
|
11
|
+
/**
|
|
12
|
+
* wgs84坐标转web墨卡托坐标
|
|
13
|
+
* @param lon 经度
|
|
14
|
+
* @param lat 纬度
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
17
|
+
export declare function wgs84ToWebMercator(lon: number, lat: number): {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
};
|
|
21
|
+
export declare function euclideanDist(x1: number, y1: number, x2: number, y2: number): number;
|
package/lib/src/utils/road.d.ts
CHANGED
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Sensor, SensorOptions } from "./sensor";
|
|
2
|
-
export interface PdrPositionOptions {
|
|
3
|
-
sensor?: Partial<SensorOptions>;
|
|
4
|
-
}
|
|
5
|
-
export declare class PdrPosition {
|
|
6
|
-
sensor: Sensor;
|
|
7
|
-
constructor(options?: PdrPositionOptions);
|
|
8
|
-
checkSensor(): Promise<{
|
|
9
|
-
deviceOrientation: boolean;
|
|
10
|
-
}>;
|
|
11
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|