Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wenhaogan9898 opened this issue Jul 6, 2023 · 1 comment

Comments

@wenhaogan9898
Copy link

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);

@P3TE
Copy link
Contributor

P3TE commented Jul 19, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants