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 #401

Open
wenhaogan9898 opened this issue Jul 6, 2023 · 3 comments

Comments

@wenhaogan9898
Copy link

wenhaogan9898 commented Jul 6, 2023

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

@FGJoseMiguel-AIST
Copy link

I want to do the same, but I don't have any idea how. Do you already do it?

@Elfits
Copy link

Elfits commented Oct 30, 2023

Same question. Do you have any idea now?

@FGJoseMiguel-AIST
Copy link

You have to define your ROS Connection like a public variable, after that call your subscribers or publishers using the same variable. In your scene you have to define 2 empty objects like ROS-1 and ROS-2, add the component named ROS Connection. When you finish that only rest drag the ROS-1 and ROS-2 objects to your variables.

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

3 participants