Exemplo n.º 1
0
        #Pred trajectory + inputBuyer, inputSeller
        vis_posData = [vis_posData[0], vis_posData[2], vis_posData[3] ]
        vis_faceNormalData = [vis_faceNormalData[0], vis_faceNormalData[2], vis_faceNormalData[3] ]
        vis_bodyNormalData = [vis_bodyNormalData[0], vis_bodyNormalData[2], vis_bodyNormalData[3] ]

        if bVisualize==False:
            continue

        """ Visualize Location + Orientation """
        glViewer.setPosOnly(vis_posData)
        glViewer.setFaceNormal(vis_faceNormalData)
        glViewer.setBodyNormal(vis_bodyNormalData)
        
        """Visualize Trajectory"""
        glViewer.set_Holden_Trajectory_3(traj_list_holdenForm, initTrans=pred_initTrans_list, initRot=pred_initRot_list)   #pred
        #glViewer.set_Holden_Trajectory_3(gt_traj_list_holdenForm, initTrans=gt_initTrans_list, initRot=gt_initRot_list)   #GT
        #glViewer.set_Holden_Trajectory_3([ bodyData[0][-7:-4,:], bodyData[1][-7:-4,:], bodyData[2][-7:-4,:] ], initRot=initRot, initTrans= initTrans)

        """Visualize Body"""
        #glViewer.set_Holden_Data_73([output_body_np],initTrans=initTrans_list,initRot=initRot_list)
        glViewer.set_Holden_Data_73(vis_bodyData, ignore_root=False, initRot=vis_bodyGT_initRot, initTrans= vis_bodyGT_initTrans, bIsGT=False)
        #glViewer.set_Holden_Data_73(vis_bodyData, ignore_root=False, initRot=vis_bodyGT_initRot, initTrans= vis_bodyGT_initTrans, bIsGT=True)

        """Visualize Speech"""
        glViewer.setSpeech_binary( vis_speech )
        
        """Render output to videos"""
        if bRender:
            glViewer.setSaveOnlyMode(True)
            glViewer.setSave(True)
Exemplo n.º 2
0
        """ Get Root Rotation """
        rvelocity = Pivots.from_quaternions(rotation[1:] * -rotation[:-1]).ps
        """ Save output """
        trajData = np.zeros((frameLeng, 3))
        trajData[:, 0] = velocity_3d[:, 0,
                                     0] * 0.2  #0.2 to make holden data scale
        trajData[:, 1] = velocity_3d[:, 0,
                                     2] * 0.2  #0.2 to make holden data scale
        trajData[:, 2] = rvelocity[:, 0]

        initTrans = np.zeros((1, 3))
        initTrans[0, 0] = targetPos[0, 0]
        initTrans[0, 2] = targetPos[0, 1]
        initTrans = initTrans * 0.2

        trajData = np.swapaxes(trajData, 0, 1)
        traj_list.append(trajData)
        initTrans_list.append(initTrans)

        initRot = -rotation[0]  #Inverse to move [0,0,1] -> original Forward
        initRot_list.append(initRot)

        break

    glViewer.set_Holden_Trajectory_3(traj_list,
                                     initTrans=initTrans_list,
                                     initRot=initRot_list)
    glViewer.init_gl()

    # traj_list_seq.append(np.array(traj_list))