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

fix: set output directory #1

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Changes from all commits
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
16 changes: 8 additions & 8 deletions log_evaluator/launch/log_evaluator.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ def ensure_arg_compatibility(context: LaunchContext) -> list:
scenario_path = Path(conf["scenario_path"])
dataset_dir = scenario_path.parent if conf["dataset_dir"] == "" else Path(conf["dataset_dir"])

time_now = datetime.datetime.now().strftime("%Y-%m%d-%H%M%S") # noqa
output_dir = (
scenario_path.parent.joinpath("out", time_now)
if conf["output_dir"] == ""
else Path(conf["output_dir"])
)
conf["output_dir"] = output_dir.as_posix()

with scenario_path.open() as scenario_file:
yaml_obj = yaml.safe_load(scenario_file)
# check datasets length and index
Expand Down Expand Up @@ -118,7 +126,6 @@ def ensure_arg_compatibility(context: LaunchContext) -> list:
conf["sensor_model"] = yaml_obj["SensorModel"]
conf["t4_dataset_path"] = dataset_path.as_posix()
conf["input_bag"] = dataset_path.joinpath("input_bag").as_posix()
output_dir = Path(conf["output_dir"])
conf["result_json_path"] = output_dir.joinpath("result.json").as_posix()
conf["result_bag_path"] = output_dir.joinpath("result_bag").as_posix()
conf["result_archive_path"] = output_dir.joinpath("result_archive_path").as_posix()
Expand All @@ -128,14 +135,7 @@ def ensure_arg_compatibility(context: LaunchContext) -> list:
conf["annotationless_pass_range"] = ""

# create output directory
time_now = datetime.datetime.now().strftime("%Y-%m%d-%H%M%S") # noqa
output_dir = (
scenario_path.parent.joinpath("out", time_now)
if conf["output_dir"] == ""
else Path(conf["output_dir"])
)
output_dir.mkdir(exist_ok=True, parents=True)
conf["output_dir"] = output_dir.as_posix()

return [
LogInfo(
Expand Down
Loading