Beispiel #1
0
    // Use this for initialization
    void Start()
    {
        // Set FPS
        Application.targetFrameRate = 60;

        //Kalman filter
        kalman = new MatrixKalmanWrapper();

        // Disable screen dimming
        Screen.sleepTimeout = SleepTimeout.NeverSleep;

        destinationPoint = this.transform.position;
        destinationAngle = this.transform.localEulerAngles.z;
        userZIndex       = destinationPoint.z;

        cs = Extensions.CloudSync();

        worldObject = GameObject.FindObjectOfType <World> ();

        latestGooglePoisDownloadPosition = destinationPoint;

        kalmanTimer = Time.time;
    }
Beispiel #2
0
 void Awake()
 {
     kalman = new MatrixKalmanWrapper ();
     //kalman = new SimpleKalmanWrapper ();
 }
Beispiel #3
0
    // Use this for initialization
    void Start()
    {
        ws              = GameObject.Find("WebsocketManager").GetComponent <WSManager>();
        dataManager     = GameObject.Find("gDataManager").GetComponent <DataManager> ();
        l_palm          = this.transform.GetChild(5).gameObject;
        l_finger0       = this.transform.GetChild(0).gameObject;
        l_finger0_bone0 = l_finger0.transform.GetChild(0).gameObject;
        l_finger0_bone1 = l_finger0.transform.GetChild(1).gameObject;
        l_finger0_bone2 = l_finger0.transform.GetChild(2).gameObject;

        l_finger1       = this.transform.GetChild(1).gameObject;
        l_finger1_bone0 = l_finger1.transform.GetChild(0).gameObject;
        l_finger1_bone1 = l_finger1.transform.GetChild(1).gameObject;
        l_finger1_bone2 = l_finger1.transform.GetChild(2).gameObject;

        l_finger2       = this.transform.GetChild(2).gameObject;
        l_finger2_bone0 = l_finger2.transform.GetChild(0).gameObject;
        l_finger2_bone1 = l_finger2.transform.GetChild(1).gameObject;
        l_finger2_bone2 = l_finger2.transform.GetChild(2).gameObject;

        l_finger3       = this.transform.GetChild(3).gameObject;
        l_finger3_bone0 = l_finger3.transform.GetChild(0).gameObject;
        l_finger3_bone1 = l_finger3.transform.GetChild(1).gameObject;
        l_finger3_bone2 = l_finger3.transform.GetChild(2).gameObject;

        l_finger4       = this.transform.GetChild(4).gameObject;
        l_finger4_bone0 = l_finger4.transform.GetChild(0).gameObject;
        l_finger4_bone1 = l_finger4.transform.GetChild(1).gameObject;
        l_finger4_bone2 = l_finger4.transform.GetChild(2).gameObject;

        l_arm = transform.Find("arm");

        kalmanPalm  = new MatrixKalmanWrapper();
        kalmanIndex = new MatrixKalmanWrapper();
        kalmanThumb = new MatrixKalmanWrapper();
        kalmanHand  = new MatrixKalmanWrapper();

        //moving average queues
        queuePalm  = new Vector3[smoothingBuffer];
        queueIndex = new Vector3[smoothingBuffer];
        queueThumb = new Vector3[smoothingBuffer];
        queueHand  = new Vector3[smoothingBuffer];

        //initialization
        for (int i = 0; i < smoothingBuffer; i++)
        {
            queuePalm[i]  = Vector3.zero;
            queueIndex[i] = Vector3.zero;
            queueThumb[i] = Vector3.zero;
            queueHand[i]  = Camera.main.transform.position + Camera.main.transform.rotation * leapMotionOffset;
        }


        //check
        Debug.Log("Sync check hand." + GlobalStates.globalConfigFile.Available);
        if (GlobalStates.globalConfigFile.Available)
        {
            initialLeapMotionOffset = GlobalStates.globalConfigFile.HandOffset;
        }
        else
        {
            initialLeapMotionOffset = leapMotionOffset;
        }
    }
 void Awake()
 {
     kalman = new MatrixKalmanWrapper();
     //kalman = new SimpleKalmanWrapper ();
 }
Beispiel #5
0
 public KalmanFilter()
 {
     kalman = new MatrixKalmanWrapper();
 }