Skip to content

Commit

Permalink
fixes after review on gazebo refactor to include ddpg, dqn and ppo
Browse files Browse the repository at this point in the history
  • Loading branch information
ruben.zaragoza committed Jan 9, 2024
1 parent 955b9c2 commit b176efb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Binary file removed behavior_metrics/20231220-202146.bag.active
Binary file not shown.
9 changes: 5 additions & 4 deletions behavior_metrics/ui/gui/views/toolbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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()

Expand Down Expand Up @@ -752,4 +754,3 @@ def open_close_simulator_gui():
environment.open_gzclient()
else:
environment.close_gzclient()

2 changes: 1 addition & 1 deletion behavior_metrics/utils/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down

0 comments on commit b176efb

Please sign in to comment.