Example #1
0
        public void CanCalculateRippelGate6()
        {
            ISender sender = new CommunicationObject(COMPORT);
             HomePosition homePosition = HomePositionFactory.CreateHomePosition();
             Phoenix phoenix = RobotFactory.CreatePhoenix(HomePositionFactory.CreateHomePosition());

             RippelGate6 rippelGate6 = new RippelGate6(phoenix, homePosition);
             for (int i = 0; i < 20; i++)
             {
                 double direction = 90;
                 double stepValue = 1;
                 ServoBase.TimeBox = 0.2;
                 new InstructionPacketSyncMovment(sender, rippelGate6.NextSequence(direction,stepValue)).Send();
                 Thread.Sleep((int) ServoBase.TimeBox * 1000);
             }
             for (int i = 0; i < 20; i++)
             {
                 double direction = 0;
                 double stepValue = 2;
                 ServoBase.TimeBox = 1;
                 new InstructionPacketSyncMovment(sender, rippelGate6.NextSequence(direction, stepValue)).Send();
                 Thread.Sleep((int)ServoBase.TimeBox * 1000);
             }
             for (int i = 0; i < 20; i++)
             {
                 double direction = -45;
                 double stepValue = 1;
                 ServoBase.TimeBox = 1;
                 new InstructionPacketSyncMovment(sender, rippelGate6.NextSequence(direction, stepValue)).Send();
                 Thread.Sleep((int)ServoBase.TimeBox * 1000);
             }
             for (int i = 0; i < 20; i++)
             {
                 double direction = 135;
                 double stepValue = 2;
                 ServoBase.TimeBox = 1;
                 new InstructionPacketSyncMovment(sender, rippelGate6.NextSequence(direction, stepValue)).Send();
                 Thread.Sleep((int)ServoBase.TimeBox * 1000);
             }

             ((CommunicationObject)sender).Dispose();
        }
Example #2
0
        public void CanTurnCWZ30()
        {
            ISender sender = new CommunicationObject(COMPORT);
            HomePosition homePosition = HomePositionFactory.CreateHomePosition();
            Phoenix phoenix = RobotFactory.CreatePhoenix(HomePositionFactory.CreateHomePosition());

            RippelGate6 rippelGate6 = new RippelGate6(phoenix, homePosition);
            for (int i = 0; i < 24; i++)
            {

                double stepValue = 5;
                ServoBase.TimeBox = 1;
                double Z = -30;
                new InstructionPacketSyncMovment(sender, rippelGate6.NextSequenceRotation(stepValue,0,Z)).Send();
                Thread.Sleep((int)ServoBase.TimeBox * 1000);
            }

            ((CommunicationObject)sender).Dispose();
        }