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; } }
public SimTime() { new Thread(() => { while (!ROS.isStarted() && !ROS.shutting_down) { Thread.Sleep(100); } nh = new NodeHandle(); if (!ROS.shutting_down) { simTimeSubscriber = nh.subscribe <Clock>("/clock", 1, SimTimeCallback); } }).Start(); }
public SimTime() { new Thread(() => { while (!ROS.isStarted() && !ROS.shutting_down) { Thread.Sleep(100); } Thread.Sleep(1000); if (!ROS.shutting_down) { nh = new NodeHandle(); simTimeSubscriber = nh.subscribe <Messages.rosgraph_msgs.Clock>("/clock", 1, SimTimeCallback); } ROS.waitForShutdown(); simTimeSubscriber.shutdown(); }).Start(); }
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; } }