magmaOffenburg / RoboViz

Monitor and visualization tool for the RoboCup 3D Soccer Simulation League
Apache License 2.0
52 stars 17 forks source link

Roboviz Drawing Port: Connection Refused Error in Python #129

Closed FaazAbidi closed 2 years ago

FaazAbidi commented 2 years ago

Hello,

I have been trying to connect to the drawing port of Roboviz but it is not establishing a connection and throwing the ConnectionRefusedError: [Errno 111] Connection refused error. I am using python 3.8 for creating a client. I have tried changing the ports and hosts but no luck.

I have been stuck on this for hours. Would appreciate any help.

Client Side Code: image

FaazAbidi commented 2 years ago

I have also tried checking if the port is open by running the command telnet localhost 12345 but the terminal also gives the same error i.e telnet: Unable to connect to remote host: Connection refused. It seems like the error is from the server side and the port is not open.

hannesbraun commented 2 years ago

The drawing communication uses UDP. So you need to create your socket using socket.SOCK_DGRAM. The call to connect is then of course not necessary anymore. Does that help?

FaazAbidi commented 2 years ago

Yes. That helps a lot! Thank you, @hannesbraun! Can you please provide me with the drawing commands? As the official Roboviz site is not working, I couldn't find them anywhere else.

hannesbraun commented 2 years ago

This is the original paper which describes the basic design of the drawing protocol: https://link.springer.com/content/pdf/10.1007%2F978-3-642-32060-6_24

Unfortunately, I don't know about any other documentation for this. (Maybe there is some other information about the drawing commands out there, that I don't know about...) For the specific commands, you can have a look at the implementation in RoboViz: https://github.com/magmaOffenburg/RoboViz/tree/master/src/main/java/rv/comm/drawing.

Otherwise, maybe this code from our agent may be helpful too: https://github.com/magmaOffenburg/magmaRelease/tree/main/common/src/main/java/magma/util/roboviz.

FaazAbidi commented 2 years ago

Sure, I'll go over these. Thank you, @hannesbraun!