Giter Site home page Giter Site logo

Comments (3)

Morphlng avatar Morphlng commented on June 1, 2024 1

Problem located

I'm also having this problem; the only difference is that I'm using Windows.

By doing some workaround, I'm able to have macad-gym code run on Windows platform, but I'm also sticking at env.reset(). With a step-by-step debugging, I've already locate the problem to here:

self._client = None
while self._client is None:
try:
self._client = carla.Client("localhost", self._server_port)
self._client.set_timeout(2.0)
self._client.get_server_version()
except RuntimeError as re:
if "timeout" not in str(re) and "time-out" not in str(re):
print("Could not connect to Carla server because:", re)
self._client = None

The reason why this loop is infinite is because the Subprocess bind the port to a Python process instead of CarlaUE4 (or more specifically, CarlaUE4-Win64-Shipping.exe on Windows). Which lead us back to the upper create subprocess code:

self._server_process = subprocess.Popen(
[
SERVER_BINARY,
self._server_map,
"-windowed",
"-ResX=",
str(self._env_config["render_x_res"]),
"-ResY=",
str(self._env_config["render_y_res"]),
"-benchmark -fps=20",
"-carla-server",
"-carla-world-port={} -carla-streaming-port=0".format(
self._server_port),
],
preexec_fn=os.setsid,
stdout=open(log_file, "w"),
)
print("Running simulation in single-GPU mode")

I'm able to start a Carla server directly using my command-line, the carla.Client connect to it without a problem. However, I'm still trying to find a way to make the Python code work as expected.

Environment Info

The environment details I'm using is as below:

  1. Windows 11 latest build
  2. Carla 0.9.13 pre-built release (since the issuer said falling back to 0.9.4 doesn't help, I'm not going to try that now)
  3. Carla Python API 0.9.13_cp38 from pypi.prg

from macad-gym.

praveen-palanisamy avatar praveen-palanisamy commented on June 1, 2024

Hi @KID0031,
From the log it looks like the CARLA server was not launched on your machine for some reason. I am assuming that you have followed the setup steps described here.
Could you share your output for: echo $CARLA_SERVER?
Also, are you able to execute: bash $CARLA_SERVER without any issues?

from macad-gym.

praveen-palanisamy avatar praveen-palanisamy commented on June 1, 2024

@KID0031 : Please try the latest version with MorphIng's fixes, which likely resolves the issue you are facing. You would want to clone this repo, pull the latest changes and install the python package from source using: pip install -e .

I am closing this issue based on MorphIng's PR comments & fixes. Please re-open if you are still facing this issue.

from macad-gym.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.