From b176efb031c7143102550175fe9a18ba5477caf1 Mon Sep 17 00:00:00 2001 From: "ruben.zaragoza" Date: Tue, 9 Jan 2024 19:08:42 +0100 Subject: [PATCH] fixes after review on gazebo refactor to include ddpg, dqn and ppo --- behavior_metrics/20231220-202146.bag.active | Bin 4117 -> 0 bytes behavior_metrics/ui/gui/views/toolbar.py | 9 +++++---- behavior_metrics/utils/configuration.py | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) delete mode 100644 behavior_metrics/20231220-202146.bag.active diff --git a/behavior_metrics/20231220-202146.bag.active b/behavior_metrics/20231220-202146.bag.active deleted file mode 100644 index ca595d66ac42f6aed57701fefa3da5d42ed49d7e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4117 zcmY!m@(*@$bXN#7(lg+4Wnf?s0OI6~(!A{W?S diff --git a/behavior_metrics/ui/gui/views/toolbar.py b/behavior_metrics/ui/gui/views/toolbar.py index 2ebd9ce8..a790bf38 100644 --- a/behavior_metrics/ui/gui/views/toolbar.py +++ b/behavior_metrics/ui/gui/views/toolbar.py @@ -471,8 +471,10 @@ def create_brain_gb(self): self.brain_combobox = QComboBox() self.brain_combobox.setEnabled(True) - brains = [file.split(".")[0] for file in os.listdir(brains_path + self.configuration.environment + '/' - + self.configuration.robot_type) if file.endswith('.py') and file.split(".")[0] != '__init__'] + environment_subpath = self.configuration.environment + '/' if self.configuration.environment is not None else "" + brains = [file.split(".")[0] for file + in os.listdir(brains_path + environment_subpath + self.configuration.robot_type) + if file.endswith('.py') and file.split(".")[0] != '__init__'] self.brain_combobox.addItem('') self.brain_combobox.addItems(brains) index = self.brain_combobox.findText(current_brain, Qt.MatchFixedString) @@ -702,7 +704,7 @@ def resume_simulation(self): brain = self.brain_combobox.currentText() + '.py' # load brain from controller - #if type(self.controller) != controller_carla.ControllerCarla: + # if type(self.controller) != controller_carla.ControllerCarla: # self.controller.reload_brain(brains_path + self.configuration.robot_type + '/' + brain) self.controller.resume_pilot() @@ -752,4 +754,3 @@ def open_close_simulator_gui(): environment.open_gzclient() else: environment.close_gzclient() - diff --git a/behavior_metrics/utils/configuration.py b/behavior_metrics/utils/configuration.py index 8983cf73..20667556 100644 --- a/behavior_metrics/utils/configuration.py +++ b/behavior_metrics/utils/configuration.py @@ -97,7 +97,7 @@ def initialize_configuration(self, config_data): """ robot = config_data['Behaviors']['Robot'] self.brain_path = robot['BrainPath'] - self.environment = robot['Environment'] + self.environment = robot.get('Environment', None) self.robot_type = robot['Type'] self.pilot_time_cycle = robot['PilotTimeCycle'] self.current_world = config_data['Behaviors']['Simulation']['World']