Example #1
0
        public void ToPoseString(double x, double y, double headingRad)
        {
            PoseIPStruct poseIPStruct = new PoseIPStruct(IPAddress.Loopback, x, y, headingRad);
            string       poseString   = poseIPStruct.ToPoseIPString();

            Match match = poseStringRegex.Match(poseString);

            double xVal       = double.Parse(match.Groups["xVal"].Value);
            double yVal       = double.Parse(match.Groups["yVal"].Value);
            double headingVal = double.Parse(match.Groups["headingVal"].Value);

            Assert.That(x, Is.EqualTo(xVal).Within(0.01));
            Assert.That(y, Is.EqualTo(yVal).Within(0.01));
            Assert.That(headingRad, Is.EqualTo(headingVal).Within(0.001));
        }