ROS-TCP-Connector icon indicating copy to clipboard operation
ROS-TCP-Connector copied to clipboard

I want to use unity to connect to multiple ROS systems, but it doesn't seem to work

Open wenhaogan9898 opened this issue 2 years ago • 1 comments

I want to use unity to connect to multiple ROS systems, but the code in ROSConnection to create the ros connection instance is static, which means it can always connect to only one ROS system. I wonder if there is another way to connect multiple ROS systems (different IP and port) at the same time.

public static void DrawConnectionArrows(bool withBar, float x, float y, float receivedTime, float sentTime, bool isPublisher, bool isSubscriber, bool hasError); public static Color GetConnectionColor(float elapsedTime, bool hasConnection, bool hasError); public static ROSConnection GetOrCreateInstance(); public static bool IPFormatIsCorrect(string ipAddress); public static void SetIPPref(string ipAddress); public static void SetPortPref(int port);

wenhaogan9898 avatar Jul 06 '23 12:07 wenhaogan9898

Unfortunately it's not really set up to do that. Instead I would recommend connecting all ROS systems to a single master (ROS1) or in ROS2 ensuring they can all talk by using the ROS2 domain ID. Then separating each of the ROS machines' topics by using namespacing on your topics and services.

P3TE avatar Jul 19 '23 10:07 P3TE