-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from wearable-motion-capture/parrot_control
Parrot control
- Loading branch information
Showing
36 changed files
with
1,573 additions
and
264 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import argparse | ||
import atexit | ||
import logging | ||
import queue | ||
import signal | ||
import threading | ||
|
||
from wear_mocap_ape import config | ||
from wear_mocap_ape.data_types import messaging | ||
from wear_mocap_ape.stream.listener.imu import ImuListener | ||
from wear_mocap_ape.stream.publisher.kalman_pocket_phone_udp import KalmanPhonePocket | ||
|
||
if __name__ == "__main__": | ||
logging.basicConfig(level=logging.INFO) | ||
# Instantiate the parser | ||
parser = argparse.ArgumentParser(description='') | ||
|
||
# Required IP argument | ||
parser.add_argument('ip', type=str, help=f'put your local IP here.') | ||
parser.add_argument('smooth', nargs='?', type=int, default=5, help=f'smooth predicted trajectories') | ||
parser.add_argument('stream_mc', nargs='?', type=bool, default=True, help=f'whether you want to stream the full pose ensemble') | ||
args = parser.parse_args() | ||
|
||
ip_arg = args.ip | ||
smooth_arg = args.smooth | ||
stream_mc_arg = args.stream_mc | ||
|
||
# data for left-hand mode | ||
left_q = queue.Queue() | ||
|
||
# listen for imu data from phone and watch | ||
imu_l = ImuListener( | ||
ip=ip_arg, | ||
msg_size=messaging.watch_phone_imu_msg_len, | ||
port=config.PORT_LISTEN_WATCH_PHONE_IMU_LEFT, | ||
tag="LISTEN IMU LEFT" | ||
) | ||
l_thread = threading.Thread( | ||
target=imu_l.listen, | ||
args=(left_q,) | ||
) | ||
|
||
# process into arm pose and body orientation | ||
kpp = KalmanPhonePocket(ip=ip_arg, | ||
smooth=smooth_arg, | ||
num_ensemble=48, | ||
port=config.PORT_PUB_LEFT_ARM, | ||
window_size=10, | ||
stream_mc=stream_mc_arg, | ||
model_name="SW-model-sept-4") | ||
p_thread = threading.Thread( | ||
target=kpp.stream_wearable_devices, | ||
args=(left_q, True,) | ||
) | ||
|
||
l_thread.start() | ||
p_thread.start() | ||
|
||
|
||
def terminate_all(*args): | ||
imu_l.terminate() | ||
kpp.terminate() | ||
|
||
|
||
# make sure all handler exit on termination | ||
atexit.register(terminate_all) | ||
signal.signal(signal.SIGTERM, terminate_all) | ||
signal.signal(signal.SIGINT, terminate_all) | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+1.31 KB
src/wear_mocap_ape/data_deploy/data_stats/WATCH_ONLY_KALMAN_STATE.pkl
Binary file not shown.
Binary file added
BIN
+1.11 KB
src/wear_mocap_ape/data_deploy/data_stats/WATCH_ONLY_POS_RH_LARM_HAND.pkl
Binary file not shown.
Binary file added
BIN
+1.46 KB
src/wear_mocap_ape/data_deploy/data_stats/WATCH_PH_HIP_KALMAN_PHONE_POCKET.pkl
Binary file not shown.
Binary file added
BIN
+1.46 KB
src/wear_mocap_ape/data_deploy/data_stats/WATCH_PH_HIP_ORI_CALIB_UARM_LARM_HIPS.pkl
Binary file not shown.
Binary file added
BIN
+1.48 KB
src/wear_mocap_ape/data_deploy/data_stats/WATCH_PH_HIP_ORI_CAL_LARM_UARM_HIPS.pkl
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+24.3 MB
src/wear_mocap_ape/data_deploy/nn/04d2d059ee8980e13e5e16fe048b6bd0f8265c9a/checkpoint.pt
Binary file not shown.
60 changes: 60 additions & 0 deletions
60
src/wear_mocap_ape/data_deploy/nn/04d2d059ee8980e13e5e16fe048b6bd0f8265c9a/results.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{ | ||
"model": "ImuPoseLSTM", | ||
"hidden_layer_count": 2, | ||
"hidden_layer_size": 128, | ||
"epochs": 200, | ||
"batch_size": 64, | ||
"learning_rate": 0.001, | ||
"dropout": 0.4, | ||
"sequence_len": 5, | ||
"normalize": true, | ||
"seq_overlap": true, | ||
"create_norm_stats": true, | ||
"hash": "04d2d059ee8980e13e5e16fe048b6bd0f8265c9a", | ||
"y_targets_n": "ORI_CAL_LARM_UARM_HIPS", | ||
"x_inputs_n": "WATCH_PH_HIP", | ||
"y_targets_v": [ | ||
"gt_larm_6drr_cal_1", | ||
"gt_larm_6drr_cal_2", | ||
"gt_larm_6drr_cal_3", | ||
"gt_larm_6drr_cal_4", | ||
"gt_larm_6drr_cal_5", | ||
"gt_larm_6drr_cal_6", | ||
"gt_uarm_6drr_cal_1", | ||
"gt_uarm_6drr_cal_2", | ||
"gt_uarm_6drr_cal_3", | ||
"gt_uarm_6drr_cal_4", | ||
"gt_uarm_6drr_cal_5", | ||
"gt_uarm_6drr_cal_6", | ||
"gt_hips_yrot_cal_sin", | ||
"gt_hips_yrot_cal_cos" | ||
], | ||
"x_inputs_v": [ | ||
"sw_dt", | ||
"sw_gyro_x", | ||
"sw_gyro_y", | ||
"sw_gyro_z", | ||
"sw_lvel_x", | ||
"sw_lvel_y", | ||
"sw_lvel_z", | ||
"sw_lacc_x", | ||
"sw_lacc_y", | ||
"sw_lacc_z", | ||
"sw_grav_x", | ||
"sw_grav_y", | ||
"sw_grav_z", | ||
"sw_6drr_cal_1", | ||
"sw_6drr_cal_2", | ||
"sw_6drr_cal_3", | ||
"sw_6drr_cal_4", | ||
"sw_6drr_cal_5", | ||
"sw_6drr_cal_6", | ||
"sw_pres_cal", | ||
"ph_hips_yrot_cal_sin", | ||
"ph_hips_yrot_cal_cos" | ||
], | ||
"Loss/train": 0.13687036271612407, | ||
"Loss/test": 0.28687360928033256, | ||
"Loss/b_train": 0.1611349323569118, | ||
"Loss/b_test": 0.2804641976381203 | ||
} |
Binary file added
BIN
+1.6 MB
src/wear_mocap_ape/data_deploy/nn/2b4e48b366d717b035751c40f977d9ae6c26d6b2/checkpoint.pt
Binary file not shown.
50 changes: 50 additions & 0 deletions
50
src/wear_mocap_ape/data_deploy/nn/2b4e48b366d717b035751c40f977d9ae6c26d6b2/results.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"model": "DropoutFF", | ||
"hidden_layer_count": 4, | ||
"hidden_layer_size": 128, | ||
"epochs": 200, | ||
"batch_size": 64, | ||
"learning_rate": 0.0001, | ||
"dropout": 0.2, | ||
"sequence_len": 5, | ||
"normalize": true, | ||
"seq_overlap": true, | ||
"create_norm_stats": true, | ||
"hash": "2b4e48b366d717b035751c40f977d9ae6c26d6b2", | ||
"y_targets_n": "POS_RH_LARM_HAND", | ||
"x_inputs_n": "WATCH_ONLY", | ||
"y_targets_v": [ | ||
"gt_hand_orig_rua_x", | ||
"gt_hand_orig_rua_y", | ||
"gt_hand_orig_rua_z", | ||
"gt_larm_orig_rua_x", | ||
"gt_larm_orig_rua_y", | ||
"gt_larm_orig_rua_z" | ||
], | ||
"x_inputs_v": [ | ||
"sw_dt", | ||
"sw_gyro_x", | ||
"sw_gyro_y", | ||
"sw_gyro_z", | ||
"sw_lvel_x", | ||
"sw_lvel_y", | ||
"sw_lvel_z", | ||
"sw_lacc_x", | ||
"sw_lacc_y", | ||
"sw_lacc_z", | ||
"sw_grav_x", | ||
"sw_grav_y", | ||
"sw_grav_z", | ||
"sw_6drr_cal_1", | ||
"sw_6drr_cal_2", | ||
"sw_6drr_cal_3", | ||
"sw_6drr_cal_4", | ||
"sw_6drr_cal_5", | ||
"sw_6drr_cal_6", | ||
"sw_pres_cal" | ||
], | ||
"Loss/train": 0.24004665516297385, | ||
"Loss/test": 0.377081323361239, | ||
"Loss/b_train": 0.2682442721176126, | ||
"Loss/b_test": 0.3734141369143522 | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
from enum import Enum | ||
|
||
|
||
class FF(Enum): | ||
WATCH_ONLY = "2b4e48b366d717b035751c40f977d9ae6c26d6b2" | ||
|
||
|
||
class LSTM(Enum): | ||
WATCH_ONLY = "2c700a1ca1af084eedbae5bdd86a5194e42ded4d" | ||
IMU_EXMP = "04d2d059ee8980e13e5e16fe048b6bd0f8265c9a" | ||
WATCH_PHONE_POCKET = "ec70862ec17828320ca64a738b2a90cf5dcadced" |
Binary file added
BIN
+4.86 MB
src/wear_mocap_ape/data_deploy/nn/ec70862ec17828320ca64a738b2a90cf5dcadced/checkpoint.pt
Binary file not shown.
60 changes: 60 additions & 0 deletions
60
src/wear_mocap_ape/data_deploy/nn/ec70862ec17828320ca64a738b2a90cf5dcadced/results.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{ | ||
"model": "DropoutLSTM", | ||
"hidden_layer_count": 2, | ||
"hidden_layer_size": 128, | ||
"epochs": 200, | ||
"batch_size": 64, | ||
"learning_rate": 0.001, | ||
"dropout": 0.4, | ||
"sequence_len": 5, | ||
"normalize": true, | ||
"seq_overlap": true, | ||
"create_norm_stats": true, | ||
"hash": "ec70862ec17828320ca64a738b2a90cf5dcadced", | ||
"y_targets_n": "ORI_CAL_LARM_UARM_HIPS", | ||
"x_inputs_n": "WATCH_PH_HIP", | ||
"y_targets_v": [ | ||
"gt_larm_6drr_cal_1", | ||
"gt_larm_6drr_cal_2", | ||
"gt_larm_6drr_cal_3", | ||
"gt_larm_6drr_cal_4", | ||
"gt_larm_6drr_cal_5", | ||
"gt_larm_6drr_cal_6", | ||
"gt_uarm_6drr_cal_1", | ||
"gt_uarm_6drr_cal_2", | ||
"gt_uarm_6drr_cal_3", | ||
"gt_uarm_6drr_cal_4", | ||
"gt_uarm_6drr_cal_5", | ||
"gt_uarm_6drr_cal_6", | ||
"gt_hips_yrot_cal_sin", | ||
"gt_hips_yrot_cal_cos" | ||
], | ||
"x_inputs_v": [ | ||
"sw_dt", | ||
"sw_gyro_x", | ||
"sw_gyro_y", | ||
"sw_gyro_z", | ||
"sw_lvel_x", | ||
"sw_lvel_y", | ||
"sw_lvel_z", | ||
"sw_lacc_x", | ||
"sw_lacc_y", | ||
"sw_lacc_z", | ||
"sw_grav_x", | ||
"sw_grav_y", | ||
"sw_grav_z", | ||
"sw_6drr_cal_1", | ||
"sw_6drr_cal_2", | ||
"sw_6drr_cal_3", | ||
"sw_6drr_cal_4", | ||
"sw_6drr_cal_5", | ||
"sw_6drr_cal_6", | ||
"sw_pres_cal", | ||
"ph_hips_yrot_cal_sin", | ||
"ph_hips_yrot_cal_cos" | ||
], | ||
"Loss/train": 0.19960083461272307, | ||
"Loss/test": 0.2753936388019971, | ||
"Loss/b_train": 0.19960083461272307, | ||
"Loss/b_test": 0.2753936388019971 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.