From aa081f574833bcb1db4c234b9ee3d5bcd303a6de Mon Sep 17 00:00:00 2001 From: Hoang Bui <47828508+bongbui321@users.noreply.github.com> Date: Thu, 30 May 2024 14:25:21 -0400 Subject: [PATCH] Simulator: update MetaDrive to latest (#32576) * bump metadrive * comment --- poetry.lock | 20 +++++++++++-------- pyproject.toml | 3 ++- .../sim/bridge/metadrive/metadrive_process.py | 2 +- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/poetry.lock b/poetry.lock index 01ec394f22d392..23b2eb7b8aefac 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.7.0 and should not be changed by hand. [[package]] name = "aiohttp" @@ -2247,18 +2247,16 @@ version = "0.4.2.3" description = "An open-ended driving simulator with infinite scenes" optional = false python-versions = ">=3.6, <3.12" -files = [ - {file = "metadrive-simulator-0.4.2.3.tar.gz", hash = "sha256:bcda7d07146128161b0bc2cc337e01612b9222202706370043b52f7936a8a277"}, - {file = "metadrive_simulator-0.4.2.3-py3-none-any.whl", hash = "sha256:f6fff20b931bb956c55e0e81bf1f6b641169a84a4c853435a8b26bd51c8e9876"}, -] +files = [] +develop = false [package.dependencies] filelock = "*" geopandas = "*" -gymnasium = ">=0.28,<0.29" +gymnasium = ">=0.28" lxml = "*" matplotlib = "*" -numpy = ">=1.21.6,<=1.24.2" +numpy = ">=1.21.6" opencv-python = "*" panda3d = "1.10.13" panda3d-gltf = "0.13" @@ -2281,6 +2279,12 @@ cuda = ["PyOpenGL (==3.1.6)", "PyOpenGL-accelerate (==3.1.6)", "cuda-python (==1 gym = ["gym (>=0.19.0,<=0.26.0)"] ros = ["zmq"] +[package.source] +type = "git" +url = "https://github.com/metadriverse/metadrive.git" +reference = "233a3a1698be7038ec3dd050ca10b547b4b3324c" +resolved_reference = "233a3a1698be7038ec3dd050ca10b547b4b3324c" + [[package]] name = "mouseinfo" version = "0.1.3" @@ -8037,4 +8041,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "jaraco.test", "more [metadata] lock-version = "2.0" python-versions = "~3.11" -content-hash = "1b15d2bb9465282294cd503c019a7d023f16dbb3e44ddde7b9899c45195c6cb8" +content-hash = "ac6ceb0682848e6c5e39110842e8d96fdc98b15037c56491a7fc1e03b7b89cbd" diff --git a/pyproject.toml b/pyproject.toml index da7f1021e68677..d7145b10a9ced7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -140,7 +140,8 @@ inputs = "*" Jinja2 = "*" lru-dict = "*" matplotlib = "*" -metadrive-simulator = { version = "0.4.2.3", markers = "platform_machine != 'aarch64'" } # no linux/aarch64 wheels for certain dependencies +# No release for this fix https://github.com/metadriverse/metadrive/issues/632. Pinned to this commit until next release +metadrive-simulator = {git = "https://github.com/metadriverse/metadrive.git", rev ="233a3a1698be7038ec3dd050ca10b547b4b3324c", markers = "platform_machine != 'aarch64'" } # no linux/aarch64 wheels for certain dependencies mpld3 = "*" mypy = "*" myst-parser = "*" diff --git a/tools/sim/bridge/metadrive/metadrive_process.py b/tools/sim/bridge/metadrive/metadrive_process.py index 2b9203c30ddef5..38c13a14345b77 100644 --- a/tools/sim/bridge/metadrive/metadrive_process.py +++ b/tools/sim/bridge/metadrive/metadrive_process.py @@ -88,7 +88,7 @@ def get_cam_as_rgb(cam): cam.get_cam().reparentTo(env.vehicle.origin) cam.get_cam().setPos(C3_POSITION) cam.get_cam().setHpr(C3_HPR) - img = cam.perceive(clip=False) + img = cam.perceive(to_float=False) if type(img) != np.ndarray: img = img.get() # convert cupy array to numpy return img