Unverified Commit 802ec5b7 authored by Kelly Guo's avatar Kelly Guo Committed by GitHub

Moves IO descriptor log dir to logs (#3434)

# Description

Since we recently added logdir into the environment cfg, we can also
move the IO description directory to be a subfolder under logdir.

## Type of change

- Breaking change (existing functionality will not work without user
modification)

## Checklist

- [x] I have read and understood the [contribution
guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html)
- [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with
`./isaaclab.sh --format`
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] I have updated the changelog and the corresponding version in the
extension's `config/extension.toml` file
- [x] I have added my name to the `CONTRIBUTORS.md` or my name already
exists there
parent d5d57112
...@@ -156,10 +156,9 @@ def main(env_cfg: ManagerBasedRLEnvCfg | DirectRLEnvCfg | DirectMARLEnvCfg, agen ...@@ -156,10 +156,9 @@ def main(env_cfg: ManagerBasedRLEnvCfg | DirectRLEnvCfg | DirectMARLEnvCfg, agen
obs_groups = agent_cfg["params"]["env"].get("obs_groups") obs_groups = agent_cfg["params"]["env"].get("obs_groups")
concate_obs_groups = agent_cfg["params"]["env"].get("concate_obs_groups", True) concate_obs_groups = agent_cfg["params"]["env"].get("concate_obs_groups", True)
# set the IO descriptors output directory if requested # set the IO descriptors export flag if requested
if isinstance(env_cfg, ManagerBasedRLEnvCfg): if isinstance(env_cfg, ManagerBasedRLEnvCfg):
env_cfg.export_io_descriptors = args_cli.export_io_descriptors env_cfg.export_io_descriptors = args_cli.export_io_descriptors
env_cfg.io_descriptors_output_dir = os.path.join(log_root_path, log_dir)
else: else:
omni.log.warn( omni.log.warn(
"IO descriptors are only supported for manager based RL environments. No IO descriptors will be exported." "IO descriptors are only supported for manager based RL environments. No IO descriptors will be exported."
......
...@@ -141,10 +141,9 @@ def main(env_cfg: ManagerBasedRLEnvCfg | DirectRLEnvCfg | DirectMARLEnvCfg, agen ...@@ -141,10 +141,9 @@ def main(env_cfg: ManagerBasedRLEnvCfg | DirectRLEnvCfg | DirectMARLEnvCfg, agen
log_dir += f"_{agent_cfg.run_name}" log_dir += f"_{agent_cfg.run_name}"
log_dir = os.path.join(log_root_path, log_dir) log_dir = os.path.join(log_root_path, log_dir)
# set the IO descriptors output directory if requested # set the IO descriptors export flag if requested
if isinstance(env_cfg, ManagerBasedRLEnvCfg): if isinstance(env_cfg, ManagerBasedRLEnvCfg):
env_cfg.export_io_descriptors = args_cli.export_io_descriptors env_cfg.export_io_descriptors = args_cli.export_io_descriptors
env_cfg.io_descriptors_output_dir = log_dir
else: else:
omni.log.warn( omni.log.warn(
"IO descriptors are only supported for manager based RL environments. No IO descriptors will be exported." "IO descriptors are only supported for manager based RL environments. No IO descriptors will be exported."
......
...@@ -143,10 +143,9 @@ def main(env_cfg: ManagerBasedRLEnvCfg | DirectRLEnvCfg | DirectMARLEnvCfg, agen ...@@ -143,10 +143,9 @@ def main(env_cfg: ManagerBasedRLEnvCfg | DirectRLEnvCfg | DirectMARLEnvCfg, agen
policy_arch = agent_cfg.pop("policy") policy_arch = agent_cfg.pop("policy")
n_timesteps = agent_cfg.pop("n_timesteps") n_timesteps = agent_cfg.pop("n_timesteps")
# set the IO descriptors output directory if requested # set the IO descriptors export flag if requested
if isinstance(env_cfg, ManagerBasedRLEnvCfg): if isinstance(env_cfg, ManagerBasedRLEnvCfg):
env_cfg.export_io_descriptors = args_cli.export_io_descriptors env_cfg.export_io_descriptors = args_cli.export_io_descriptors
env_cfg.io_descriptors_output_dir = log_dir
else: else:
omni.log.warn( omni.log.warn(
"IO descriptors are only supported for manager based RL environments. No IO descriptors will be exported." "IO descriptors are only supported for manager based RL environments. No IO descriptors will be exported."
......
...@@ -173,10 +173,9 @@ def main(env_cfg: ManagerBasedRLEnvCfg | DirectRLEnvCfg | DirectMARLEnvCfg, agen ...@@ -173,10 +173,9 @@ def main(env_cfg: ManagerBasedRLEnvCfg | DirectRLEnvCfg | DirectMARLEnvCfg, agen
# get checkpoint path (to resume training) # get checkpoint path (to resume training)
resume_path = retrieve_file_path(args_cli.checkpoint) if args_cli.checkpoint else None resume_path = retrieve_file_path(args_cli.checkpoint) if args_cli.checkpoint else None
# set the IO descriptors output directory if requested # set the IO descriptors export flag if requested
if isinstance(env_cfg, ManagerBasedRLEnvCfg): if isinstance(env_cfg, ManagerBasedRLEnvCfg):
env_cfg.export_io_descriptors = args_cli.export_io_descriptors env_cfg.export_io_descriptors = args_cli.export_io_descriptors
env_cfg.io_descriptors_output_dir = os.path.join(log_root_path, log_dir)
else: else:
omni.log.warn( omni.log.warn(
"IO descriptors are only supported for manager based RL environments. No IO descriptors will be exported." "IO descriptors are only supported for manager based RL environments. No IO descriptors will be exported."
......
[package] [package]
# Note: Semantic Versioning is used: https://semver.org/ # Note: Semantic Versioning is used: https://semver.org/
version = "0.46.0" version = "0.46.1"
# Description # Description
title = "Isaac Lab framework for Robot Learning" title = "Isaac Lab framework for Robot Learning"
......
Changelog Changelog
--------- ---------
0.46.1 (2025-09-10)
~~~~~~~~~~~~~~~~~~~
Changed
^^^^^^^
* Moved IO descriptors output directory to a subfolder under the task log directory.
0.46.0 (2025-09-06) 0.46.0 (2025-09-06)
~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
......
...@@ -250,12 +250,13 @@ class ManagerBasedEnv: ...@@ -250,12 +250,13 @@ class ManagerBasedEnv:
IO_descriptors = self.get_IO_descriptors IO_descriptors = self.get_IO_descriptors
if output_dir is None: if output_dir is None:
output_dir = self.cfg.io_descriptors_output_dir if self.cfg.log_dir is not None:
if output_dir is None: output_dir = os.path.join(self.cfg.log_dir, "io_descriptors")
raise ValueError( else:
"Output directory is not set. Please set the output directory using the `io_descriptors_output_dir`" raise ValueError(
" configuration." "Output directory is not set. Please set the log directory using the `log_dir`"
) " configuration or provide an explicit output_dir parameter."
)
if not os.path.exists(output_dir): if not os.path.exists(output_dir):
os.makedirs(output_dir, exist_ok=True) os.makedirs(output_dir, exist_ok=True)
......
...@@ -129,8 +129,5 @@ class ManagerBasedEnvCfg: ...@@ -129,8 +129,5 @@ class ManagerBasedEnvCfg:
export_io_descriptors: bool = False export_io_descriptors: bool = False
"""Whether to export the IO descriptors for the environment. Defaults to False.""" """Whether to export the IO descriptors for the environment. Defaults to False."""
io_descriptors_output_dir: str | None = None
"""The directory to export the IO descriptors to. Defaults to None."""
log_dir: str | None = None log_dir: str | None = None
"""Directory for logging experiment artifacts. Defaults to None, in which case no specific log directory is set.""" """Directory for logging experiment artifacts. Defaults to None, in which case no specific log directory is set."""
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment