예제 #1
0
        private Arm GetArmByAngles(ref Angles a)
        {
            Arm arm = new Arm();

            Point initialElbow = new Point(0, Globals.MountPoint.Y - Globals.ArmLength);

            arm.elbow = RotatePoint(initialElbow, Globals.MountPoint, a.alpha);

            Point initialHand = new Point(0, Globals.MountPoint.Y - 2 * Globals.ArmLength);
            var   rotatedHand = RotatePoint(initialHand, Globals.MountPoint, a.alpha);

            arm.hand = RotatePoint(rotatedHand, arm.elbow, a.beta);

            return(arm);
        }
예제 #2
0
 private void GenerateLearningExamples()
 {
     examples = new Example[Globals.LearningExamplesCount];
     for (int i = 0; i < examples.Length; ++i)
     {
         Example t   = new Example(0, 0);
         Arm     arm = GetArmByAngles(ref t.angles);
         //while (arm.hand.X < 0)
         //{
         //    t = new Example(0, 0);
         //    arm = GetArmByAngles(ref t.angles);
         //}
         t.point = arm.hand;
         NormalizePoint(ref t.point);
         NormalizeAngles(ref t.angles);
         examples[i] = t;
     }
 }