Пример #1
0
        protected virtual void Start()
        {
            if (this.rosBridgeIP.Equals(string.Empty))
            {
                this.rosBridgeIP = ConfigManager.Instance.configInfo.rosbridgeIP;
            }
            if (this.rosBridgePort == 0)
            {
                this.rosBridgePort = ConfigManager.Instance.configInfo.rosbridgePort;
            }

            if (!RosConnectionManager.Instance.rosConnections.rosBridgeWebSocketConnectionMap.ContainsKey(topicName))
            {
                this.webSocketConnection = new SIGVerse.RosBridge.RosBridgeWebSocketConnection(rosBridgeIP, rosBridgePort);

                RosConnectionManager.Instance.rosConnections.rosBridgeWebSocketConnectionMap.Add(topicName, this.webSocketConnection);

                this.publisher = this.webSocketConnection.Advertise <Tmsg>(topicName);

                // Connect to ROSbridge server
                this.webSocketConnection.Connect();
            }
            else
            {
                this.webSocketConnection = RosConnectionManager.Instance.rosConnections.rosBridgeWebSocketConnectionMap[topicName];

                this.publisher = this.webSocketConnection.Advertise <Tmsg>(topicName);
            }
        }
Пример #2
0
        void Start()
        {
            if (!ConfigManager.Instance.configInfo.rosbridgeIP.Equals(string.Empty))
            {
                this.rosBridgeIP   = ConfigManager.Instance.configInfo.rosbridgeIP;
                this.rosBridgePort = ConfigManager.Instance.configInfo.rosbridgePort;
            }

            this.webSocketConnection = new RosBridgeWebSocketConnection(rosBridgeIP, rosBridgePort);

            this.stringPublisher = this.webSocketConnection.Advertise <std_msgs.String>(topicName);

            // Connect to ROSbridge server
            this.webSocketConnection.Connect();

            this.stringMessage = new std_msgs.String();
        }
 public void SetConnection(RosBridgeWebSocketConnection webSocketConnection)
 {
     this.webSocketConnection = webSocketConnection;
 }