Exemple #1
0
            public ToStringVisual(string topic, MessageSubtopic subtopic)
            {
                ROSConnection ros   = ROSConnection.GetOrCreateInstance();
                RosTopicState state = ros.GetTopic(topic);

                if (subtopic == MessageSubtopic.Response)
                {
                    state = state.ServiceResponseTopic;
                }
                state.AddSubscriber(AddMessage);
            }
            public MarkersVisual(string topic)
            {
                ROSConnection ros   = ROSConnection.GetOrCreateInstance();
                RosTopicState state = ros.GetTopic(topic);

                if (state.RosMessageName == MarkerArrayMsg.k_RosMessageName)
                {
                    ros.Subscribe <MarkerArrayMsg>(topic, OnMarkerArray);
                }
                else if (state.RosMessageName == MarkerMsg.k_RosMessageName)
                {
                    ros.Subscribe <MarkerMsg>(topic, OnMarker);
                }
            }