chengkunli commited on
Commit
f2d863a
·
verified ·
1 Parent(s): da93824

Link MuscleMimic arXiv preprint in dataset card

Browse files
Files changed (1) hide show
  1. README.md +106 -103
README.md CHANGED
@@ -1,103 +1,106 @@
1
- ---
2
- license: other
3
- pretty_name: Boo Level Walking
4
- tags:
5
- - biomechanics
6
- - opensim
7
- - inverse-dynamics
8
- - gait
9
- ---
10
-
11
- # Policy Reference NPZ Data
12
-
13
- This dataset contains per-subject, per-trial `.npz` files exported from processed OpenSim inverse dynamics results for level walking.
14
-
15
- The files are intended for comparing policy inference outputs against OpenSim ID torques. Each exported trial uses the kinematics timeline as the master timeline, with time and timestep reset to start from zero.
16
-
17
- ID torques are normalized by the subject's weight in kg from `Subject_Demographics.xlsx`. GRF force components are normalized by body weight in Newtons, computed as `subject_weight_kg * 9.80665`.
18
-
19
- ## Processing Notes
20
-
21
- The `.npz` files are exported from the processed OpenSim ID outputs in `OpenSim_ID/batch_id_results`.
22
-
23
- Before inverse dynamics, the source pipeline applies the following trial-level processing:
24
-
25
- - `Step01` and `Step02` kinematics and GRF files are combined into one `Step01_Step02` window.
26
- - Kinematics are low-pass filtered before ID.
27
- - Subject-specific scaled OpenSim models are used when available, preferring `OpenSim_ID/scaled_models/<subject>/<subject>_scaled.osim`.
28
- - Trials are processed only when both step GRF files pass the double-peak vertical GRF check used by the batch ID script.
29
- - GRF point columns are converted from millimeters to meters when needed.
30
- - GRF force channels are assigned to `calcn_r` or `calcn_l` using TRC heel/toe marker proximity during stance. If TRC marker matching is unavailable, the script falls back to the COP-based side heuristic.
31
- - A per-trial, per-force-channel COP offset is estimated when the COP point is far from the assigned foot marker segment. This corrects force-plate point locations before ID, for example when one channel's COP is shifted by approximately a force-plate-length offset.
32
- - Trials are skipped during batch ID if the corrected COP has too little early-to-late displacement along the assigned foot's heel-to-toe marker segment, too little early-to-late movement in the lab frame, or remains too far from the assigned foot after correction. These checks are normalized by the subject's heel-to-toe marker length, so the QC is not based on an absolute foot size.
33
-
34
- The exported `computed_grf` therefore reflects the corrected GRF file used for inverse dynamics. Force-vector columns are normalized by body weight in Newtons in the `.npz`; COP and ground-torque columns remain in their corrected physical units.
35
-
36
- ## Folder Structure
37
-
38
- ```text
39
- S011/
40
- S011_Trial01_Step01_Step02.npz
41
- S011_Trial02_Step01_Step02.npz
42
- ...
43
- S012/
44
- S012_Trial01_Step01_Step02.npz
45
- ...
46
- ```
47
-
48
- Each `.npz` file corresponds to one subject/trial/step window.
49
-
50
- ## Arrays
51
-
52
- Each file contains:
53
-
54
- | Key | Shape | Description |
55
- | --- | --- | --- |
56
- | `subject` | scalar string | Subject ID, for example `S011`. |
57
- | `trial` | scalar string | Trial name, for example `Trial01`. |
58
- | `step_label` | scalar string | Step label, currently `Step01_Step02`. |
59
- | `timestep` | `(T,)` | Zero-based integer timestep over the kinematics sequence. |
60
- | `time_sec` | `(T,)` | Kinematics time in seconds, shifted so the first frame is `0.0`. |
61
- | `source_time_sec` | `(T,)` | Same zero-start kinematics time as `time_sec`. |
62
- | `original_kinematics_time_sec` | `(T,)` | Original OpenSim kinematics timestamps before zero-shifting. |
63
- | `id_source_time_sec` | `(N_id,)` | Original ID timestamps shifted relative to the first kinematics frame. |
64
- | `original_id_source_time_sec` | `(N_id,)` | Original OpenSim ID timestamps before zero-shifting. |
65
- | `joint_angle` | `(T, N_angle)` | Joint angle / coordinate values from kinematics, on the kinematics timeline. |
66
- | `joint_angle_columns` | `(N_angle,)` | Column names for `joint_angle`. |
67
- | `joint_torque` | `(T, N_torque)` | ID torques from the processed OpenSim ID run, aligned onto the kinematics timeline and divided by `subject_weight_kg`. Missing rows are `NaN`. |
68
- | `joint_torque_columns` | `(N_torque,)` | Column names for `joint_torque`. |
69
- | `joint_torque_valid` | `(T,)` | Boolean mask where `joint_torque` has valid ID values. |
70
- | `joint_torque_normalization` | scalar string | Normalization applied to `joint_torque`, currently `divided_by_subject_weight_kg`. |
71
- | `joint_torque_units` | scalar string | Normalized torque units, currently `original_ID_units_per_kg`. |
72
- | `subject_weight_kg` | scalar float | Subject weight used for normalizing `joint_torque`. |
73
- | `subject_body_weight_n` | scalar float | Subject body weight in Newtons, computed as `subject_weight_kg * 9.80665`. |
74
- | `computed_grf` | `(T, N_grf)` | Corrected GRF values used by ID, interpolated onto the kinematics timeline. Force-vector columns are divided by `subject_body_weight_n`; COP and torque columns remain in corrected physical units. |
75
- | `computed_grf_columns` | `(N_grf,)` | Column names for `computed_grf`. |
76
- | `computed_grf_valid` | `(T,)` | Boolean mask where `computed_grf` has valid values. |
77
- | `computed_grf_normalization` | scalar string | Normalization applied to `computed_grf`, currently `force_columns_divided_by_subject_body_weight_n`. |
78
- | `computed_grf_units` | scalar string | Force columns are in body weight units; COP and torque columns remain in corrected physical units. |
79
- | `source_files` | `(3,)` | Source kinematics, ID torque, and GRF file paths used for export. |
80
-
81
- ## Policy Comparison
82
-
83
- Run policy inference using `joint_angle`. The policy output should have the same first dimension `T`.
84
-
85
- Compare predicted normalized torque against OpenSim ID only where `joint_torque_valid` is true:
86
-
87
- ```python
88
- import numpy as np
89
-
90
- data = np.load("S011/S011_Trial01_Step01_Step02.npz")
91
-
92
- joint_angle = data["joint_angle"]
93
- target_torque = data["joint_torque"]
94
- valid = data["joint_torque_valid"]
95
- subject_weight_kg = float(data["subject_weight_kg"])
96
-
97
- predicted_torque = policy(joint_angle)
98
- predicted_torque = predicted_torque / subject_weight_kg
99
-
100
- error = predicted_torque[valid] - target_torque[valid]
101
- ```
102
-
103
- Rows where `joint_torque_valid` is false correspond to kinematics frames without an ID result and should be skipped for torque comparison.
 
 
 
 
1
+ ---
2
+ license: other
3
+ pretty_name: Boo Level Walking
4
+ tags:
5
+ - arxiv:2603.25544
6
+ - biomechanics
7
+ - opensim
8
+ - inverse-dynamics
9
+ - gait
10
+ ---
11
+
12
+ # Policy Reference NPZ Data
13
+
14
+ **MuscleMimic paper:** [Towards Embodied AI with MuscleMimic: Unlocking full-body musculoskeletal motor learning at scale](https://arxiv.org/abs/2603.25544).
15
+
16
+ This dataset contains per-subject, per-trial `.npz` files exported from processed OpenSim inverse dynamics results for level walking.
17
+
18
+ The files are intended for comparing policy inference outputs against OpenSim ID torques. Each exported trial uses the kinematics timeline as the master timeline, with time and timestep reset to start from zero.
19
+
20
+ ID torques are normalized by the subject's weight in kg from `Subject_Demographics.xlsx`. GRF force components are normalized by body weight in Newtons, computed as `subject_weight_kg * 9.80665`.
21
+
22
+ ## Processing Notes
23
+
24
+ The `.npz` files are exported from the processed OpenSim ID outputs in `OpenSim_ID/batch_id_results`.
25
+
26
+ Before inverse dynamics, the source pipeline applies the following trial-level processing:
27
+
28
+ - `Step01` and `Step02` kinematics and GRF files are combined into one `Step01_Step02` window.
29
+ - Kinematics are low-pass filtered before ID.
30
+ - Subject-specific scaled OpenSim models are used when available, preferring `OpenSim_ID/scaled_models/<subject>/<subject>_scaled.osim`.
31
+ - Trials are processed only when both step GRF files pass the double-peak vertical GRF check used by the batch ID script.
32
+ - GRF point columns are converted from millimeters to meters when needed.
33
+ - GRF force channels are assigned to `calcn_r` or `calcn_l` using TRC heel/toe marker proximity during stance. If TRC marker matching is unavailable, the script falls back to the COP-based side heuristic.
34
+ - A per-trial, per-force-channel COP offset is estimated when the COP point is far from the assigned foot marker segment. This corrects force-plate point locations before ID, for example when one channel's COP is shifted by approximately a force-plate-length offset.
35
+ - Trials are skipped during batch ID if the corrected COP has too little early-to-late displacement along the assigned foot's heel-to-toe marker segment, too little early-to-late movement in the lab frame, or remains too far from the assigned foot after correction. These checks are normalized by the subject's heel-to-toe marker length, so the QC is not based on an absolute foot size.
36
+
37
+ The exported `computed_grf` therefore reflects the corrected GRF file used for inverse dynamics. Force-vector columns are normalized by body weight in Newtons in the `.npz`; COP and ground-torque columns remain in their corrected physical units.
38
+
39
+ ## Folder Structure
40
+
41
+ ```text
42
+ S011/
43
+ S011_Trial01_Step01_Step02.npz
44
+ S011_Trial02_Step01_Step02.npz
45
+ ...
46
+ S012/
47
+ S012_Trial01_Step01_Step02.npz
48
+ ...
49
+ ```
50
+
51
+ Each `.npz` file corresponds to one subject/trial/step window.
52
+
53
+ ## Arrays
54
+
55
+ Each file contains:
56
+
57
+ | Key | Shape | Description |
58
+ | --- | --- | --- |
59
+ | `subject` | scalar string | Subject ID, for example `S011`. |
60
+ | `trial` | scalar string | Trial name, for example `Trial01`. |
61
+ | `step_label` | scalar string | Step label, currently `Step01_Step02`. |
62
+ | `timestep` | `(T,)` | Zero-based integer timestep over the kinematics sequence. |
63
+ | `time_sec` | `(T,)` | Kinematics time in seconds, shifted so the first frame is `0.0`. |
64
+ | `source_time_sec` | `(T,)` | Same zero-start kinematics time as `time_sec`. |
65
+ | `original_kinematics_time_sec` | `(T,)` | Original OpenSim kinematics timestamps before zero-shifting. |
66
+ | `id_source_time_sec` | `(N_id,)` | Original ID timestamps shifted relative to the first kinematics frame. |
67
+ | `original_id_source_time_sec` | `(N_id,)` | Original OpenSim ID timestamps before zero-shifting. |
68
+ | `joint_angle` | `(T, N_angle)` | Joint angle / coordinate values from kinematics, on the kinematics timeline. |
69
+ | `joint_angle_columns` | `(N_angle,)` | Column names for `joint_angle`. |
70
+ | `joint_torque` | `(T, N_torque)` | ID torques from the processed OpenSim ID run, aligned onto the kinematics timeline and divided by `subject_weight_kg`. Missing rows are `NaN`. |
71
+ | `joint_torque_columns` | `(N_torque,)` | Column names for `joint_torque`. |
72
+ | `joint_torque_valid` | `(T,)` | Boolean mask where `joint_torque` has valid ID values. |
73
+ | `joint_torque_normalization` | scalar string | Normalization applied to `joint_torque`, currently `divided_by_subject_weight_kg`. |
74
+ | `joint_torque_units` | scalar string | Normalized torque units, currently `original_ID_units_per_kg`. |
75
+ | `subject_weight_kg` | scalar float | Subject weight used for normalizing `joint_torque`. |
76
+ | `subject_body_weight_n` | scalar float | Subject body weight in Newtons, computed as `subject_weight_kg * 9.80665`. |
77
+ | `computed_grf` | `(T, N_grf)` | Corrected GRF values used by ID, interpolated onto the kinematics timeline. Force-vector columns are divided by `subject_body_weight_n`; COP and torque columns remain in corrected physical units. |
78
+ | `computed_grf_columns` | `(N_grf,)` | Column names for `computed_grf`. |
79
+ | `computed_grf_valid` | `(T,)` | Boolean mask where `computed_grf` has valid values. |
80
+ | `computed_grf_normalization` | scalar string | Normalization applied to `computed_grf`, currently `force_columns_divided_by_subject_body_weight_n`. |
81
+ | `computed_grf_units` | scalar string | Force columns are in body weight units; COP and torque columns remain in corrected physical units. |
82
+ | `source_files` | `(3,)` | Source kinematics, ID torque, and GRF file paths used for export. |
83
+
84
+ ## Policy Comparison
85
+
86
+ Run policy inference using `joint_angle`. The policy output should have the same first dimension `T`.
87
+
88
+ Compare predicted normalized torque against OpenSim ID only where `joint_torque_valid` is true:
89
+
90
+ ```python
91
+ import numpy as np
92
+
93
+ data = np.load("S011/S011_Trial01_Step01_Step02.npz")
94
+
95
+ joint_angle = data["joint_angle"]
96
+ target_torque = data["joint_torque"]
97
+ valid = data["joint_torque_valid"]
98
+ subject_weight_kg = float(data["subject_weight_kg"])
99
+
100
+ predicted_torque = policy(joint_angle)
101
+ predicted_torque = predicted_torque / subject_weight_kg
102
+
103
+ error = predicted_torque[valid] - target_torque[valid]
104
+ ```
105
+
106
+ Rows where `joint_torque_valid` is false correspond to kinematics frames without an ID result and should be skipped for torque comparison.