diff --git a/behavior_metrics/20231220-202146.bag.active b/behavior_metrics/20231220-202146.bag.active deleted file mode 100644 index ca595d66..00000000 Binary files a/behavior_metrics/20231220-202146.bag.active and /dev/null differ 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']