jeguzzi / robomaster_sim

A simulator/emulator of DJI Robomaster Robots (EP and S1)
MIT License
21 stars 2 forks source link

Address already in use #3

Closed xander-2077 closed 1 year ago

xander-2077 commented 1 year ago

Hi, Jeguzzi.

It's a great project and it provides a complete environment for playing robots virtually. But some problems occurred when I try to interact with the robot through the client library.

It seems that ip address was already in use. I am not familiar with the communications between two softwares even though I had google for it. Could you please tell me how can I solve it? Thank you!

Best wishes

jeguzzi commented 1 year ago

When you run ./test --ip=... you start a dummy simulation of a Robomaster, binding it to the provided IP. It's dummy as it does not reproduce the robot behavior/physics/sensors/... but only serves the same remote API. I added it for internal testing.

When you press start, you start a coppeliasim simulation of the robot you have added to the scene. With the default arguments, it will try to bind to the same address, therefore failing. It would work if you use different IPs. You don't need to run ./test to use coppeliasim: running both would simulate 2 robots.

xander-2077 commented 1 year ago

Thanks for your prompt reply! I really confused the relationship between ./test script and coppeliasim. According to your instruction, I need to write a python script to control the robot in coppeliasim. Is it right?

jeguzzi commented 1 year ago

Right. The same you would do with a real robot: a Python script that uses the RoboMaster SDK library, like this one https://github.com/jeguzzi/robomaster_sim/blob/main/examples/led.py.

xander-2077 commented 1 year ago

Thanks a lot for your patient reply!