From 39c5811de079d556a96a69943720724c01852384 Mon Sep 17 00:00:00 2001 From: Marina Moreira Date: Mon, 26 Feb 2024 17:50:45 -0800 Subject: [PATCH 1/2] making plan pub work fully on GDS --- .../src/survey_planner/command_astrobee.py | 61 ++++++------------- 1 file changed, 20 insertions(+), 41 deletions(-) diff --git a/astrobee/survey_manager/survey_planner/src/survey_planner/command_astrobee.py b/astrobee/survey_manager/survey_planner/src/survey_planner/command_astrobee.py index 313fce21..ed920801 100755 --- a/astrobee/survey_manager/survey_planner/src/survey_planner/command_astrobee.py +++ b/astrobee/survey_manager/survey_planner/src/survey_planner/command_astrobee.py @@ -754,51 +754,30 @@ def survey_manager_executor(args, run, config_static, process_executor, quick: b command_executor.plan_status_needed = True command_executor.plan_name = fplan_path.stem - use_astrobee_ops = True - if use_astrobee_ops: - # Use astrobee_ops tool which provides for user interaction - ops_path = get_ops_path() - cmd_path = ops_path / "dock_scripts" / "hsc" / "cmd" - old_env = os.environ.copy() - try: - os.environ["TOPIC_PREFIX"] = cmd_exec_ns - - cmd = [str(cmd_path), "-c", "plan", "-load", str(fplan_path)] - exit_code = first_non_zero( - exit_code, process_executor.send_command_recursive(cmd) - ) + cmd = [ + "rosrun", + "executive", + "plan_pub", + "-compression", + "deflate", + str(fplan_path), + "-remote", + ] + cmd.extend(ns) - cmd = [str(cmd_path), "-c", "plan", "-run"] - exit_code = first_non_zero( - exit_code, process_executor.send_command_recursive(cmd) - ) - finally: - os.environ.clear() - os.environ.update(old_env) - else: - # Use FSW tools - cmd = [ - "rosrun", - "executive", - "plan_pub", - str(fplan_path), - "-remote", - ] - cmd.extend(ns) - - exit_code = first_non_zero( - exit_code, process_executor.send_command_recursive(cmd) - ) + exit_code = first_non_zero( + exit_code, process_executor.send_command_recursive(cmd) + ) - if exit_code == 0: - exit_code = first_non_zero(exit_code, command_executor.wait_plan()) + if exit_code == 0: + exit_code = first_non_zero(exit_code, command_executor.wait_plan()) - exit_code = first_non_zero(exit_code, command_executor.stop_recording()) + exit_code = first_non_zero(exit_code, command_executor.stop_recording()) - # Ensure robot ends in preferred attitude for its bay. - exit_code = first_non_zero( - exit_code, sm_exec.move(args["base_name"], args["base_name"]) - ) + # Ensure robot ends in preferred attitude for its bay. + exit_code = first_non_zero( + exit_code, sm_exec.move(args["base_name"], args["base_name"]) + ) return exit_code From da226b0418118b350f24e1645fdff04e3cad2dbf Mon Sep 17 00:00:00 2001 From: Marina Moreira Date: Tue, 27 Feb 2024 10:00:15 -0800 Subject: [PATCH 2/2] fixing ident --- .../src/survey_planner/command_astrobee.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/astrobee/survey_manager/survey_planner/src/survey_planner/command_astrobee.py b/astrobee/survey_manager/survey_planner/src/survey_planner/command_astrobee.py index ed920801..6ac6d0f4 100755 --- a/astrobee/survey_manager/survey_planner/src/survey_planner/command_astrobee.py +++ b/astrobee/survey_manager/survey_planner/src/survey_planner/command_astrobee.py @@ -772,12 +772,12 @@ def survey_manager_executor(args, run, config_static, process_executor, quick: b if exit_code == 0: exit_code = first_non_zero(exit_code, command_executor.wait_plan()) - exit_code = first_non_zero(exit_code, command_executor.stop_recording()) + exit_code = first_non_zero(exit_code, command_executor.stop_recording()) - # Ensure robot ends in preferred attitude for its bay. - exit_code = first_non_zero( - exit_code, sm_exec.move(args["base_name"], args["base_name"]) - ) + # Ensure robot ends in preferred attitude for its bay. + exit_code = first_non_zero( + exit_code, sm_exec.move(args["base_name"], args["base_name"]) + ) return exit_code