diff --git a/robotics_application_manager/libs/__init__.py b/robotics_application_manager/libs/__init__.py index 1ddd9f7..e3162f7 100644 --- a/robotics_application_manager/libs/__init__.py +++ b/robotics_application_manager/libs/__init__.py @@ -10,7 +10,6 @@ from .process_utils import ( get_ros_version, check_gpu_acceleration, - get_user_world, wait_for_xserver, wait_for_process_to_start, stop_process_and_children, diff --git a/robotics_application_manager/libs/process_utils.py b/robotics_application_manager/libs/process_utils.py index 14c28c9..56126d9 100644 --- a/robotics_application_manager/libs/process_utils.py +++ b/robotics_application_manager/libs/process_utils.py @@ -153,26 +153,3 @@ def check_gpu_acceleration(): def get_ros_version(): output = subprocess.check_output(["bash", "-c", "echo $ROS_VERSION"]) return output.decode("utf-8")[0] - - -def get_user_world(launch_file): - """ " - Processes a provided base64 encoded string representing a zip file, decodes it, - saves it as a zip file, and then extracts its contents. - - The function takes a base64 encoded string (`launch_file`) as input. It first decodes this - string into binary format, then saves this binary content as a zip file in a predetermined - directory ('workspace/binaries/'). After saving, it extracts the contents of the zip file into - another specified directory ('workspace/worlds/'). - """ - try: - # Convert base64 to binary - binary_content = base64.b64decode(launch_file) - # Save the binary content as a file - with open("workspace/binaries/user_worlds.zip", "wb") as file: - file.write(binary_content) - # Unzip the file - with zipfile.ZipFile("workspace/binaries/user_worlds.zip", "r") as zip_ref: - zip_ref.extractall("workspace/worlds/") - except Exception as e: - LogManager.logging.error(f"An error occurred getting user world: {e}") diff --git a/robotics_application_manager/manager/manager.py b/robotics_application_manager/manager/manager.py index 69b018f..770e4e3 100644 --- a/robotics_application_manager/manager/manager.py +++ b/robotics_application_manager/manager/manager.py @@ -325,6 +325,10 @@ def on_launch_world(self, event): scene_cfg = cfg_dict["scene"] robot_cfg = cfg_dict["robot"] + # Backwards compatibility for now + if isinstance(robot_cfg, list): + robot_cfg = robot_cfg[0] + # Launch scene try: if scene_cfg["type"] == None: