Skip to content

Commit

Permalink
Course poses fine tuning
Browse files Browse the repository at this point in the history
It's still not perfect, some weights and angles probably need more
adjustments. But at least it should be ready for a field test.
  • Loading branch information
jakmeier committed Sep 7, 2024
1 parent 78d607e commit 91e52c4
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/** @type {PoseApproximation} */
export let pose;
/** @type {number} */
export let threshold = 0.075;
export let threshold = 0.05;
$: max = 3 * threshold;
/** @type {number} */
Expand Down
29 changes: 17 additions & 12 deletions bouncy_frontend/static/courses/000-rm-basics.ron
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
// ],
// ),
(
// TODO: should I add an ID for better robustness in progress tracking across updates?
names: {"de": "Kick", "en": "Kick"},
icon: "todo.svg",
video: "/video/l1.mp4",
Expand Down Expand Up @@ -265,11 +266,12 @@
name: "kick-right",
direction: Right,
limbs: [
(limb: LeftThigh, angle: -10, tolerance: 5, weight: 0.5),
(limb: LeftShin, angle: -15, tolerance: 5, weight: 0.5),
(limb: LeftLeg, angle: -12, tolerance: 5, weight: 1.0),
(limb: RightThigh, angle: 25, tolerance: 5, weight: 1.0),
(limb: RightShin, angle: 20, tolerance: 10, weight: 0.5),
(limb: LeftThigh, angle: -10, tolerance: 5, weight: 0.25),
(limb: LeftShin, angle: -15, tolerance: 5, weight: 0.25),
(limb: LeftLeg, angle: -12, tolerance: 5, weight: 0.5),
(limb: RightThigh, angle: 30, tolerance: 5, weight: 0.5),
(limb: RightShin, angle: 25, tolerance: 5, weight: 0.5),
(limb: RightLeg, angle: 30, tolerance: 5, weight: 1.0),
(limb: RightFoot, angle: 100, tolerance: 10, weight: 0.0),
(limb: LeftFoot, angle: 90, tolerance: 0, weight: 0.0),
(limb: LeftArm, angle: 0, tolerance: 0, weight: 0.0),
Expand All @@ -283,11 +285,13 @@
name: "centered-sideway",
direction: Right,
limbs: [
(limb: LeftShin, angle: 0, tolerance: 5, weight: 1.0),
(limb: LeftThigh, angle: 0, tolerance: 5, weight: 1.0),
(limb: LeftShin, angle: 0, tolerance: 2, weight: 0.0),
(limb: LeftThigh, angle: 0, tolerance: 2, weight: 0.0),
(limb: LeftLeg, angle: 0, tolerance: 0, weight: 1.0),
(limb: LeftFoot, angle: 90, tolerance: 0, weight: 0.0),
(limb: RightShin, angle: 0, tolerance: 5, weight: 1.0),
(limb: RightThigh, angle: 0, tolerance: 5, weight: 1.0),
(limb: RightShin, angle: 0, tolerance: 2, weight: 0.0),
(limb: RightThigh, angle: 0, tolerance: 2, weight: 0.0),
(limb: RightLeg, angle: 0, tolerance: 0, weight: 1.0),
(limb: RightArm, angle: 6, tolerance: 0, weight: 0.0),
(limb: RightForearm, angle: 18, tolerance: 0, weight: 0.0),
(limb: RightFoot, angle: 90, tolerance: 0, weight: 0.0),
Expand All @@ -304,8 +308,9 @@
(limb: LeftShin, angle: -25, tolerance: 5, weight: 0.5),
(limb: LeftLeg, angle: -30, tolerance: 5, weight: 1.0),
(limb: RightThigh, angle: 40, tolerance: 5, weight: 1.0),
(limb: RightShin, angle: 0, tolerance: 10, weight: 0.5),
(limb: RightFoot, angle: 90, tolerance: 10, weight: 0.25),
(limb: RightShin, angle: 0, tolerance: 5, weight: 0.5),
(limb: RightLeg, angle: 10, tolerance: 5, weight: 0.5),
(limb: RightFoot, angle: 90, tolerance: 10, weight: 0.0),
(limb: LeftFoot, angle: 90, tolerance: 0, weight: 0.0),
(limb: LeftArm, angle: 0, tolerance: 0, weight: 0.0),
(limb: LeftForearm, angle: 96, tolerance: 0, weight: 0.0),
Expand All @@ -322,7 +327,7 @@
limbs: [
(limb: LeftLeg, angle: 0, tolerance: 3, weight: 1.0),
(limb: RightLeg, angle: 0, tolerance: 5, weight: 0.5),
(limb: RightShin, angle: -30, tolerance: 5, weight: 1.0),
(limb: RightShin, angle: -50, tolerance: 10, weight: 1.0),
(limb: RightThigh, angle: 60, tolerance: 5, weight: 1.0),
(limb: LeftArm, angle: 6, tolerance: 0, weight: 0.0),
(limb: LeftForearm, angle: 18, tolerance: 0, weight: 0.0),
Expand Down
2 changes: 1 addition & 1 deletion bouncy_instructor/src/intern/dance_detector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl Default for DanceDetector {
Self {
bpm: 120.0,
half_speed: false,
error_threshold: 0.075,
error_threshold: 0.05,
detected: DetectionResult::default(),
target_step: None,
tracked_beats: None,
Expand Down
8 changes: 3 additions & 5 deletions bouncy_instructor/src/intern/pose/approximation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,9 @@ impl Tracker {
};

// for debugging, quite useful for now
for (angle, name) in skeleton
.angles()
.iter()
.zip(crate::intern::pose::Limb::base_limb_names())
{
for (limb_index, _limb) in self.db.limbs() {
let name = self.db.limb_name(limb_index);
let angle = skeleton.angles()[limb_index.as_usize()];
crate::println!("{name}: {angle:?}");
}

Expand Down

0 comments on commit 91e52c4

Please sign in to comment.