Beispiel #1
0
 def stable_pose(data, stable_pose_id):
     """ Read out a stable pose object """
     p = data[stable_pose_id].attrs[STABLE_POSE_PROB_KEY]
     r = data[stable_pose_id].attrs[STABLE_POSE_ROT_KEY]
     try:
         x0 = data[stable_pose_id].attrs[STABLE_POSE_PT_KEY]
     except:
         x0 = np.zeros(3)
     return stp.StablePose(p, r, x0, stp_id=stable_pose_id)
Beispiel #2
0
 def stable_poses(data):
     """ Read out a list of stable pose objects """
     num_stable_poses = data.attrs[NUM_STP_KEY]
     stable_poses = []
     for i in range(num_stable_poses):
         stp_key = POSE_KEY + '_' + str(i)
         p = data[stp_key].attrs[STABLE_POSE_PROB_KEY]
         r = data[stp_key].attrs[STABLE_POSE_ROT_KEY]
         try:
             x0 = data[stp_key].attrs[STABLE_POSE_PT_KEY]
         except:
             x0 = np.zeros(3)
         stable_poses.append(stp.StablePose(p, r, x0, stp_id=stp_key))
     return stable_poses