Beispiel #1
0
        public override void Setup()
        {
            Eye = new Camera(0);
            Eye.Start();

            Arm = new ThreeDOFArm("COM3", 115200);
            Arm.Connect();

            Brain = new Cognitive();
        }
Beispiel #2
0
        private void ConnectButton_Click(object sender, RoutedEventArgs e)
        {
            if (string.Equals(ConnectButton.Content.ToString(), "Disconntect", StringComparison.CurrentCultureIgnoreCase))
            {
                if (((arm != null) && arm.IsConnected))
                {
                    arm.Dispose();
                    arm = null;
                    ConnectButton.Content = "Conntect";

                    CurrentCoordinateX.Text = "";
                    CurrentCoordinateY.Text = "";
                    CurrentCoordinateZ.Text = "";
                }
            }
            else
            {
                if (arm == null)
                {
                    var portName = ComboBoxPort.SelectedValue.ToString();
                    var baud     = 115200;
                    arm = new ThreeDOFArm(portName, baud);
                    arm.Subscript(string.Empty, handleArmCallback);
                }

                if (!arm.IsConnected)
                {
                    arm.Connect();
                }

                if (arm.IsConnected)
                {
                    ConnectButton.Content = "Disconntect";
                    var currentPose       = arm.GetLatestData();
                    var currentCoordinate = arm.ConvertToCoordinate(currentPose);
                    ShowPosition(currentCoordinate.Item1, currentCoordinate.Item2, currentCoordinate.Item3);
                    //var currentPosition =
                }
                //_serialPort.StartRead(DataReceivedHandler);
            }
        }
Beispiel #3
0
        public override void Setup()
        {
            LeftArmCommandList   = new Queue <BaseCommand>();
            LeftArmCurrentStatus = Status.Idle;

            RightArmCommandList   = new Queue <BaseCommand>();
            RightArmCurrentStatus = Status.Idle;

            Brain = new CloudBrain(new Uri("http://10.125.169.141:8182"), new BasicAuthenticationCredentials());

            RightArmId = 4396;
            LeftArmId  = 43967;// Brain.Arm.Register().Value;

            LeftArm = new ThreeDOFArm("COM4", 115200);
            LeftArm.Subscript("CallBack", HandleLeftArmCallback);
            LeftArm.Connect();

            RightArm = new ThreeDOFArm("COM4", 115200);
            RightArm.Subscript("CallBack", HandleRightArmCallback);
            RightArm.Connect();
        }
Beispiel #4
0
        public override void Setup()
        {
            CommandList   = new Queue <BaseCommand>();
            CurrentStatus = Status.Idle;

            Brain = new CloudBrain(new Uri("http://10.125.169.141:8182"), new BasicAuthenticationCredentials());
            ArmId = 4396;// Brain.Arm.Register().Value;

            Eye = new Camera(0);

            Arm = new ThreeDOFArm("COM4", 115200);
            Arm.Subscript("CallBack", HandleArmCallback);
            Arm.Connect();

            storageAccount = CloudStorageAccount.Parse("SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS");
            blobClient     = storageAccount.CreateCloudBlobClient();
            container      = blobClient.GetContainerReference($"{Math.Abs(ArmId)}-image");
            container.CreateIfNotExists();

            //CommandList.Enqueue(new VisionCommand());
        }
Beispiel #5
0
        private void ArmConnectButton_Click(object sender, RoutedEventArgs e)
        {
            if (string.Equals(ArmConnectButton.Content.ToString(), "Disconntect", StringComparison.CurrentCultureIgnoreCase))
            {
                if (((controlArm != null) && controlArm.IsConnected))
                {
                    controlArm.ResetPosePosition();
                    controlArm.Close();
                    controlArm.Dispose();
                    controlArm = null;
                    ArmConnectButton.Content = "Conntect";
                }
            }
            else
            {
                if (controlArm == null)
                {
                    var portName = PortComboBox.SelectedValue.ToString();
                    var baud     = 115200;
                    controlArm = new ThreeDOFArm(portName, baud);
                    controlArm.Subscript(string.Empty, ShowControlArmPosition);
                }

                if (!controlArm.IsConnected)
                {
                    controlArm.Connect();
                }

                if (controlArm.IsConnected)
                {
                    ArmConnectButton.Content = "Disconntect";
                    var currentPose = controlArm.GetLatestData();
                    ControllerShowCurrentStatus(currentPose);
                }
            }
        }