## Code Example ## A simple Publisher/Subscriber Example: ```cs using System; using RosSharp.RosBridgeClient; // commands on ROS system: // roscore // rostopic echo /talker // rostopic pub /listener std_msgs/String "World!" // roslaunch rosbridge_server rosrbridge_websocket.launch public class HelloWorld { public static void Main(string[] args) { RosSocket rosSocket = new RosSocket("ws://192.168.0.101:9090"); // Publication: int publication_id = rosSocket.Advertize("/talker", "std_msgs/String"); StandardString message = new StandardString(); message.data = "Hello!"; rosSocket.Publish(publication_id, message); // Subscription Example: int subscription_id = rosSocket.Subscribe("/listener", "std_msgs/String", subscriptionHandler); Console.WriteLine("Press any key to close..."); Console.ReadKey(true); rosSocket.Close(); } private static void subscriptionHandler(Message message) { StandardString standardString = (StandardString)message; Console.WriteLine(standardString.data); } } ``` --- [Visit Topic](https://discourse.ros.org/t/ros-on-github-com-siemens-ros-sharp/3405/2) or reply to this email to respond. If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates. ______________________________________________________________________________ ros-users mailing list ros-users@lists.ros.org http://lists.ros.org/mailman/listinfo/ros-users Unsubscribe: