From 305c34b7b6aa9df0d5304a977768abc251205597 Mon Sep 17 00:00:00 2001 From: Jacopo Panerati Date: Fri, 4 Aug 2023 10:06:12 +0400 Subject: [PATCH] Fixed bug in save image path creation --- gym_pybullet_drones/envs/BaseAviary.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gym_pybullet_drones/envs/BaseAviary.py b/gym_pybullet_drones/envs/BaseAviary.py index f1540133a..5c079d8aa 100755 --- a/gym_pybullet_drones/envs/BaseAviary.py +++ b/gym_pybullet_drones/envs/BaseAviary.py @@ -141,8 +141,9 @@ def __init__(self, if self.IMG_CAPTURE_FREQ%self.PYB_STEPS_PER_CTRL != 0: print("[ERROR] in BaseAviary.__init__(), PyBullet and control frequencies incompatible with the desired video capture frame rate ({:f}Hz)".format(self.IMG_FRAME_PER_SEC)) exit() - for i in range(self.NUM_DRONES): - os.makedirs(os.path.dirname(self.ONBOARD_IMG_PATH+"/drone_"+str(i)+"/"), exist_ok=True) + if self.RECORD: + for i in range(self.NUM_DRONES): + os.makedirs(os.path.dirname(self.ONBOARD_IMG_PATH+"/drone_"+str(i)+"/"), exist_ok=True) #### Connect to PyBullet ################################### if self.GUI: #### With debug GUI ########################################