%to get an idea about model parametrization..

% goal is to parametrize finger base and associated palm center with one
% single center position, and offset accordingly 

% TURNS OUT IT COULD BE A SHITTY IDEA SINCE NO CLEAR PATTERN
% SHOULD USE FULL PARAMETRIZATION OF HAND...NEED TO REFACTOR A LOT :/

% MEMBRANES SHOULD ANYWAYS BE REPARAMETRIZED

clc
clear
close all
addpath(genpath('../'))

%% LOAD HAND MODEL

load('hand_model.mat');

%% DISPLAY HAND MODEL

display_model(hand_model, 0.9, 'big')


 %% EXPLORE
 
disp('thumb')
finger_palm = hand_model.palm_wrist_centers{hand_model.palm_wrist_names_map('palm_thumb')}
finger_base = hand_model.segments{1}{1}.global(1:3,4)
finger_base - finger_palm 
 
disp('index')
finger_palm = hand_model.palm_wrist_centers{hand_model.palm_wrist_names_map('palm_index')}
finger_base = hand_model.segments{2}{1}.global(1:3,4)
finger_base - finger_palm

disp('middle')
finger_palm = hand_model.palm_wrist_centers{hand_model.palm_wrist_names_map('palm_middle')}
finger_base = hand_model.segments{3}{1}.global(1:3,4)
finger_base - finger_palm

disp('ring')
finger_palm = hand_model.palm_wrist_centers{hand_model.palm_wrist_names_map('palm_ring')}
finger_base = hand_model.segments{4}{1}.global(1:3,4)
finger_base - finger_palm

disp('pinky')
finger_palm = hand_model.palm_wrist_centers{hand_model.palm_wrist_names_map('palm_pinky')}
finger_base = hand_model.segments{5}{1}.global(1:3,4)
finger_base - finger_palm


