private void construct(string ns, bool validate_name)
        {
            if (started_by_visual_studio)
            {
                return;
            }
            if (!ROS.initialized)
            {
                throw new Exception("You must call ROS.Init before instantiating the first nodehandle");
            }
            collection          = new NodeHandleBackingCollection();
            UnresolvedNamespace = ns;
            Namespace           = validate_name ? resolveName(ns) : resolveName(ns, true, true);

            ok = true;
            lock (nh_refcount_mutex)
            {
                if (nh_refcount == 0 && !ROS.isStarted())
                {
                    node_started_by_nh = true;
                    ROS.start();
                }
                ++nh_refcount;
            }
        }
Example #2
0
 private void destruct()
 {
     collection.Dispose();
     collection = null;
     lock (nh_refcount_mutex)
     {
         --nh_refcount;
     }
     _callback = null;
     if (nh_refcount == 0 && node_started_by_nh)
     {
         ROS.shutdown();
     }
 }
Example #3
0
        private void construct(string ns, bool validate_name)
        {
            if (!ROS.initialized)
            {
                ROS.FREAKOUT();
            }
            collection          = new NodeHandleBackingCollection();
            UnresolvedNamespace = ns;
            Namespace           = validate_name ? resolveName(ns) : resolveName(ns, true, true);

            ok = true;
            lock (nh_refcount_mutex)
            {
                if (nh_refcount == 0 && !ROS.isStarted())
                {
                    node_started_by_nh = true;
                    ROS.start();
                }
                ++nh_refcount;
            }
        }
Example #4
0
        private void Construct(string ns, bool validate_name)
        {
            if (!ROS.initialized)
            {
                throw new Exception("You must call ROS.Init() before instantiating the first nodehandle");
            }

            collection          = new NodeHandleBackingCollection();
            UnresolvedNamespace = ns;
            Namespace           = validate_name ? ResolveName(ns) : ResolveName(ns, true, true);

            OK = true;
            lock (gate)
            {
                if (referenceCount == 0 && !ROS.IsStarted())
                {
                    initializedRos = true;
                    ROS.Start();
                }
                ++referenceCount;
            }
        }