Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

making plan pub work fully on GDS #151

Merged
merged 2 commits into from
Feb 27, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading