public void Initialize() { Ros.MasterUri = new Uri("http://localhost:11311/"); Ros.HostName = "localhost"; var topicContainer = new TopicContainer(); topicContainer.AddPublisher(new Publisher<std_msgs.String>("/test_topic", "test")); var tcpListener = new TcpRosListener(0); _slaveServer = new SlaveServer("test", 0, topicContainer); _slaveServer.AddListener("/test_topic", tcpListener); }
public void Initialize() { Ros.MasterUri = new Uri("http://localhost:11311/"); Ros.HostName = "localhost"; Ros.TopicTimeout = 3000; Ros.XmlRpcTimeout = 3000; _container = new TopicContainer(); var listener = new TcpRosListener(0); _slaveServer = new SlaveServer("test", 0, _container); _slaveServer.AddListener("test", listener); _slaveClient = new SlaveClient(_slaveServer.SlaveUri); }
public void SubscribeBeforeSetParam() { var server = new ParameterServer(new Uri("http://localhost")); var slave = new SlaveServer("test", 0, new TopicContainer()); var observer = new ReplaySubject<KeyValuePair<string, object>>(); slave.ParameterUpdated += (key, value) => observer.OnNext(new KeyValuePair<string, object>(key, value)); server.SubscribeParam("test", slave.SlaveUri.ToString(), "test_param"); server.SetParam("test", "test_param", 5678); observer.First().Key.Is("test_param"); observer.First().Value.Is(5678); }