public void CombinedPositionAndOrientationInOutTest() { this.mlocmoq = new MarkerLocations(); this.sensor = new MarkerSensor(this.mlocmoq, 5, this.posDistType.Object, this.oriDistType.Object); for (int i = 0; i < this.bulkData.Length; i++) { Pose marker = new Pose( new Vector3( this.bulkData[i][0], this.bulkData[i][1], this.bulkData[i][2]), new Vector3(this.bulkData[i][3], this.bulkData[i][4], this.bulkData[i][5])); Pose measurement = new Pose( new Vector3( this.bulkData[i][6], this.bulkData[i][7], this.bulkData[i][8]), new Vector3(this.bulkData[i][9], this.bulkData[i][10], this.bulkData[i][11])); Pose output = new Pose( new Vector3(this.bulkData[i][12], this.bulkData[i][13], this.bulkData[i][14]), new Vector3(this.bulkData[i][15], this.bulkData[i][16], this.bulkData[i][17])); this.mlocmoq.AddMarker(i, marker); this.TestComplexInOut(measurement, output, i); } }
public void TestConstructorEmptyAddMarkerException() { this.markerLocations = new MarkerLocations(); Pose newMarker = new Pose(this.position, this.rotation); this.markerLocations.AddMarker(2, newMarker); Assert.AreEqual(this.markerLocations.GetMarker(2), newMarker); }
public void TestFloatingPointRead() { this.markerLocations = new MarkerLocations(TestContext.CurrentContext.TestDirectory + "\\MarkerMapFloat.xml"); Assert.AreEqual(this.markerLocations.GetMarker(0).Position.X, 25.12f); Assert.AreEqual(this.markerLocations.GetMarker(0).Position.Y, 13.52f); Assert.AreEqual(this.markerLocations.GetMarker(0).Position.Z, 5.00f); Assert.AreEqual(this.markerLocations.GetMarker(0).Orientation.X, 0.15f); Assert.AreEqual(this.markerLocations.GetMarker(0).Orientation.Y, 0.23f); Assert.AreEqual(this.markerLocations.GetMarker(0).Orientation.Z, 0.00f); }
public void Init() { this.mlocmoq = new MarkerLocations(); this.mlocmoq.AddMarker( 0, new Pose(new Vector3(25, 13.52f, 5), new Vector3(0, 0, 0))); this.mlocmoq.AddMarker( 1, new Pose(new Vector3(12, 21.12f, 13), new Vector3(0, 0, 0))); this.posDistType = new Mock <IDistribution>(); this.oriDistType = new Mock <IDistribution>(); this.sensor = new MarkerSensor(this.mlocmoq, this.posDistType.Object, this.oriDistType.Object); }
public void SimpleUserPositionTest2() { Pose marker = new Pose(new Vector3(1, 0, 1), new Vector3(0, 0, 0)); Pose rel = new Pose(new Vector3(2, 0, 1), new Vector3(0, 180, 0)); MarkerLocations mloc = new MarkerLocations(); mloc.AddMarker(1, marker); this.sensor = new MarkerSensor(mloc, 5, this.posDistType.Object, this.oriDistType.Object); Dictionary <int, Pose> dic = new Dictionary <int, Pose>(); dic.Add(1, rel); this.sensor.UpdateLocations(1, dic); this.AssertVectorAreEqual(new Vector3(3, 0, 2), this.sensor.GetLastPosition().Data, this.vectorEpsilon); }
public void GetMeasurementAtTimeStamp() { Pose marker = new Pose(new Vector3(2, 0, 1), new Vector3(0, 0, 0)); Pose rel = new Pose(new Vector3(1, 0, 1), new Vector3(0, 180, 0)); MarkerLocations mloc = new MarkerLocations(); mloc.AddMarker(1, marker); this.sensor = new MarkerSensor(mloc, 5, this.posDistType.Object, this.oriDistType.Object); Dictionary <int, Pose> dic = new Dictionary <int, Pose>(); dic.Add(1, rel); this.sensor.UpdateLocations(1, dic); this.AssertVectorAreEqual(new Vector3(3, 0, 2), this.sensor.GetPosition(1).Data, this.vectorEpsilon); this.AssertRotationAreEqual(new Vector3(0, 180, 0), this.sensor.GetOrientation(1).Data, this.vectorEpsilon); }
public void TestConstructorException() { this.markerLocations = new MarkerLocations(TestContext.CurrentContext.TestDirectory + "\\MarkerMap01.xml"); Assert.That(() => this.markerLocations.GetMarker(2), Throws.TypeOf <UnallocatedMarkerException>()); }
public void TestConstructorLoad() { this.markerLocations = new MarkerLocations(TestContext.CurrentContext.TestDirectory + "\\MarkerMap01.xml"); Assert.AreEqual(this.markerLocations.GetMarker(0).Position.X, 25); Assert.AreEqual(this.markerLocations.GetMarker(0).Position.Y, 13.52f); }
public void TestConstructorEmpty() { this.markerLocations = new MarkerLocations(); Assert.That(() => this.markerLocations.GetMarker(1), Throws.TypeOf <UnallocatedMarkerException>()); }