diff --git a/atos/modules/OpenScenarioGateway/openscenariogateway.py b/atos/modules/OpenScenarioGateway/openscenariogateway.py index 1bc3f8522..6a6236efd 100755 --- a/atos/modules/OpenScenarioGateway/openscenariogateway.py +++ b/atos/modules/OpenScenarioGateway/openscenariogateway.py @@ -108,13 +108,13 @@ def story_board_element_state_change_callback(self, story_board_element): def parameter_callback(self, params): for param in params: if param.name == SCENARIO_FILE_PARAMETER and param.value: - self.update_scenario() + self.update_scenario(file_name=param.value) elif param.name == ACTIVE_OBJECT_NAME_PARAMETER: self.update_active_scenario_objects(active_objects_name=param.value) return SetParametersResult(successful=True) - def update_scenario(self): - scenario_file = self.getScenarioFilePath() + def update_scenario(self, file_name): + scenario_file = self.getAbsoluteOSCPath(file_name) # Check if the file exists, else throw an error if not path.exists(scenario_file): self.get_logger().error("File does not exist: {}".format(scenario_file)) @@ -147,12 +147,6 @@ def update_active_scenario_objects(self, active_objects_name: List[str]): ) ) - def init_callback(self, _): - self.update_scenario() - self.update_active_scenario_objects( - self.get_parameter(ACTIVE_OBJECT_NAME_PARAMETER).value - ) - def get_all_objects_in_scenario(self, scenario_file) -> List[ScenarioObject]: scenario = xosc.ParseOpenScenario(scenario_file) scenario_objects = {