@doorstepai/dropoff-sdk 2.0.3 → 2.0.6
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/android/build.gradle +1 -1
- package/android/src/main/java/com/doorstepai/dropoffsdk/DoorstepAIModule.kt +29 -57
- package/ios/DoorstepAI.mm +12 -5
- package/ios/DoorstepAI.swift +41 -20
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/DoorstepDropoffSDK.framework/DoorstepDropoffSDK +0 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/DoorstepDropoffSDK.framework/Headers/DoorstepDropoffSDK.h +1 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/DoorstepDropoffSDK.framework/Headers/RateReducer.h +117 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/DoorstepDropoffSDK.framework/Info.plist +0 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/arm64-apple-ios.abi.json +1248 -261
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +13 -11
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/arm64-apple-ios.swiftinterface +13 -11
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/DoorstepDropoffSDK.framework/_CodeSignature/CodeResources +24 -13
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/dSYMs/DoorstepDropoffSDK.framework.dSYM/Contents/Resources/DWARF/DoorstepDropoffSDK +0 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64/dSYMs/DoorstepDropoffSDK.framework.dSYM/Contents/Resources/Relocations/aarch64/DoorstepDropoffSDK.yml +2105 -1583
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/DoorstepDropoffSDK +0 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Headers/DoorstepDropoffSDK.h +1 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Headers/RateReducer.h +117 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Info.plist +0 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +1248 -261
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +13 -11
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +13 -11
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +1248 -261
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +13 -11
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/Modules/DoorstepDropoffSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +13 -11
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/DoorstepDropoffSDK.framework/_CodeSignature/CodeResources +34 -23
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/DoorstepDropoffSDK.framework.dSYM/Contents/Resources/DWARF/DoorstepDropoffSDK +0 -0
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/DoorstepDropoffSDK.framework.dSYM/Contents/Resources/Relocations/aarch64/DoorstepDropoffSDK.yml +2105 -1583
- package/ios/DoorstepDropoffSDK.xcframework/ios-arm64_x86_64-simulator/dSYMs/DoorstepDropoffSDK.framework.dSYM/Contents/Resources/Relocations/x86_64/DoorstepDropoffSDK.yml +2095 -1578
- package/lib/module/DoorstepAI.js +90 -19
- package/lib/module/DoorstepAI.js.map +1 -1
- package/lib/module/RootDoorstepAI.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/DoorstepAI.d.ts +61 -6
- package/lib/typescript/src/DoorstepAI.d.ts.map +1 -1
- package/lib/typescript/src/RootDoorstepAI.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/DoorstepAI.tsx +252 -47
- package/src/RootDoorstepAI.tsx +0 -1
- package/src/index.tsx +6 -1
|
Binary file
|
|
@@ -14,5 +14,6 @@ FOUNDATION_EXPORT double DoorstepDropoffSDKVersionNumber;
|
|
|
14
14
|
FOUNDATION_EXPORT const unsigned char DoorstepDropoffSDKVersionString[];
|
|
15
15
|
|
|
16
16
|
// In this header, you should import all the public headers of your framework using statements like #import <DoorstepDropoffSDK/PublicHeader.h>
|
|
17
|
+
#import <DoorstepDropoffSDK/RateReducer.h>
|
|
17
18
|
|
|
18
19
|
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file RateReducer.h
|
|
3
|
+
*
|
|
4
|
+
* Pure-C IMU rate reducer — port of the strapdown coning/sculling algorithm
|
|
5
|
+
* in the legacy C++ RateReducer. Designed for integration into the
|
|
6
|
+
* DoorstepDropoffSDK sensor pipeline via SensorRateReducer.swift.
|
|
7
|
+
*
|
|
8
|
+
* Channel treatment:
|
|
9
|
+
* - rotationRate / rawGyro → coning-corrected integration (delta-angle)
|
|
10
|
+
* - accel / userAccel → sculling-corrected integration (delta-velocity)
|
|
11
|
+
* - gravity / roll,pitch,yaw → simple per-sample average over the epoch
|
|
12
|
+
* - mag / heading / proximity → latest-value pass-through
|
|
13
|
+
*
|
|
14
|
+
* NOT compiled into the Xcode target by default; add RateReducer.c to the
|
|
15
|
+
* framework target if you want to call these functions from Objective-C.
|
|
16
|
+
* The active Swift implementation in SensorRateReducer.swift mirrors this
|
|
17
|
+
* code exactly and requires no project-file changes.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
#pragma once
|
|
21
|
+
#include <stdbool.h>
|
|
22
|
+
|
|
23
|
+
#ifdef __cplusplus
|
|
24
|
+
extern "C" {
|
|
25
|
+
#endif
|
|
26
|
+
|
|
27
|
+
typedef struct { double x, y, z; } rr_vec3_t;
|
|
28
|
+
|
|
29
|
+
/** Flat sample type — mirrors the fields of InternalSensorData. */
|
|
30
|
+
typedef struct {
|
|
31
|
+
/* Inertial channels (coning/sculling-integrated, then rate-recovered) */
|
|
32
|
+
double rotation_rate_x, rotation_rate_y, rotation_rate_z;
|
|
33
|
+
double accel_x, accel_y, accel_z;
|
|
34
|
+
double raw_gyro_x, raw_gyro_y, raw_gyro_z;
|
|
35
|
+
double user_accel_x, user_accel_y, user_accel_z;
|
|
36
|
+
|
|
37
|
+
/* Averaged over the epoch */
|
|
38
|
+
double gravity_x, gravity_y, gravity_z;
|
|
39
|
+
double roll, pitch, yaw;
|
|
40
|
+
|
|
41
|
+
/* Latest-value pass-through */
|
|
42
|
+
double mag_x, mag_y, mag_z;
|
|
43
|
+
int mag_accuracy;
|
|
44
|
+
double raw_mag_x, raw_mag_y, raw_mag_z;
|
|
45
|
+
double heading;
|
|
46
|
+
int proximity_state; /* 0 = false, 1 = true */
|
|
47
|
+
|
|
48
|
+
/* Timing */
|
|
49
|
+
double timestamp; /* wall-clock timestamp of the epoch's last sample */
|
|
50
|
+
double delta_time; /* total epoch duration in seconds */
|
|
51
|
+
} rr_sample_t;
|
|
52
|
+
|
|
53
|
+
/** Per-pair integration state for one (gyro, accel) channel pair. */
|
|
54
|
+
typedef struct {
|
|
55
|
+
rr_vec3_t sum_delta_theta; /* accumulated angular increments */
|
|
56
|
+
rr_vec3_t prev_delta_theta; /* last sample's delta — NOT reset across epochs */
|
|
57
|
+
rr_vec3_t coning; /* coning correction accumulator */
|
|
58
|
+
|
|
59
|
+
rr_vec3_t sum_delta_vel; /* accumulated velocity increments */
|
|
60
|
+
rr_vec3_t prev_delta_vel; /* last sample's delta — NOT reset across epochs */
|
|
61
|
+
rr_vec3_t sculling; /* sculling correction accumulator */
|
|
62
|
+
} rr_pair_state_t;
|
|
63
|
+
|
|
64
|
+
/** Top-level rate-reducer state. Zero-initialise before calling rr_init(). */
|
|
65
|
+
typedef struct {
|
|
66
|
+
rr_pair_state_t primary; /* fusion gyro (rotationRate) + fusion accel */
|
|
67
|
+
rr_pair_state_t raw; /* raw gyro + raw accel (includes gravity) */
|
|
68
|
+
|
|
69
|
+
rr_vec3_t sum_gravity;
|
|
70
|
+
double sum_roll, sum_pitch, sum_yaw;
|
|
71
|
+
|
|
72
|
+
rr_sample_t latest; /* latest-value fields, refreshed every sample */
|
|
73
|
+
|
|
74
|
+
double sum_delta_time;
|
|
75
|
+
double prev_timestamp; /* 0.0 = not yet seen a sample */
|
|
76
|
+
double nominal_input_dt; /* 1/inputHz — fallback when timestamps are missing */
|
|
77
|
+
int count; /* samples accumulated in the current epoch */
|
|
78
|
+
int n; /* target samples per output epoch */
|
|
79
|
+
|
|
80
|
+
bool output_ready;
|
|
81
|
+
rr_sample_t output;
|
|
82
|
+
} rr_state_t;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Initialise the rate reducer.
|
|
86
|
+
*
|
|
87
|
+
* @param rr Pointer to a zero-initialised rr_state_t.
|
|
88
|
+
* @param input_hz Sensor input rate (e.g. 100.0).
|
|
89
|
+
* @param output_hz Desired output rate (e.g. 50.0).
|
|
90
|
+
* n = round(input_hz / output_hz), clamped to [2, 100].
|
|
91
|
+
*/
|
|
92
|
+
void rr_init(rr_state_t *rr, double input_hz, double output_hz);
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Feed one input sample.
|
|
96
|
+
*
|
|
97
|
+
* @return true when an output sample is ready; retrieve it with rr_get_output().
|
|
98
|
+
*/
|
|
99
|
+
bool rr_process(rr_state_t *rr, const rr_sample_t *sample);
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Retrieve the pending output sample.
|
|
103
|
+
*
|
|
104
|
+
* @return true if a sample was available; false if rr_process() has not yet
|
|
105
|
+
* returned true since the last retrieval.
|
|
106
|
+
*/
|
|
107
|
+
bool rr_get_output(rr_state_t *rr, rr_sample_t *out);
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Change the decimation factor at runtime.
|
|
111
|
+
* Epoch-in-progress is discarded; prev_delta_* state is preserved for continuity.
|
|
112
|
+
*/
|
|
113
|
+
void rr_set_n(rr_state_t *rr, int n);
|
|
114
|
+
|
|
115
|
+
#ifdef __cplusplus
|
|
116
|
+
}
|
|
117
|
+
#endif
|