Esempio n. 1
0
        public void TestPredictWithPrevs()
        {
            LinearPosePredicter pred = new LinearPosePredicter();

            pred.AddPoseData(1, new Pose(new Vector3(1, 1, 1), new Vector3()));
            pred.AddPoseData(2, new Pose(new Vector3(2, 2, 2), new Vector3()));
            float[] output   = pred.PredictPoseAt(3);
            float[] expected = new float[] { 1, 1, 1, 0, 0, 0 };
            Assert.AreEqual(expected, output);
            expected = new float[] { 3, 3, 3, 0, 0, 0 };
            Assert.AreEqual(expected, pred.PredictPoseAt(5));
        }
Esempio n. 2
0
        public void TestPredict()
        {
            LinearPosePredicter pred = new LinearPosePredicter();

            float[] output = pred.PredictPoseAt(1);
            Assert.AreEqual(new float[] { 0, 0, 0, 0, 0, 0 }, output);
        }
Esempio n. 3
0
        public void TestInvalidTimeStamp2()
        {
            LinearPosePredicter pred = new LinearPosePredicter();

            pred.AddPoseData(1, new Pose(new Vector3(1, 1, 1), new Vector3()));
            pred.AddPoseData(2, new Pose(new Vector3(2, 2, 2), new Vector3()));
            Assert.Throws <ArgumentException>(() => pred.PredictPoseAt(0));
        }