def _getNewPoseFromPhysics(self, view_pose):
     '''Return pos(xyz), quat(wxyz)
     '''
     view_pose['quat'] = utils.quat_wxyz_to_xyzw(view_pose['quat']).tolist()
     self.socket_phys.send(json.dumps(view_pose))
     new_pos, new_quat = json.loads(self.socket_phys.recv().decode("utf-8"))
     return new_pos, utils.quat_xyzw_to_wxyz(new_quat)
 def _sendInitialPoseToPhysics(self, pose):
     pose[1] = utils.quat_wxyz_to_xyzw(pose[1]).tolist()
     receive = str(self.socket_phys.recv().decode("utf-8"))
     if (receive == "Initial"):
         self.socket_phys.send(json.dumps(pose))
         return True
     else:
         return False
 def renderOffScreenInitialPose(self):
     ## TODO (hzyjerry): error handling
     pos, quat_wxyz = self._getViewerAbsolutePose(self.target_poses[0])
     pos = pos.tolist()
     quat_xyzw = utils.quat_wxyz_to_xyzw(quat_wxyz).tolist()
     return pos, quat_xyzw