예제 #1
0
        /// <summary>
        /// Event is fired when successfully connected to ROS master server
        /// </summary>
        /// <param name="sender">Sender</param>
        /// <param name="e">Arguments</param>
        private void RosControlBase_RosConnected(object sender, EventArgs e)
        {
            DetectionImage.Visibility = Visibility.Visible;
            DetectionImage.Subscribe();

            // Enabling button
            enableDisableFollowMeButton.IsEnabled = true;
            followMeApp.Enable(true);

            dispatcherTimer.Start();
        }
예제 #2
0
        /// <summary>
        /// Image updated
        /// </summary>
        /// <param name="sender">Sender.</param>
        /// <param name="e">Arguments.</param>
        private void ImageSink_Updated(object sender, EventArgs e)
        {
            if (!firstUpdate)
            {
                return;
            }

            Dispatcher.Invoke(new Action(() =>
            {
                firstUpdate = false;
                DetectionImage.SetActualSize();
            }));
        }
예제 #3
0
        /// <summary>
        /// Event is fired when disconnected from ROS master server
        /// </summary>
        /// <param name="sender">Sender</param>
        /// <param name="e">Arguments</param>
        private void RosControlBase_RosDisconnecting(object sender, EventArgs e)
        {
            // Unsubscribing from image stream
            DetectionImage.Visibility = Visibility.Hidden;
            DetectionImage.Unsubscribe();

            // In case follow me is left working, user is asked if he wants it be shutdown
            AskToDisableFollowMe();

            // Disabling button
            enableDisableFollowMeButton.IsEnabled = false;

            firstUpdate = true;

            dispatcherTimer.Stop();
        }