react-native-nitro-pose-exercises 1.1.6 → 1.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/README.md +78 -126
- package/android/src/main/java/com/margelo/nitro/nitroposeexercises/NitroPoseExercises.kt +116 -4
- package/ios/NitroPoseExercises.swift +143 -41
- package/lib/module/NitroPoseExercises.nitro.js.map +1 -1
- package/lib/module/config/bicep-curl.js +3 -0
- package/lib/module/config/bicep-curl.js.map +1 -1
- package/lib/module/config/boat-pose.js +3 -0
- package/lib/module/config/boat-pose.js.map +1 -1
- package/lib/module/config/bow-pose.js +3 -0
- package/lib/module/config/bow-pose.js.map +1 -1
- package/lib/module/config/bridge-pose.js +3 -0
- package/lib/module/config/bridge-pose.js.map +1 -1
- package/lib/module/config/calf-raise.js +3 -0
- package/lib/module/config/calf-raise.js.map +1 -1
- package/lib/module/config/camel-pose.js +3 -0
- package/lib/module/config/camel-pose.js.map +1 -1
- package/lib/module/config/chair-pose.js +3 -0
- package/lib/module/config/chair-pose.js.map +1 -1
- package/lib/module/config/childs-pose.js +3 -0
- package/lib/module/config/childs-pose.js.map +1 -1
- package/lib/module/config/cobra-pose.js +3 -0
- package/lib/module/config/cobra-pose.js.map +1 -1
- package/lib/module/config/cobra-wings.js +3 -0
- package/lib/module/config/cobra-wings.js.map +1 -1
- package/lib/module/config/dead-lift.js +3 -0
- package/lib/module/config/dead-lift.js.map +1 -1
- package/lib/module/config/downward-dog.js +3 -0
- package/lib/module/config/downward-dog.js.map +1 -1
- package/lib/module/config/extended-side-angle.js +3 -0
- package/lib/module/config/extended-side-angle.js.map +1 -1
- package/lib/module/config/fish-pose.js +3 -0
- package/lib/module/config/fish-pose.js.map +1 -1
- package/lib/module/config/front-raise.js +3 -0
- package/lib/module/config/front-raise.js.map +1 -1
- package/lib/module/config/glute-bridge.js +3 -0
- package/lib/module/config/glute-bridge.js.map +1 -1
- package/lib/module/config/hip-abduction.js +3 -0
- package/lib/module/config/hip-abduction.js.map +1 -1
- package/lib/module/config/knee-raise.js +3 -0
- package/lib/module/config/knee-raise.js.map +1 -1
- package/lib/module/config/lateral-raise.js +3 -0
- package/lib/module/config/lateral-raise.js.map +1 -1
- package/lib/module/config/leg-raise.js +3 -0
- package/lib/module/config/leg-raise.js.map +1 -1
- package/lib/module/config/lunge.js +3 -0
- package/lib/module/config/lunge.js.map +1 -1
- package/lib/module/config/mountain-pose.js +3 -0
- package/lib/module/config/mountain-pose.js.map +1 -1
- package/lib/module/config/overarm-reach.js +3 -0
- package/lib/module/config/overarm-reach.js.map +1 -1
- package/lib/module/config/plank.js +3 -0
- package/lib/module/config/plank.js.map +1 -1
- package/lib/module/config/pull-up.js +3 -0
- package/lib/module/config/pull-up.js.map +1 -1
- package/lib/module/config/pushup.js +4 -0
- package/lib/module/config/pushup.js.map +1 -1
- package/lib/module/config/reverse-warrior.js +3 -0
- package/lib/module/config/reverse-warrior.js.map +1 -1
- package/lib/module/config/shoulder-press.js +3 -0
- package/lib/module/config/shoulder-press.js.map +1 -1
- package/lib/module/config/side-lung.js +3 -0
- package/lib/module/config/side-lung.js.map +1 -1
- package/lib/module/config/side-plank.js +3 -0
- package/lib/module/config/side-plank.js.map +1 -1
- package/lib/module/config/situp.js +3 -0
- package/lib/module/config/situp.js.map +1 -1
- package/lib/module/config/squat.js +3 -0
- package/lib/module/config/squat.js.map +1 -1
- package/lib/module/config/sumo-squat.js +3 -0
- package/lib/module/config/sumo-squat.js.map +1 -1
- package/lib/module/config/tree-pose.js +3 -0
- package/lib/module/config/tree-pose.js.map +1 -1
- package/lib/module/config/triangle-pose.js +3 -0
- package/lib/module/config/triangle-pose.js.map +1 -1
- package/lib/module/config/tricep-dip.js +4 -0
- package/lib/module/config/tricep-dip.js.map +1 -1
- package/lib/module/config/v-up.js +3 -0
- package/lib/module/config/v-up.js.map +1 -1
- package/lib/module/config/wall-sit.js +3 -0
- package/lib/module/config/wall-sit.js.map +1 -1
- package/lib/module/config/warrior-i.js +3 -0
- package/lib/module/config/warrior-i.js.map +1 -1
- package/lib/module/config/warrior-ii.js +3 -0
- package/lib/module/config/warrior-ii.js.map +1 -1
- package/lib/module/config/warrior-iii.js +3 -0
- package/lib/module/config/warrior-iii.js.map +1 -1
- package/lib/typescript/src/NitroPoseExercises.nitro.d.ts +9 -1
- package/lib/typescript/src/NitroPoseExercises.nitro.d.ts.map +1 -1
- package/lib/typescript/src/config/bicep-curl.d.ts.map +1 -1
- package/lib/typescript/src/config/boat-pose.d.ts.map +1 -1
- package/lib/typescript/src/config/bow-pose.d.ts.map +1 -1
- package/lib/typescript/src/config/bridge-pose.d.ts.map +1 -1
- package/lib/typescript/src/config/calf-raise.d.ts.map +1 -1
- package/lib/typescript/src/config/camel-pose.d.ts.map +1 -1
- package/lib/typescript/src/config/chair-pose.d.ts.map +1 -1
- package/lib/typescript/src/config/childs-pose.d.ts.map +1 -1
- package/lib/typescript/src/config/cobra-pose.d.ts.map +1 -1
- package/lib/typescript/src/config/cobra-wings.d.ts.map +1 -1
- package/lib/typescript/src/config/dead-lift.d.ts.map +1 -1
- package/lib/typescript/src/config/downward-dog.d.ts.map +1 -1
- package/lib/typescript/src/config/extended-side-angle.d.ts.map +1 -1
- package/lib/typescript/src/config/fish-pose.d.ts.map +1 -1
- package/lib/typescript/src/config/front-raise.d.ts.map +1 -1
- package/lib/typescript/src/config/glute-bridge.d.ts.map +1 -1
- package/lib/typescript/src/config/hip-abduction.d.ts.map +1 -1
- package/lib/typescript/src/config/knee-raise.d.ts.map +1 -1
- package/lib/typescript/src/config/lateral-raise.d.ts.map +1 -1
- package/lib/typescript/src/config/leg-raise.d.ts.map +1 -1
- package/lib/typescript/src/config/lunge.d.ts.map +1 -1
- package/lib/typescript/src/config/mountain-pose.d.ts.map +1 -1
- package/lib/typescript/src/config/overarm-reach.d.ts.map +1 -1
- package/lib/typescript/src/config/plank.d.ts.map +1 -1
- package/lib/typescript/src/config/pull-up.d.ts.map +1 -1
- package/lib/typescript/src/config/pushup.d.ts.map +1 -1
- package/lib/typescript/src/config/reverse-warrior.d.ts.map +1 -1
- package/lib/typescript/src/config/shoulder-press.d.ts.map +1 -1
- package/lib/typescript/src/config/side-lung.d.ts.map +1 -1
- package/lib/typescript/src/config/side-plank.d.ts.map +1 -1
- package/lib/typescript/src/config/situp.d.ts.map +1 -1
- package/lib/typescript/src/config/squat.d.ts.map +1 -1
- package/lib/typescript/src/config/sumo-squat.d.ts.map +1 -1
- package/lib/typescript/src/config/tree-pose.d.ts.map +1 -1
- package/lib/typescript/src/config/triangle-pose.d.ts.map +1 -1
- package/lib/typescript/src/config/tricep-dip.d.ts.map +1 -1
- package/lib/typescript/src/config/v-up.d.ts.map +1 -1
- package/lib/typescript/src/config/wall-sit.d.ts.map +1 -1
- package/lib/typescript/src/config/warrior-i.d.ts.map +1 -1
- package/lib/typescript/src/config/warrior-ii.d.ts.map +1 -1
- package/lib/typescript/src/config/warrior-iii.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JCameraAngleType.hpp +58 -0
- package/nitrogen/generated/android/c++/JExerciseConfig.hpp +19 -3
- package/nitrogen/generated/android/c++/JHybridNitroPoseExercisesSpec.cpp +47 -0
- package/nitrogen/generated/android/c++/JHybridNitroPoseExercisesSpec.hpp +5 -0
- package/nitrogen/generated/android/c++/JPostureFamily.hpp +73 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/CameraAngleType.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/ExerciseConfig.kt +19 -4
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/HybridNitroPoseExercisesSpec.kt +32 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitroposeexercises/PostureFamily.kt +28 -0
- package/nitrogen/generated/ios/NitroPoseExercises-Swift-Cxx-Bridge.hpp +9 -0
- package/nitrogen/generated/ios/NitroPoseExercises-Swift-Cxx-Umbrella.hpp +6 -0
- package/nitrogen/generated/ios/c++/HybridNitroPoseExercisesSpecSwift.hpp +28 -0
- package/nitrogen/generated/ios/swift/CameraAngleType.swift +40 -0
- package/nitrogen/generated/ios/swift/ExerciseConfig.swift +17 -2
- package/nitrogen/generated/ios/swift/HybridNitroPoseExercisesSpec.swift +3 -0
- package/nitrogen/generated/ios/swift/HybridNitroPoseExercisesSpec_cxx.swift +76 -0
- package/nitrogen/generated/ios/swift/PostureFamily.swift +60 -0
- package/nitrogen/generated/shared/c++/CameraAngleType.hpp +76 -0
- package/nitrogen/generated/shared/c++/ExerciseConfig.hpp +20 -2
- package/nitrogen/generated/shared/c++/HybridNitroPoseExercisesSpec.cpp +5 -0
- package/nitrogen/generated/shared/c++/HybridNitroPoseExercisesSpec.hpp +5 -0
- package/nitrogen/generated/shared/c++/PostureFamily.hpp +96 -0
- package/package.json +1 -1
- package/src/NitroPoseExercises.nitro.ts +19 -0
- package/src/config/bicep-curl.ts +3 -0
- package/src/config/boat-pose.ts +3 -0
- package/src/config/bow-pose.ts +3 -0
- package/src/config/bridge-pose.ts +3 -0
- package/src/config/calf-raise.ts +3 -0
- package/src/config/camel-pose.ts +3 -0
- package/src/config/chair-pose.ts +3 -0
- package/src/config/childs-pose.ts +3 -0
- package/src/config/cobra-pose.ts +3 -0
- package/src/config/cobra-wings.ts +3 -0
- package/src/config/dead-lift.ts +3 -0
- package/src/config/downward-dog.ts +3 -0
- package/src/config/extended-side-angle.ts +3 -0
- package/src/config/fish-pose.ts +3 -0
- package/src/config/front-raise.ts +4 -0
- package/src/config/glute-bridge.ts +3 -0
- package/src/config/hip-abduction.ts +3 -0
- package/src/config/knee-raise.ts +3 -0
- package/src/config/lateral-raise.ts +3 -0
- package/src/config/leg-raise.ts +3 -0
- package/src/config/lunge.ts +3 -0
- package/src/config/mountain-pose.ts +3 -0
- package/src/config/overarm-reach.ts +3 -0
- package/src/config/plank.ts +3 -0
- package/src/config/pull-up.ts +3 -0
- package/src/config/pushup.ts +3 -0
- package/src/config/reverse-warrior.ts +3 -0
- package/src/config/shoulder-press.ts +3 -0
- package/src/config/side-lung.ts +3 -0
- package/src/config/side-plank.ts +3 -0
- package/src/config/situp.ts +3 -0
- package/src/config/squat.ts +3 -0
- package/src/config/sumo-squat.ts +4 -0
- package/src/config/tree-pose.ts +3 -0
- package/src/config/triangle-pose.ts +3 -0
- package/src/config/tricep-dip.ts +3 -0
- package/src/config/v-up.ts +4 -0
- package/src/config/wall-sit.ts +3 -0
- package/src/config/warrior-i.ts +3 -0
- package/src/config/warrior-ii.ts +3 -0
- package/src/config/warrior-iii.ts +3 -0
|
@@ -353,6 +353,70 @@ open class HybridNitroPoseExercisesSpec_cxx {
|
|
|
353
353
|
}
|
|
354
354
|
}
|
|
355
355
|
|
|
356
|
+
public final var onPostureLost: bridge.std__optional_std__function_void____ {
|
|
357
|
+
@inline(__always)
|
|
358
|
+
get {
|
|
359
|
+
return { () -> bridge.std__optional_std__function_void____ in
|
|
360
|
+
if let __unwrappedValue = self.__implementation.onPostureLost {
|
|
361
|
+
return bridge.create_std__optional_std__function_void____({ () -> bridge.Func_void in
|
|
362
|
+
let __closureWrapper = Func_void(__unwrappedValue)
|
|
363
|
+
return bridge.create_Func_void(__closureWrapper.toUnsafe())
|
|
364
|
+
}())
|
|
365
|
+
} else {
|
|
366
|
+
return .init()
|
|
367
|
+
}
|
|
368
|
+
}()
|
|
369
|
+
}
|
|
370
|
+
@inline(__always)
|
|
371
|
+
set {
|
|
372
|
+
self.__implementation.onPostureLost = { () -> (() -> Void)? in
|
|
373
|
+
if bridge.has_value_std__optional_std__function_void____(newValue) {
|
|
374
|
+
let __unwrapped = bridge.get_std__optional_std__function_void____(newValue)
|
|
375
|
+
return { () -> () -> Void in
|
|
376
|
+
let __wrappedFunction = bridge.wrap_Func_void(__unwrapped)
|
|
377
|
+
return { () -> Void in
|
|
378
|
+
__wrappedFunction.call()
|
|
379
|
+
}
|
|
380
|
+
}()
|
|
381
|
+
} else {
|
|
382
|
+
return nil
|
|
383
|
+
}
|
|
384
|
+
}()
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
public final var onPostureRegained: bridge.std__optional_std__function_void____ {
|
|
389
|
+
@inline(__always)
|
|
390
|
+
get {
|
|
391
|
+
return { () -> bridge.std__optional_std__function_void____ in
|
|
392
|
+
if let __unwrappedValue = self.__implementation.onPostureRegained {
|
|
393
|
+
return bridge.create_std__optional_std__function_void____({ () -> bridge.Func_void in
|
|
394
|
+
let __closureWrapper = Func_void(__unwrappedValue)
|
|
395
|
+
return bridge.create_Func_void(__closureWrapper.toUnsafe())
|
|
396
|
+
}())
|
|
397
|
+
} else {
|
|
398
|
+
return .init()
|
|
399
|
+
}
|
|
400
|
+
}()
|
|
401
|
+
}
|
|
402
|
+
@inline(__always)
|
|
403
|
+
set {
|
|
404
|
+
self.__implementation.onPostureRegained = { () -> (() -> Void)? in
|
|
405
|
+
if bridge.has_value_std__optional_std__function_void____(newValue) {
|
|
406
|
+
let __unwrapped = bridge.get_std__optional_std__function_void____(newValue)
|
|
407
|
+
return { () -> () -> Void in
|
|
408
|
+
let __wrappedFunction = bridge.wrap_Func_void(__unwrapped)
|
|
409
|
+
return { () -> Void in
|
|
410
|
+
__wrappedFunction.call()
|
|
411
|
+
}
|
|
412
|
+
}()
|
|
413
|
+
} else {
|
|
414
|
+
return nil
|
|
415
|
+
}
|
|
416
|
+
}()
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
356
420
|
public final var currentPhase: Int32 {
|
|
357
421
|
@inline(__always)
|
|
358
422
|
get {
|
|
@@ -480,4 +544,16 @@ open class HybridNitroPoseExercisesSpec_cxx {
|
|
|
480
544
|
return bridge.create_Result_void_(__exceptionPtr)
|
|
481
545
|
}
|
|
482
546
|
}
|
|
547
|
+
|
|
548
|
+
@inline(__always)
|
|
549
|
+
public final func isReady() -> bridge.Result_bool_ {
|
|
550
|
+
do {
|
|
551
|
+
let __result = try self.__implementation.isReady()
|
|
552
|
+
let __resultCpp = __result
|
|
553
|
+
return bridge.create_Result_bool_(__resultCpp)
|
|
554
|
+
} catch (let __error) {
|
|
555
|
+
let __exceptionPtr = __error.toCpp()
|
|
556
|
+
return bridge.create_Result_bool_(__exceptionPtr)
|
|
557
|
+
}
|
|
558
|
+
}
|
|
483
559
|
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// PostureFamily.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Represents the JS union `PostureFamily`, backed by a C++ enum.
|
|
10
|
+
*/
|
|
11
|
+
public typealias PostureFamily = margelo.nitro.nitroposeexercises.PostureFamily
|
|
12
|
+
|
|
13
|
+
public extension PostureFamily {
|
|
14
|
+
/**
|
|
15
|
+
* Get a PostureFamily for the given String value, or
|
|
16
|
+
* return `nil` if the given value was invalid/unknown.
|
|
17
|
+
*/
|
|
18
|
+
init?(fromString string: String) {
|
|
19
|
+
switch string {
|
|
20
|
+
case "horizontalProne":
|
|
21
|
+
self = .horizontalprone
|
|
22
|
+
case "standingUpright":
|
|
23
|
+
self = .standingupright
|
|
24
|
+
case "seated":
|
|
25
|
+
self = .seated
|
|
26
|
+
case "inverted":
|
|
27
|
+
self = .inverted
|
|
28
|
+
case "sidePlank":
|
|
29
|
+
self = .sideplank
|
|
30
|
+
case "supine":
|
|
31
|
+
self = .supine
|
|
32
|
+
case "none":
|
|
33
|
+
self = .none
|
|
34
|
+
default:
|
|
35
|
+
return nil
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Get the String value this PostureFamily represents.
|
|
41
|
+
*/
|
|
42
|
+
var stringValue: String {
|
|
43
|
+
switch self {
|
|
44
|
+
case .horizontalprone:
|
|
45
|
+
return "horizontalProne"
|
|
46
|
+
case .standingupright:
|
|
47
|
+
return "standingUpright"
|
|
48
|
+
case .seated:
|
|
49
|
+
return "seated"
|
|
50
|
+
case .inverted:
|
|
51
|
+
return "inverted"
|
|
52
|
+
case .sideplank:
|
|
53
|
+
return "sidePlank"
|
|
54
|
+
case .supine:
|
|
55
|
+
return "supine"
|
|
56
|
+
case .none:
|
|
57
|
+
return "none"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// CameraAngleType.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/NitroHash.hpp>)
|
|
11
|
+
#include <NitroModules/NitroHash.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
16
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
21
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
namespace margelo::nitro::nitroposeexercises {
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* An enum which can be represented as a JavaScript union (CameraAngleType).
|
|
30
|
+
*/
|
|
31
|
+
enum class CameraAngleType {
|
|
32
|
+
SIDE SWIFT_NAME(side) = 0,
|
|
33
|
+
FRONT SWIFT_NAME(front) = 1,
|
|
34
|
+
} CLOSED_ENUM;
|
|
35
|
+
|
|
36
|
+
} // namespace margelo::nitro::nitroposeexercises
|
|
37
|
+
|
|
38
|
+
namespace margelo::nitro {
|
|
39
|
+
|
|
40
|
+
// C++ CameraAngleType <> JS CameraAngleType (union)
|
|
41
|
+
template <>
|
|
42
|
+
struct JSIConverter<margelo::nitro::nitroposeexercises::CameraAngleType> final {
|
|
43
|
+
static inline margelo::nitro::nitroposeexercises::CameraAngleType fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
44
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
|
|
45
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
46
|
+
case hashString("side"): return margelo::nitro::nitroposeexercises::CameraAngleType::SIDE;
|
|
47
|
+
case hashString("front"): return margelo::nitro::nitroposeexercises::CameraAngleType::FRONT;
|
|
48
|
+
default: [[unlikely]]
|
|
49
|
+
throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum CameraAngleType - invalid value!");
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::nitroposeexercises::CameraAngleType arg) {
|
|
53
|
+
switch (arg) {
|
|
54
|
+
case margelo::nitro::nitroposeexercises::CameraAngleType::SIDE: return JSIConverter<std::string>::toJSI(runtime, "side");
|
|
55
|
+
case margelo::nitro::nitroposeexercises::CameraAngleType::FRONT: return JSIConverter<std::string>::toJSI(runtime, "front");
|
|
56
|
+
default: [[unlikely]]
|
|
57
|
+
throw std::invalid_argument("Cannot convert CameraAngleType to JS - invalid value: "
|
|
58
|
+
+ std::to_string(static_cast<int>(arg)) + "!");
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
62
|
+
if (!value.isString()) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
|
|
66
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
67
|
+
case hashString("side"):
|
|
68
|
+
case hashString("front"):
|
|
69
|
+
return true;
|
|
70
|
+
default:
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
} // namespace margelo::nitro
|
|
@@ -38,6 +38,10 @@ namespace margelo::nitro::nitroposeexercises { struct PhaseThreshold; }
|
|
|
38
38
|
namespace margelo::nitro::nitroposeexercises { enum class ExercisePhase; }
|
|
39
39
|
// Forward declaration of `FormRule` to properly resolve imports.
|
|
40
40
|
namespace margelo::nitro::nitroposeexercises { struct FormRule; }
|
|
41
|
+
// Forward declaration of `PostureFamily` to properly resolve imports.
|
|
42
|
+
namespace margelo::nitro::nitroposeexercises { enum class PostureFamily; }
|
|
43
|
+
// Forward declaration of `CameraAngleType` to properly resolve imports.
|
|
44
|
+
namespace margelo::nitro::nitroposeexercises { enum class CameraAngleType; }
|
|
41
45
|
|
|
42
46
|
#include <string>
|
|
43
47
|
#include "ExerciseType.hpp"
|
|
@@ -46,6 +50,8 @@ namespace margelo::nitro::nitroposeexercises { struct FormRule; }
|
|
|
46
50
|
#include "PhaseThreshold.hpp"
|
|
47
51
|
#include "ExercisePhase.hpp"
|
|
48
52
|
#include "FormRule.hpp"
|
|
53
|
+
#include "PostureFamily.hpp"
|
|
54
|
+
#include "CameraAngleType.hpp"
|
|
49
55
|
|
|
50
56
|
namespace margelo::nitro::nitroposeexercises {
|
|
51
57
|
|
|
@@ -61,10 +67,13 @@ namespace margelo::nitro::nitroposeexercises {
|
|
|
61
67
|
std::vector<ExercisePhase> repSequence SWIFT_PRIVATE;
|
|
62
68
|
std::vector<FormRule> formRules SWIFT_PRIVATE;
|
|
63
69
|
double holdDurationMs SWIFT_PRIVATE;
|
|
70
|
+
PostureFamily postureFamily SWIFT_PRIVATE;
|
|
71
|
+
double visibilityThreshold SWIFT_PRIVATE;
|
|
72
|
+
CameraAngleType cameraAngle SWIFT_PRIVATE;
|
|
64
73
|
|
|
65
74
|
public:
|
|
66
75
|
ExerciseConfig() = default;
|
|
67
|
-
explicit ExerciseConfig(std::string name, ExerciseType type, std::vector<AngleDefinition> angles, std::vector<PhaseThreshold> phases, std::vector<ExercisePhase> repSequence, std::vector<FormRule> formRules, double holdDurationMs): name(name), type(type), angles(angles), phases(phases), repSequence(repSequence), formRules(formRules), holdDurationMs(holdDurationMs) {}
|
|
76
|
+
explicit ExerciseConfig(std::string name, ExerciseType type, std::vector<AngleDefinition> angles, std::vector<PhaseThreshold> phases, std::vector<ExercisePhase> repSequence, std::vector<FormRule> formRules, double holdDurationMs, PostureFamily postureFamily, double visibilityThreshold, CameraAngleType cameraAngle): name(name), type(type), angles(angles), phases(phases), repSequence(repSequence), formRules(formRules), holdDurationMs(holdDurationMs), postureFamily(postureFamily), visibilityThreshold(visibilityThreshold), cameraAngle(cameraAngle) {}
|
|
68
77
|
|
|
69
78
|
public:
|
|
70
79
|
friend bool operator==(const ExerciseConfig& lhs, const ExerciseConfig& rhs) = default;
|
|
@@ -86,7 +95,10 @@ namespace margelo::nitro {
|
|
|
86
95
|
JSIConverter<std::vector<margelo::nitro::nitroposeexercises::PhaseThreshold>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "phases"))),
|
|
87
96
|
JSIConverter<std::vector<margelo::nitro::nitroposeexercises::ExercisePhase>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "repSequence"))),
|
|
88
97
|
JSIConverter<std::vector<margelo::nitro::nitroposeexercises::FormRule>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "formRules"))),
|
|
89
|
-
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "holdDurationMs")))
|
|
98
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "holdDurationMs"))),
|
|
99
|
+
JSIConverter<margelo::nitro::nitroposeexercises::PostureFamily>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "postureFamily"))),
|
|
100
|
+
JSIConverter<double>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "visibilityThreshold"))),
|
|
101
|
+
JSIConverter<margelo::nitro::nitroposeexercises::CameraAngleType>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "cameraAngle")))
|
|
90
102
|
);
|
|
91
103
|
}
|
|
92
104
|
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::nitroposeexercises::ExerciseConfig& arg) {
|
|
@@ -98,6 +110,9 @@ namespace margelo::nitro {
|
|
|
98
110
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "repSequence"), JSIConverter<std::vector<margelo::nitro::nitroposeexercises::ExercisePhase>>::toJSI(runtime, arg.repSequence));
|
|
99
111
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "formRules"), JSIConverter<std::vector<margelo::nitro::nitroposeexercises::FormRule>>::toJSI(runtime, arg.formRules));
|
|
100
112
|
obj.setProperty(runtime, PropNameIDCache::get(runtime, "holdDurationMs"), JSIConverter<double>::toJSI(runtime, arg.holdDurationMs));
|
|
113
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "postureFamily"), JSIConverter<margelo::nitro::nitroposeexercises::PostureFamily>::toJSI(runtime, arg.postureFamily));
|
|
114
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "visibilityThreshold"), JSIConverter<double>::toJSI(runtime, arg.visibilityThreshold));
|
|
115
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "cameraAngle"), JSIConverter<margelo::nitro::nitroposeexercises::CameraAngleType>::toJSI(runtime, arg.cameraAngle));
|
|
101
116
|
return obj;
|
|
102
117
|
}
|
|
103
118
|
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
@@ -115,6 +130,9 @@ namespace margelo::nitro {
|
|
|
115
130
|
if (!JSIConverter<std::vector<margelo::nitro::nitroposeexercises::ExercisePhase>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "repSequence")))) return false;
|
|
116
131
|
if (!JSIConverter<std::vector<margelo::nitro::nitroposeexercises::FormRule>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "formRules")))) return false;
|
|
117
132
|
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "holdDurationMs")))) return false;
|
|
133
|
+
if (!JSIConverter<margelo::nitro::nitroposeexercises::PostureFamily>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "postureFamily")))) return false;
|
|
134
|
+
if (!JSIConverter<double>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "visibilityThreshold")))) return false;
|
|
135
|
+
if (!JSIConverter<margelo::nitro::nitroposeexercises::CameraAngleType>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "cameraAngle")))) return false;
|
|
118
136
|
return true;
|
|
119
137
|
}
|
|
120
138
|
};
|
|
@@ -29,6 +29,10 @@ namespace margelo::nitro::nitroposeexercises {
|
|
|
29
29
|
prototype.registerHybridSetter("onPoseRegained", &HybridNitroPoseExercisesSpec::setOnPoseRegained);
|
|
30
30
|
prototype.registerHybridGetter("onSessionComplete", &HybridNitroPoseExercisesSpec::getOnSessionComplete);
|
|
31
31
|
prototype.registerHybridSetter("onSessionComplete", &HybridNitroPoseExercisesSpec::setOnSessionComplete);
|
|
32
|
+
prototype.registerHybridGetter("onPostureLost", &HybridNitroPoseExercisesSpec::getOnPostureLost);
|
|
33
|
+
prototype.registerHybridSetter("onPostureLost", &HybridNitroPoseExercisesSpec::setOnPostureLost);
|
|
34
|
+
prototype.registerHybridGetter("onPostureRegained", &HybridNitroPoseExercisesSpec::getOnPostureRegained);
|
|
35
|
+
prototype.registerHybridSetter("onPostureRegained", &HybridNitroPoseExercisesSpec::setOnPostureRegained);
|
|
32
36
|
prototype.registerHybridGetter("currentPhase", &HybridNitroPoseExercisesSpec::getCurrentPhase);
|
|
33
37
|
prototype.registerHybridGetter("repCount", &HybridNitroPoseExercisesSpec::getRepCount);
|
|
34
38
|
prototype.registerHybridGetter("landmarks", &HybridNitroPoseExercisesSpec::getLandmarks);
|
|
@@ -40,6 +44,7 @@ namespace margelo::nitro::nitroposeexercises {
|
|
|
40
44
|
prototype.registerHybridMethod("pauseSession", &HybridNitroPoseExercisesSpec::pauseSession);
|
|
41
45
|
prototype.registerHybridMethod("resumeSession", &HybridNitroPoseExercisesSpec::resumeSession);
|
|
42
46
|
prototype.registerHybridMethod("stopSession", &HybridNitroPoseExercisesSpec::stopSession);
|
|
47
|
+
prototype.registerHybridMethod("isReady", &HybridNitroPoseExercisesSpec::isReady);
|
|
43
48
|
});
|
|
44
49
|
}
|
|
45
50
|
|
|
@@ -90,6 +90,10 @@ namespace margelo::nitro::nitroposeexercises {
|
|
|
90
90
|
virtual void setOnPoseRegained(const std::optional<std::function<void()>>& onPoseRegained) = 0;
|
|
91
91
|
virtual std::optional<std::function<void(const SessionResult& /* result */)>> getOnSessionComplete() = 0;
|
|
92
92
|
virtual void setOnSessionComplete(const std::optional<std::function<void(const SessionResult& /* result */)>>& onSessionComplete) = 0;
|
|
93
|
+
virtual std::optional<std::function<void()>> getOnPostureLost() = 0;
|
|
94
|
+
virtual void setOnPostureLost(const std::optional<std::function<void()>>& onPostureLost) = 0;
|
|
95
|
+
virtual std::optional<std::function<void()>> getOnPostureRegained() = 0;
|
|
96
|
+
virtual void setOnPostureRegained(const std::optional<std::function<void()>>& onPostureRegained) = 0;
|
|
93
97
|
virtual ExercisePhase getCurrentPhase() = 0;
|
|
94
98
|
virtual double getRepCount() = 0;
|
|
95
99
|
virtual std::vector<Landmark> getLandmarks() = 0;
|
|
@@ -104,6 +108,7 @@ namespace margelo::nitro::nitroposeexercises {
|
|
|
104
108
|
virtual void pauseSession() = 0;
|
|
105
109
|
virtual void resumeSession() = 0;
|
|
106
110
|
virtual void stopSession() = 0;
|
|
111
|
+
virtual bool isReady() = 0;
|
|
107
112
|
|
|
108
113
|
protected:
|
|
109
114
|
// Hybrid Setup
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// PostureFamily.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#if __has_include(<NitroModules/NitroHash.hpp>)
|
|
11
|
+
#include <NitroModules/NitroHash.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
16
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
21
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
namespace margelo::nitro::nitroposeexercises {
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* An enum which can be represented as a JavaScript union (PostureFamily).
|
|
30
|
+
*/
|
|
31
|
+
enum class PostureFamily {
|
|
32
|
+
HORIZONTALPRONE SWIFT_NAME(horizontalprone) = 0,
|
|
33
|
+
STANDINGUPRIGHT SWIFT_NAME(standingupright) = 1,
|
|
34
|
+
SEATED SWIFT_NAME(seated) = 2,
|
|
35
|
+
INVERTED SWIFT_NAME(inverted) = 3,
|
|
36
|
+
SIDEPLANK SWIFT_NAME(sideplank) = 4,
|
|
37
|
+
SUPINE SWIFT_NAME(supine) = 5,
|
|
38
|
+
NONE SWIFT_NAME(none) = 6,
|
|
39
|
+
} CLOSED_ENUM;
|
|
40
|
+
|
|
41
|
+
} // namespace margelo::nitro::nitroposeexercises
|
|
42
|
+
|
|
43
|
+
namespace margelo::nitro {
|
|
44
|
+
|
|
45
|
+
// C++ PostureFamily <> JS PostureFamily (union)
|
|
46
|
+
template <>
|
|
47
|
+
struct JSIConverter<margelo::nitro::nitroposeexercises::PostureFamily> final {
|
|
48
|
+
static inline margelo::nitro::nitroposeexercises::PostureFamily fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
49
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, arg);
|
|
50
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
51
|
+
case hashString("horizontalProne"): return margelo::nitro::nitroposeexercises::PostureFamily::HORIZONTALPRONE;
|
|
52
|
+
case hashString("standingUpright"): return margelo::nitro::nitroposeexercises::PostureFamily::STANDINGUPRIGHT;
|
|
53
|
+
case hashString("seated"): return margelo::nitro::nitroposeexercises::PostureFamily::SEATED;
|
|
54
|
+
case hashString("inverted"): return margelo::nitro::nitroposeexercises::PostureFamily::INVERTED;
|
|
55
|
+
case hashString("sidePlank"): return margelo::nitro::nitroposeexercises::PostureFamily::SIDEPLANK;
|
|
56
|
+
case hashString("supine"): return margelo::nitro::nitroposeexercises::PostureFamily::SUPINE;
|
|
57
|
+
case hashString("none"): return margelo::nitro::nitroposeexercises::PostureFamily::NONE;
|
|
58
|
+
default: [[unlikely]]
|
|
59
|
+
throw std::invalid_argument("Cannot convert \"" + unionValue + "\" to enum PostureFamily - invalid value!");
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, margelo::nitro::nitroposeexercises::PostureFamily arg) {
|
|
63
|
+
switch (arg) {
|
|
64
|
+
case margelo::nitro::nitroposeexercises::PostureFamily::HORIZONTALPRONE: return JSIConverter<std::string>::toJSI(runtime, "horizontalProne");
|
|
65
|
+
case margelo::nitro::nitroposeexercises::PostureFamily::STANDINGUPRIGHT: return JSIConverter<std::string>::toJSI(runtime, "standingUpright");
|
|
66
|
+
case margelo::nitro::nitroposeexercises::PostureFamily::SEATED: return JSIConverter<std::string>::toJSI(runtime, "seated");
|
|
67
|
+
case margelo::nitro::nitroposeexercises::PostureFamily::INVERTED: return JSIConverter<std::string>::toJSI(runtime, "inverted");
|
|
68
|
+
case margelo::nitro::nitroposeexercises::PostureFamily::SIDEPLANK: return JSIConverter<std::string>::toJSI(runtime, "sidePlank");
|
|
69
|
+
case margelo::nitro::nitroposeexercises::PostureFamily::SUPINE: return JSIConverter<std::string>::toJSI(runtime, "supine");
|
|
70
|
+
case margelo::nitro::nitroposeexercises::PostureFamily::NONE: return JSIConverter<std::string>::toJSI(runtime, "none");
|
|
71
|
+
default: [[unlikely]]
|
|
72
|
+
throw std::invalid_argument("Cannot convert PostureFamily to JS - invalid value: "
|
|
73
|
+
+ std::to_string(static_cast<int>(arg)) + "!");
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
77
|
+
if (!value.isString()) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
std::string unionValue = JSIConverter<std::string>::fromJSI(runtime, value);
|
|
81
|
+
switch (hashString(unionValue.c_str(), unionValue.size())) {
|
|
82
|
+
case hashString("horizontalProne"):
|
|
83
|
+
case hashString("standingUpright"):
|
|
84
|
+
case hashString("seated"):
|
|
85
|
+
case hashString("inverted"):
|
|
86
|
+
case hashString("sidePlank"):
|
|
87
|
+
case hashString("supine"):
|
|
88
|
+
case hashString("none"):
|
|
89
|
+
return true;
|
|
90
|
+
default:
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
} // namespace margelo::nitro
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-nitro-pose-exercises",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.8",
|
|
4
4
|
"description": "Real-time on-device exercise tracking for React Native. Rep counting, form validation, and skeleton overlay powered by Apple Vision (iOS) and Google ML Kit (Android) with VisionCamera v5 via Nitro Modules.",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -12,6 +12,17 @@ type FormSeverity = 'info' | 'warning' | 'error';
|
|
|
12
12
|
|
|
13
13
|
type SessionStatus = 'idle' | 'countdown' | 'active' | 'paused' | 'completed';
|
|
14
14
|
|
|
15
|
+
type CameraAngleType = 'side' | 'front';
|
|
16
|
+
|
|
17
|
+
type PostureFamily =
|
|
18
|
+
| 'horizontalProne'
|
|
19
|
+
| 'standingUpright'
|
|
20
|
+
| 'seated'
|
|
21
|
+
| 'inverted'
|
|
22
|
+
| 'sidePlank'
|
|
23
|
+
| 'supine'
|
|
24
|
+
| 'none';
|
|
25
|
+
|
|
15
26
|
// ─── Landmark ────────────────────────────────────────────────
|
|
16
27
|
|
|
17
28
|
interface Landmark {
|
|
@@ -54,6 +65,9 @@ interface ExerciseConfig {
|
|
|
54
65
|
repSequence: ExercisePhase[]; // e.g. ['up', 'down', 'up'] for a push-up rep
|
|
55
66
|
formRules: FormRule[];
|
|
56
67
|
holdDurationMs: number; // for hold-based exercises
|
|
68
|
+
postureFamily: PostureFamily; // ← new
|
|
69
|
+
visibilityThreshold: number; // ← new, 0.0–1.0; suggested 0.3
|
|
70
|
+
cameraAngle: CameraAngleType; // 'side' | 'front';
|
|
57
71
|
}
|
|
58
72
|
|
|
59
73
|
// ─── Callback Payloads ───────────────────────────────────────
|
|
@@ -118,6 +132,8 @@ interface NitroPoseExercises extends HybridObject<{
|
|
|
118
132
|
onPoseLost: (() => void) | undefined;
|
|
119
133
|
onPoseRegained: (() => void) | undefined;
|
|
120
134
|
onSessionComplete: ((result: SessionResult) => void) | undefined;
|
|
135
|
+
onPostureLost: (() => void) | undefined;
|
|
136
|
+
onPostureRegained: (() => void) | undefined;
|
|
121
137
|
|
|
122
138
|
// State (readable from JS for UI)
|
|
123
139
|
readonly currentPhase: ExercisePhase;
|
|
@@ -129,6 +145,8 @@ interface NitroPoseExercises extends HybridObject<{
|
|
|
129
145
|
pauseSession(): void;
|
|
130
146
|
resumeSession(): void;
|
|
131
147
|
stopSession(): void;
|
|
148
|
+
|
|
149
|
+
isReady(): boolean;
|
|
132
150
|
}
|
|
133
151
|
|
|
134
152
|
const nitroPoseExercises =
|
|
@@ -152,4 +170,5 @@ export type {
|
|
|
152
170
|
FormFeedback,
|
|
153
171
|
HoldProgress,
|
|
154
172
|
SessionResult,
|
|
173
|
+
PostureFamily,
|
|
155
174
|
};
|
package/src/config/bicep-curl.ts
CHANGED
|
@@ -7,6 +7,9 @@ import type { ExerciseConfig } from '../NitroPoseExercises.nitro';
|
|
|
7
7
|
export const BICEP_CURL_CONFIG: ExerciseConfig = {
|
|
8
8
|
name: 'Bicep Curl',
|
|
9
9
|
type: 'rep',
|
|
10
|
+
postureFamily: 'standingUpright',
|
|
11
|
+
visibilityThreshold: 0.2,
|
|
12
|
+
cameraAngle: 'front',
|
|
10
13
|
angles: [
|
|
11
14
|
{
|
|
12
15
|
name: 'leftElbow',
|
package/src/config/boat-pose.ts
CHANGED
|
@@ -3,6 +3,9 @@ import type { ExerciseConfig } from '../NitroPoseExercises.nitro';
|
|
|
3
3
|
export const BOAT_POSE_CONFIG: ExerciseConfig = {
|
|
4
4
|
name: 'Boat Pose (Navasana)',
|
|
5
5
|
type: 'hold',
|
|
6
|
+
postureFamily: 'seated',
|
|
7
|
+
visibilityThreshold: 0.3,
|
|
8
|
+
cameraAngle: 'side',
|
|
6
9
|
angles: [
|
|
7
10
|
{ name: 'hipFlexion', landmarkA: 11, landmarkB: 23, landmarkC: 25 },
|
|
8
11
|
{ name: 'kneeAngle', landmarkA: 23, landmarkB: 25, landmarkC: 27 },
|
package/src/config/bow-pose.ts
CHANGED
|
@@ -2,6 +2,9 @@ import type { ExerciseConfig } from '../NitroPoseExercises.nitro';
|
|
|
2
2
|
export const BOW_POSE_CONFIG: ExerciseConfig = {
|
|
3
3
|
name: 'Bow Pose (Dhanurasana)',
|
|
4
4
|
type: 'hold',
|
|
5
|
+
postureFamily: 'horizontalProne',
|
|
6
|
+
visibilityThreshold: 0.25,
|
|
7
|
+
cameraAngle: 'side',
|
|
5
8
|
angles: [
|
|
6
9
|
{ name: 'kneeAngle', landmarkA: 23, landmarkB: 25, landmarkC: 27 },
|
|
7
10
|
{ name: 'shoulderExtension', landmarkA: 23, landmarkB: 11, landmarkC: 15 },
|
|
@@ -3,6 +3,9 @@ import type { ExerciseConfig } from '../NitroPoseExercises.nitro';
|
|
|
3
3
|
export const BRIDGE_POSE_CONFIG: ExerciseConfig = {
|
|
4
4
|
name: 'Bridge Pose (Setu Bandhasana)',
|
|
5
5
|
type: 'hold',
|
|
6
|
+
postureFamily: 'supine',
|
|
7
|
+
visibilityThreshold: 0.3,
|
|
8
|
+
cameraAngle: 'side',
|
|
6
9
|
angles: [
|
|
7
10
|
{ name: 'hipExtension', landmarkA: 11, landmarkB: 23, landmarkC: 25 },
|
|
8
11
|
{ name: 'kneeAngle', landmarkA: 23, landmarkB: 25, landmarkC: 27 },
|
package/src/config/calf-raise.ts
CHANGED
|
@@ -3,6 +3,9 @@ import type { ExerciseConfig } from '../NitroPoseExercises.nitro';
|
|
|
3
3
|
export const CALF_RAISE_CONFIG: ExerciseConfig = {
|
|
4
4
|
name: 'Calf Raise',
|
|
5
5
|
type: 'rep',
|
|
6
|
+
postureFamily: 'standingUpright',
|
|
7
|
+
visibilityThreshold: 0.2,
|
|
8
|
+
cameraAngle: 'front',
|
|
6
9
|
angles: [
|
|
7
10
|
{ name: 'leftAnkle', landmarkA: 25, landmarkB: 27, landmarkC: 31 },
|
|
8
11
|
{ name: 'rightAnkle', landmarkA: 26, landmarkB: 28, landmarkC: 32 },
|
package/src/config/camel-pose.ts
CHANGED
|
@@ -2,6 +2,9 @@ import type { ExerciseConfig } from '../NitroPoseExercises.nitro';
|
|
|
2
2
|
export const CAMEL_POSE_CONFIG: ExerciseConfig = {
|
|
3
3
|
name: 'Camel Pose (Ustrasana)',
|
|
4
4
|
type: 'hold',
|
|
5
|
+
postureFamily: 'seated',
|
|
6
|
+
visibilityThreshold: 0.3,
|
|
7
|
+
cameraAngle: 'side',
|
|
5
8
|
angles: [
|
|
6
9
|
{ name: 'hipExtension', landmarkA: 11, landmarkB: 23, landmarkC: 25 },
|
|
7
10
|
{ name: 'kneeAngle', landmarkA: 23, landmarkB: 25, landmarkC: 27 },
|
package/src/config/chair-pose.ts
CHANGED
|
@@ -8,6 +8,9 @@ import type { ExerciseConfig } from '../NitroPoseExercises.nitro';
|
|
|
8
8
|
export const CHAIR_POSE_CONFIG: ExerciseConfig = {
|
|
9
9
|
name: 'Chair Pose (Utkatasana)',
|
|
10
10
|
type: 'hold',
|
|
11
|
+
postureFamily: 'standingUpright',
|
|
12
|
+
visibilityThreshold: 0.4,
|
|
13
|
+
cameraAngle: 'side',
|
|
11
14
|
angles: [
|
|
12
15
|
{
|
|
13
16
|
name: 'leftKnee',
|
|
@@ -2,6 +2,9 @@ import type { ExerciseConfig } from '../NitroPoseExercises.nitro';
|
|
|
2
2
|
export const CHILDS_POSE_CONFIG: ExerciseConfig = {
|
|
3
3
|
name: "Child's Pose (Balasana)",
|
|
4
4
|
type: 'hold',
|
|
5
|
+
postureFamily: 'seated',
|
|
6
|
+
visibilityThreshold: 0.3,
|
|
7
|
+
cameraAngle: 'side',
|
|
5
8
|
angles: [
|
|
6
9
|
{ name: 'hipFold', landmarkA: 11, landmarkB: 23, landmarkC: 25 },
|
|
7
10
|
{ name: 'kneeAngle', landmarkA: 23, landmarkB: 25, landmarkC: 27 },
|
package/src/config/cobra-pose.ts
CHANGED
|
@@ -8,6 +8,9 @@ import type { ExerciseConfig } from '../NitroPoseExercises.nitro';
|
|
|
8
8
|
export const COBRA_POSE_CONFIG: ExerciseConfig = {
|
|
9
9
|
name: 'Cobra Pose (Bhujangasana)',
|
|
10
10
|
type: 'hold',
|
|
11
|
+
postureFamily: 'horizontalProne',
|
|
12
|
+
visibilityThreshold: 0.25,
|
|
13
|
+
cameraAngle: 'side',
|
|
11
14
|
angles: [
|
|
12
15
|
{
|
|
13
16
|
name: 'leftElbow',
|
|
@@ -2,6 +2,9 @@ import type { ExerciseConfig } from '../NitroPoseExercises.nitro';
|
|
|
2
2
|
export const COBRA_WINGS_CONFIG: ExerciseConfig = {
|
|
3
3
|
name: 'Cobra Wings',
|
|
4
4
|
type: 'rep',
|
|
5
|
+
postureFamily: 'horizontalProne',
|
|
6
|
+
visibilityThreshold: 0.25,
|
|
7
|
+
cameraAngle: 'side',
|
|
5
8
|
angles: [
|
|
6
9
|
{ name: 'hipExtension', landmarkA: 11, landmarkB: 23, landmarkC: 25 },
|
|
7
10
|
{ name: 'leftShoulder', landmarkA: 23, landmarkB: 11, landmarkC: 13 },
|
package/src/config/dead-lift.ts
CHANGED
|
@@ -3,6 +3,9 @@ import type { ExerciseConfig } from '../NitroPoseExercises.nitro';
|
|
|
3
3
|
export const DEADLIFT_CONFIG: ExerciseConfig = {
|
|
4
4
|
name: 'Deadlift',
|
|
5
5
|
type: 'rep',
|
|
6
|
+
postureFamily: 'standingUpright',
|
|
7
|
+
visibilityThreshold: 0.3,
|
|
8
|
+
cameraAngle: 'side',
|
|
6
9
|
angles: [
|
|
7
10
|
{ name: 'leftHip', landmarkA: 11, landmarkB: 23, landmarkC: 25 },
|
|
8
11
|
{ name: 'rightHip', landmarkA: 12, landmarkB: 24, landmarkC: 26 },
|
|
@@ -9,6 +9,9 @@ import type { ExerciseConfig } from '../NitroPoseExercises.nitro';
|
|
|
9
9
|
export const DOWNWARD_DOG_CONFIG: ExerciseConfig = {
|
|
10
10
|
name: 'Downward Dog (Adho Mukha Svanasana)',
|
|
11
11
|
type: 'hold',
|
|
12
|
+
postureFamily: 'inverted',
|
|
13
|
+
visibilityThreshold: 0.3,
|
|
14
|
+
cameraAngle: 'side',
|
|
12
15
|
angles: [
|
|
13
16
|
{
|
|
14
17
|
name: 'hipAngle',
|
|
@@ -2,6 +2,9 @@ import type { ExerciseConfig } from '../NitroPoseExercises.nitro';
|
|
|
2
2
|
export const EXTENDED_SIDE_ANGLE_CONFIG: ExerciseConfig = {
|
|
3
3
|
name: 'Extended Side Angle (Utthita Parsvakonasana)',
|
|
4
4
|
type: 'hold',
|
|
5
|
+
postureFamily: 'standingUpright',
|
|
6
|
+
visibilityThreshold: 0.4,
|
|
7
|
+
cameraAngle: 'front',
|
|
5
8
|
angles: [
|
|
6
9
|
{ name: 'frontKnee', landmarkA: 23, landmarkB: 25, landmarkC: 27 },
|
|
7
10
|
{ name: 'backLeg', landmarkA: 24, landmarkB: 26, landmarkC: 28 },
|
package/src/config/fish-pose.ts
CHANGED
|
@@ -3,6 +3,9 @@ import type { ExerciseConfig } from '../NitroPoseExercises.nitro';
|
|
|
3
3
|
export const FISH_POSE_CONFIG: ExerciseConfig = {
|
|
4
4
|
name: 'Fish Pose (Matsyasana)',
|
|
5
5
|
type: 'hold',
|
|
6
|
+
postureFamily: 'supine',
|
|
7
|
+
visibilityThreshold: 0.3,
|
|
8
|
+
cameraAngle: 'side',
|
|
6
9
|
angles: [
|
|
7
10
|
{ name: 'chestOpen', landmarkA: 11, landmarkB: 23, landmarkC: 25 },
|
|
8
11
|
{ name: 'legs', landmarkA: 23, landmarkB: 25, landmarkC: 27 },
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type { ExerciseConfig } from '../NitroPoseExercises.nitro';
|
|
2
|
+
|
|
2
3
|
export const FRONT_RAISE_CONFIG: ExerciseConfig = {
|
|
3
4
|
name: 'Front Raise',
|
|
4
5
|
type: 'rep',
|
|
6
|
+
postureFamily: 'standingUpright',
|
|
7
|
+
visibilityThreshold: 0.2,
|
|
8
|
+
cameraAngle: 'side',
|
|
5
9
|
angles: [
|
|
6
10
|
{
|
|
7
11
|
name: 'leftShoulderFlexion',
|