From bb6c09d57d735fd901af928ea93ba17b9b840701 Mon Sep 17 00:00:00 2001 From: ll7 Date: Wed, 25 Sep 2024 15:05:38 +0200 Subject: [PATCH] refactor: Update robot_env.py to include current working directory in filename for recordings --- robot_sf/gym_env/robot_env.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/robot_sf/gym_env/robot_env.py b/robot_sf/gym_env/robot_env.py index 43a36e0..9eba509 100644 --- a/robot_sf/gym_env/robot_env.py +++ b/robot_sf/gym_env/robot_env.py @@ -259,7 +259,9 @@ def save_recording(self, filename: str = None): """ if filename is None: now = datetime.datetime.now() - filename = f'recordings/{now.strftime("%Y-%m-%d_%H-%M-%S")}.pkl' + # get current working directory + cwd = os.getcwd() + filename = f'{cwd}/recordings/{now.strftime("%Y-%m-%d_%H-%M-%S")}.pkl' # only save if there are recorded states if len(self.recorded_states) == 0: