Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
obsDict2List - NeurIPS 2019: Learn to Move - Walk Around
def obsDict2List(oldObs):
newObs = []
for l1 in oldObs['v_tgt_field']:
for l2 in l1:
newObs.extend(l2)
newObs.append(oldObs['pelvis']['height'])
newObs.append(oldObs['pelvis']['pitch'])
newObs.append(oldObs['pelvis']['roll'])
newObs.extend(oldObs['pelvis']['vel'])
newObs.extend(oldObs['r_leg']['ground_reaction_forces'])
newObs.append(oldObs['r_leg']['joint']['hip_abd'])
newObs.append(oldObs['r_leg']['joint']['hip'])
newObs.append(oldObs['r_leg']['joint']['knee'])
newObs.append(oldObs['r_leg']['joint']['ankle'])
newObs.append(oldObs['r_leg']['d_joint']['hip_abd'])
newObs.append(oldObs['r_leg']['d_joint']['hip'])
newObs.append(oldObs['r_leg']['d_joint']['knee'])
newObs.append(oldObs['r_leg']['d_joint']['ankle'])
newObs.append(oldObs['r_leg']['HAB']['f'])
newObs.append(oldObs['r_leg']['HAB']['l'])
newObs.append(oldObs['r_leg']['HAB']['v'])
newObs.append(oldObs['r_leg']['HAD']['f'])
newObs.append(oldObs['r_leg']['HAD']['l'])
newObs.append(oldObs['r_leg']['HAD']['v'])
newObs.append(oldObs['r_leg']['HFL']['f'])
newObs.append(oldObs['r_leg']['HFL']['l'])
newObs.append(oldObs['r_leg']['HFL']['v'])
newObs.append(oldObs['r_leg']['GLU']['f'])
newObs.append(oldObs['r_leg']['GLU']['l'])
newObs.append(oldObs['r_leg']['GLU']['v'])
newObs.append(oldObs['r_leg']['HAM']['f'])
newObs.append(oldObs['r_leg']['HAM']['l'])
newObs.append(oldObs['r_leg']['HAM']['v'])
newObs.append(oldObs['r_leg']['RF']['f'])
newObs.append(oldObs['r_leg']['RF']['l'])
newObs.append(oldObs['r_leg']['RF']['v'])
newObs.append(oldObs['r_leg']['VAS']['f'])
newObs.append(oldObs['r_leg']['VAS']['l'])
newObs.append(oldObs['r_leg']['VAS']['v'])
newObs.append(oldObs['r_leg']['BFSH']['f'])
newObs.append(oldObs['r_leg']['BFSH']['l'])
newObs.append(oldObs['r_leg']['BFSH']['v'])
newObs.append(oldObs['r_leg']['GAS']['f'])
newObs.append(oldObs['r_leg']['GAS']['l'])
newObs.append(oldObs['r_leg']['GAS']['v'])
newObs.append(oldObs['r_leg']['SOL']['f'])
newObs.append(oldObs['r_leg']['SOL']['l'])
newObs.append(oldObs['r_leg']['SOL']['v'])
newObs.append(oldObs['r_leg']['TA']['f'])
newObs.append(oldObs['r_leg']['TA']['l'])
newObs.append(oldObs['r_leg']['TA']['v'])
newObs.extend(oldObs['l_leg']['ground_reaction_forces'])
newObs.append(oldObs['l_leg']['joint']['hip_abd'])
newObs.append(oldObs['l_leg']['joint']['hip'])
newObs.append(oldObs['l_leg']['joint']['knee'])
newObs.append(oldObs['l_leg']['joint']['ankle'])
newObs.append(oldObs['l_leg']['d_joint']['hip_abd'])
newObs.append(oldObs['l_leg']['d_joint']['hip'])
newObs.append(oldObs['l_leg']['d_joint']['knee'])
newObs.append(oldObs['l_leg']['d_joint']['ankle'])
newObs.append(oldObs['l_leg']['HAB']['f'])
newObs.append(oldObs['l_leg']['HAB']['l'])
newObs.append(oldObs['l_leg']['HAB']['v'])
newObs.append(oldObs['l_leg']['HAD']['f'])
newObs.append(oldObs['l_leg']['HAD']['l'])
newObs.append(oldObs['l_leg']['HAD']['v'])
newObs.append(oldObs['l_leg']['HFL']['f'])
newObs.append(oldObs['l_leg']['HFL']['l'])
newObs.append(oldObs['l_leg']['HFL']['v'])
newObs.append(oldObs['l_leg']['GLU']['f'])
newObs.append(oldObs['l_leg']['GLU']['l'])
newObs.append(oldObs['l_leg']['GLU']['v'])
newObs.append(oldObs['l_leg']['HAM']['f'])
newObs.append(oldObs['l_leg']['HAM']['l'])
newObs.append(oldObs['l_leg']['HAM']['v'])
newObs.append(oldObs['l_leg']['RF']['f'])
newObs.append(oldObs['l_leg']['RF']['l'])
newObs.append(oldObs['l_leg']['RF']['v'])
newObs.append(oldObs['l_leg']['VAS']['f'])
newObs.append(oldObs['l_leg']['VAS']['l'])
newObs.append(oldObs['l_leg']['VAS']['v'])
newObs.append(oldObs['l_leg']['BFSH']['f'])
newObs.append(oldObs['l_leg']['BFSH']['l'])
newObs.append(oldObs['l_leg']['BFSH']['v'])
newObs.append(oldObs['l_leg']['GAS']['f'])
newObs.append(oldObs['l_leg']['GAS']['l'])
newObs.append(oldObs['l_leg']['GAS']['v'])
newObs.append(oldObs['l_leg']['SOL']['f'])
newObs.append(oldObs['l_leg']['SOL']['l'])
newObs.append(oldObs['l_leg']['SOL']['v'])
newObs.append(oldObs['l_leg']['TA']['f'])
newObs.append(oldObs['l_leg']['TA']['l'])
newObs.append(oldObs['l_leg']['TA']['v'])
return newObs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.