From 5c9b4e4c188afd3c946ab6be77a9d0c43d3beb95 Mon Sep 17 00:00:00 2001 From: Maya CHEN <1155141529@link.cuhk.edu.hk> Date: Wed, 30 Jul 2025 22:00:58 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=AE=8C=E6=88=90=E4=BA=86=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E5=A4=8D=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 调整了一些requirements与部分代码,使得程序能够顺利跑起来。 --- data/screenshots/metadata.pickle | Bin 30 -> 30 bytes requirements.txt | 8 ++++---- .../services/resources/smart_unpickle.py | 6 ++---- src/simulator/views/gui/simulator_config.py | 11 +++-------- 4 files changed, 9 insertions(+), 16 deletions(-) diff --git a/data/screenshots/metadata.pickle b/data/screenshots/metadata.pickle index 4a9ae6a80748518c2b4111c381b4ed7fde48b92a..a7aeefa95a7c7af1851890f9fe1ff1c9ff8b5914 100644 GIT binary patch delta 8 Pcmb1>n;^|RyI2nZ2%-Wf delta 8 Pcmb1>n;^|RqgW3B2$=#T diff --git a/requirements.txt b/requirements.txt index 8ad98420b..3d0ca4a16 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,10 +1,10 @@ -torch -numpy +torch==2.3 +numpy<2.0 matplotlib -nptyping +nptyping==1.4.4 panda3d pandas -sklearn +scikit-learn torchvision memory_profiler seaborn diff --git a/src/simulator/services/resources/smart_unpickle.py b/src/simulator/services/resources/smart_unpickle.py index 95ae6be86..bdbb534f2 100644 --- a/src/simulator/services/resources/smart_unpickle.py +++ b/src/simulator/services/resources/smart_unpickle.py @@ -8,10 +8,8 @@ class Size(NamedTuple): width: int height: int -class _PointMetaClass(type(NamedTuple), type(torch.Tensor)): - pass - -class Point(NamedTuple, torch.Tensor, metaclass=_PointMetaClass): +# 修复元类定义,适配Python 3.8+ +class Point(NamedTuple): x: int y: int diff --git a/src/simulator/views/gui/simulator_config.py b/src/simulator/views/gui/simulator_config.py index 7c00fb489..10c2327a1 100644 --- a/src/simulator/views/gui/simulator_config.py +++ b/src/simulator/views/gui/simulator_config.py @@ -43,12 +43,7 @@ def __init__(self, services: Services, mouse1_press_callbacks: List[Callable[[], self.__services.ev_manager.register_listener(self) self.__base = self.__services.graphics.window self.__text = " t - find the path between the agent and goal\n\n" \ - " mouse click - moves agent to mouse location \n\n mouse right click - moves goal to" \ - " mouse location\n\n arrow keys, PgUp, PgDn - move agent / goal (Alt down)\n\n x - toggle trace" \ - " animation (animations required)\n\n m - toggle map between Sparse and Dense\n\n o - take a " \ - "default screenshot of the map\n\n p - take a custom screenshot of the scene\n\n w, a, s, d " \ - "- orbit around the map\n\n q - top view of the map\n\n c, v - toggle Simulator Configuration /" \ - " View Editor\n\n i - toggle Debug Overlay" + " mouse click - moves agent to mouse location\n\n mouse right click - moves goal to mouse location\n\n arrow keys, PgUp, PgDn - move agent / goal (Alt down)\n\n x - toggle trace animation (animations required)\n\n m - toggle map between Sparse and Dense\n\n o - take a default screenshot of the map\n\n p - take a custom screenshot of the scene\n\n w, a, s, d - orbit around the map\n\n q - top view of the map\n\n c, v - toggle Simulator Configuration / View Editor\n\n i - toggle Debug Overlay" self.__algorithms = self.__services.settings.algorithms self.__maps = self.__services.settings.maps @@ -61,7 +56,7 @@ def __init__(self, services: Services, mouse1_press_callbacks: List[Callable[[], borderWidth=(0.0, 0.0), frameColor=WINDOW_BG_COLOUR, pos=(-1, 0.5, 0.5), - frameSize=(-1.7, 1.3, -5.68, 0.85) + frameSize=(-1.7, 1.3, -6.2, 0.85) ) # spacer # DirectFrame(parent=self.__window.frame, @@ -123,7 +118,7 @@ def __init__(self, services: Services, mouse1_press_callbacks: List[Callable[[], text_align=TextNode.ALeft, borderWidth=(.0, .0), pos=(-1.55, 0.0, -3.2), - scale=(0.11, 1.1, 0.11)) + scale=(0.14, 1.4, 0.14)) self.map_label = DirectLabel(parent=self.__window.frame, text="Map:", From 4fd7382baa81b8aba3d91d4f4d47095dd0c79059 Mon Sep 17 00:00:00 2001 From: Maya CHEN <1155141529@link.cuhk.edu.hk> Date: Sat, 2 Aug 2025 19:45:36 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix=F0=9F=90=9B:=20=E6=9B=B4=E6=94=B9?= =?UTF-8?q?=E4=BA=86=E6=96=87=E4=BB=B6=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{A*_labyrinth.png => A_star_labyrinth.png} | Bin 1 file changed, 0 insertions(+), 0 deletions(-) rename readme_files/{A*_labyrinth.png => A_star_labyrinth.png} (100%) diff --git a/readme_files/A*_labyrinth.png b/readme_files/A_star_labyrinth.png similarity index 100% rename from readme_files/A*_labyrinth.png rename to readme_files/A_star_labyrinth.png