Ejemplo n.º 1
0
        public void Shutdown()
        {
            ROS.RosShuttingDown -= ROS_RosShuttingDown;

            statusSubscriber.Dispose();
            feedbackSubscriber.Dispose();
            resultSubscriber.Dispose();
            GoalPublisher.Dispose();
            CancelPublisher.Dispose();
            nodeHandle.Dispose();
        }
Ejemplo n.º 2
0
 private void Form1_FormClosed(object sender, FormClosedEventArgs e)
 {
     if (nh != null)
     {
         nh.Dispose();
         nh = null;
     }
     if (ViperDevice != null)
     {
         ViperDevice.Dispose();
         ViperDevice = null;
     }
     Application.Exit();
 }
    public static void StopROS(Action callback = null)
    {
        if (ROS.isStarted() && !ROS.shutting_down && !instance.stopping)
        {
//			instance.status = ROSStatus.Disconnected;
            instance.starting = false;
            instance.stopping = true;
            while (nodes.Count > 0)
            {
                NodeHandle node = nodes.Dequeue();
                node.shutdown();
                node.Dispose();
            }
            Debug.Log("stopping ROS");
            ROS.shutdown();
            ROS.waitForShutdown();
        }
        if (callback != null)
        {
            callback();
        }
    }