dumon-geolocation/.history/README_20250614152201.md

130 lines
3.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# dumon-geolocation
Implement manager GNSS, WiFi RTT, IMU, Kalman fusion, event emitter
## Install
```bash
npm install dumon-geolocation
npx cap sync
```
## API
<docgen-index>
* [`startPositioning()`](#startpositioning)
* [`stopPositioning()`](#stoppositioning)
* [`getLatestPosition()`](#getlatestposition)
* [`addListener('onPositionUpdate', ...)`](#addlisteneronpositionupdate-)
* [Interfaces](#interfaces)
</docgen-index>
<docgen-api>
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
### startPositioning()
```typescript
startPositioning() => Promise<void>
```
--------------------
### stopPositioning()
```typescript
stopPositioning() => Promise<void>
```
--------------------
### getLatestPosition()
```typescript
getLatestPosition() => Promise<PositioningData>
```
**Returns:** <code>Promise&lt;<a href="#positioningdata">PositioningData</a>&gt;</code>
--------------------
### addListener('onPositionUpdate', ...)
```typescript
addListener(eventName: 'onPositionUpdate', listenerFunc: (data: PositioningData) => void) => PluginListenerHandle
```
| Param | Type |
| ------------------ | ------------------------------------------------------------------------------ |
| **`eventName`** | <code>'onPositionUpdate'</code> |
| **`listenerFunc`** | <code>(data: <a href="#positioningdata">PositioningData</a>) =&gt; void</code> |
**Returns:** <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
--------------------
### Interfaces
#### PositioningData
| Prop | Type |
| --------------- | ----------------------------------------------------------- |
| **`source`** | <code>'GNSS' \| 'WIFI' \| 'FUSED' \| 'MOCK'</code> |
| **`timestamp`** | <code>number</code> |
| **`latitude`** | <code>number</code> |
| **`longitude`** | <code>number</code> |
| **`accuracy`** | <code>number</code> |
| **`gnssData`** | <code><a href="#satellitestatus">SatelliteStatus</a></code> |
| **`wifiData`** | <code>WifiAp[]</code> |
| **`imuData`** | <code><a href="#imudata">ImuData</a></code> |
#### SatelliteStatus
| Prop | Type |
| ------------------------- | --------------------------------------- |
| **`satellitesInView`** | <code>number</code> |
| **`usedInFix`** | <code>number</code> |
| **`constellationCounts`** | <code>{ [key: string]: number; }</code> |
#### WifiAp
| Prop | Type |
| -------------- | ------------------- |
| **`ssid`** | <code>string</code> |
| **`bssid`** | <code>string</code> |
| **`rssi`** | <code>number</code> |
| **`distance`** | <code>number</code> |
#### ImuData
| Prop | Type |
| ------------------ | ------------------- |
| **`accelX`** | <code>number</code> |
| **`accelY`** | <code>number</code> |
| **`accelZ`** | <code>number</code> |
| **`gyroX`** | <code>number</code> |
| **`gyroY`** | <code>number</code> |
| **`gyroZ`** | <code>number</code> |
| **`speed`** | <code>number</code> |
| **`acceleration`** | <code>number</code> |
| **`directionRad`** | <code>number</code> |
#### PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| **`remove`** | <code>() =&gt; Promise&lt;void&gt;</code> |
</docgen-api>