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

Implement a UDP <-> WebRTC bridge (or other way of direct connection between rcssserver and a browser application) #90

Open
mateusfbsoares opened this issue Apr 6, 2022 · 6 comments

Comments

@mateusfbsoares
Copy link

Thanks to @kawhicurry, we realized that we cannot make a direct connection between rcssserver (a native application) and websoccermonitor (a browser application) in order to enable real time visualization, since there is no proper support for UDP in the browser.

I believe one solution would be to implement a UDP <-> WebRTC bridge inside rcssserver as described in this answer using a library such as libdatachannel. In my understanding, this would allow for direct connectivity between rcssserver and any browser-based application, solving this problem.

What do you think?

@hidehisaakiyama
Copy link
Member

As discussed in the discord server, a simple proxy would be a reasonable solution.
And, the classic rcsslogplayer may be helpful for implementing the proxy feature because the classic logplayer works as a log server.
Of course, I can help to design the proxy feature.

@kawhicurry
Copy link

Hey, @hidehisaakiyama .

I've noticed that udp is deeply integrated with rcssserver. So a proxy inside rcssserver will be a much better solution.

And WebSoccerMonitor is intended to be a pure front application, so we may not going to write another isolated proxy program. Can we build a proxy as a module into rcssserver and make full use of librcss/net? If @mtfbs wants to implement WebRTC protocol, we can inherit class Socket and implement it easily.

I will try to write a demo later. Before that, I'd listen to your opinions.

Thank you for your help.

@hidehisaakiyama
Copy link
Member

To be honest, I'm wondering why we need to integrate a proxy into rcssserver.

It is possible to develop a proxy as a module of rcssserver package. However, it causes more maintenance costs after that especially if it depends on the recent and unstable library. I think It would be preferred that a proxy module is developed and maintained as another package.

rcssserver is the core of the RoboCup soccer simulator. So, its portability and maintainability are some of the most important aspects. This is one of the reasons why rcssmonitor is separately maintained. Because the GUI toolkit is upgraded year by year, the maintenance cost of the server becomes higher if the monitor is integrated within the server.

The rcss/net library can be used from other projects. We can develop a proxy software package using that library. Then, the proxy can be called from rcsoccersim script. I think it's enough.

Please note the rcss/net library will be deprecated and removed because the standard C++ net library will be available in the near future. If you really need a network library, I recommend using boost::asio (The version of boost has to be 1.66 or higher).

@kawhicurry
Copy link

Thanks for your reply. I've acknowledged that rcssserver's portability and maintainability are some of the most important aspects. I will follow the instruction of building a proxy then call with scripts. And I will attempt to build the proxy software with standard C++ net library.

Again, thanks for your patient reply.

@mroa4
Copy link
Contributor

mroa4 commented Apr 7, 2022

Given that the script is standalone, why not use other programming languages. Like python or JS That they are easier to use and Likely do not need a lot of prerequisites?

@hidehisaakiyama
Copy link
Member

Right.
We can develop a client (including a proxy) with any programing language and environment as long as we adhere to the protocol.
This is another reason the RoboCup simulator is separated into several modules.

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

4 participants