Unverified Commit 280b667a authored by rwiltz's avatar rwiltz Committed by GitHub

Changes logging from omni log to print for console output (#563)

# Description
Change logging from omni log to print for console output
<!--
Thank you for your interest in sending a pull request. Please make sure
to check the contribution guidelines.

Link:
https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html
-->

Please include a summary of the change and which issue is fixed. Please
also include relevant motivation and context.
List any dependencies that are required for this change.

Fixes # (issue)

<!-- As a practice, it is recommended to open an issue to have
discussions on the proposed pull request.
This makes it easier for the community to keep track of what is being
developed or added, and if a given feature
is demanded by more than one party. -->

## Type of change

<!-- As you go through the list, delete the ones that are not
applicable. -->

- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- This change requires a documentation update

## Screenshots

Please attach before and after screenshots of the change if applicable.

<!--
Example:

| Before | After |
| ------ | ----- |
| _gif/png before_ | _gif/png after_ |

To upload images to a PR -- simply drag and drop an image while in edit
mode and it should upload the image directly. You can then paste that
source into the above before/after sections.
-->

## Checklist

- [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
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] 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

<!--
As you go through the checklist above, you can mark something as done by
putting an x character in it

For example,
- [x] I have done this task
- [ ] I have not done this task
-->
parent ba0ac372
...@@ -127,7 +127,7 @@ def main() -> None: ...@@ -127,7 +127,7 @@ def main() -> None:
""" """
nonlocal should_reset_recording_instance nonlocal should_reset_recording_instance
should_reset_recording_instance = True should_reset_recording_instance = True
omni.log.info("Reset triggered - Environment will reset on next step") print("Reset triggered - Environment will reset on next step")
def start_teleoperation() -> None: def start_teleoperation() -> None:
""" """
...@@ -140,7 +140,7 @@ def main() -> None: ...@@ -140,7 +140,7 @@ def main() -> None:
""" """
nonlocal teleoperation_active nonlocal teleoperation_active
teleoperation_active = True teleoperation_active = True
omni.log.info("Teleoperation activated") print("Teleoperation activated")
def stop_teleoperation() -> None: def stop_teleoperation() -> None:
""" """
...@@ -153,7 +153,7 @@ def main() -> None: ...@@ -153,7 +153,7 @@ def main() -> None:
""" """
nonlocal teleoperation_active nonlocal teleoperation_active
teleoperation_active = False teleoperation_active = False
omni.log.info("Teleoperation deactivated") print("Teleoperation deactivated")
# Create device config if not already in env_cfg # Create device config if not already in env_cfg
teleoperation_callbacks: dict[str, Callable[[], None]] = { teleoperation_callbacks: dict[str, Callable[[], None]] = {
...@@ -219,13 +219,13 @@ def main() -> None: ...@@ -219,13 +219,13 @@ def main() -> None:
simulation_app.close() simulation_app.close()
return return
omni.log.info(f"Using teleop device: {teleop_interface}") print(f"Using teleop device: {teleop_interface}")
# reset environment # reset environment
env.reset() env.reset()
teleop_interface.reset() teleop_interface.reset()
omni.log.info("Teleoperation started. Press 'R' to reset the environment.") print("Teleoperation started. Press 'R' to reset the environment.")
# simulate environment # simulate environment
while simulation_app.is_running(): while simulation_app.is_running():
...@@ -247,14 +247,14 @@ def main() -> None: ...@@ -247,14 +247,14 @@ def main() -> None:
if should_reset_recording_instance: if should_reset_recording_instance:
env.reset() env.reset()
should_reset_recording_instance = False should_reset_recording_instance = False
omni.log.info("Environment reset complete") print("Environment reset complete")
except Exception as e: except Exception as e:
omni.log.error(f"Error during simulation step: {e}") omni.log.error(f"Error during simulation step: {e}")
break break
# close the simulator # close the simulator
env.close() env.close()
omni.log.info("Environment closed") print("Environment closed")
if __name__ == "__main__": if __name__ == "__main__":
......
...@@ -161,7 +161,7 @@ def setup_output_directories() -> tuple[str, str]: ...@@ -161,7 +161,7 @@ def setup_output_directories() -> tuple[str, str]:
# create directory if it does not exist # create directory if it does not exist
if not os.path.exists(output_dir): if not os.path.exists(output_dir):
os.makedirs(output_dir) os.makedirs(output_dir)
omni.log.info(f"Created output directory: {output_dir}") print(f"Created output directory: {output_dir}")
return output_dir, output_file_name return output_dir, output_file_name
...@@ -342,7 +342,7 @@ def process_success_condition(env: gym.Env, success_term: object | None, success ...@@ -342,7 +342,7 @@ def process_success_condition(env: gym.Env, success_term: object | None, success
[0], torch.tensor([[True]], dtype=torch.bool, device=env.device) [0], torch.tensor([[True]], dtype=torch.bool, device=env.device)
) )
env.recorder_manager.export_episodes([0]) env.recorder_manager.export_episodes([0])
omni.log.info("Success condition met! Recording completed.") print("Success condition met! Recording completed.")
return success_step_count, True return success_step_count, True
else: else:
success_step_count = 0 success_step_count = 0
...@@ -367,7 +367,7 @@ def handle_reset( ...@@ -367,7 +367,7 @@ def handle_reset(
Returns: Returns:
int: Reset success step count (0) int: Reset success step count (0)
""" """
omni.log.info("Resetting environment...") print("Resetting environment...")
env.sim.reset() env.sim.reset()
env.recorder_manager.reset() env.recorder_manager.reset()
env.reset() env.reset()
...@@ -406,17 +406,17 @@ def run_simulation_loop( ...@@ -406,17 +406,17 @@ def run_simulation_loop(
def reset_recording_instance(): def reset_recording_instance():
nonlocal should_reset_recording_instance nonlocal should_reset_recording_instance
should_reset_recording_instance = True should_reset_recording_instance = True
omni.log.info("Recording instance reset requested") print("Recording instance reset requested")
def start_recording_instance(): def start_recording_instance():
nonlocal running_recording_instance nonlocal running_recording_instance
running_recording_instance = True running_recording_instance = True
omni.log.info("Recording started") print("Recording started")
def stop_recording_instance(): def stop_recording_instance():
nonlocal running_recording_instance nonlocal running_recording_instance
running_recording_instance = False running_recording_instance = False
omni.log.info("Recording paused") print("Recording paused")
# Set up teleoperation callbacks # Set up teleoperation callbacks
teleoperation_callbacks = { teleoperation_callbacks = {
...@@ -467,7 +467,7 @@ def run_simulation_loop( ...@@ -467,7 +467,7 @@ def run_simulation_loop(
if env.recorder_manager.exported_successful_episode_count > current_recorded_demo_count: if env.recorder_manager.exported_successful_episode_count > current_recorded_demo_count:
current_recorded_demo_count = env.recorder_manager.exported_successful_episode_count current_recorded_demo_count = env.recorder_manager.exported_successful_episode_count
label_text = f"Recorded {current_recorded_demo_count} successful demonstrations." label_text = f"Recorded {current_recorded_demo_count} successful demonstrations."
omni.log.info(label_text) print(label_text)
# Handle reset if requested # Handle reset if requested
if should_reset_recording_instance: if should_reset_recording_instance:
...@@ -476,7 +476,7 @@ def run_simulation_loop( ...@@ -476,7 +476,7 @@ def run_simulation_loop(
# Check if we've reached the desired number of demos # Check if we've reached the desired number of demos
if args_cli.num_demos > 0 and env.recorder_manager.exported_successful_episode_count >= args_cli.num_demos: if args_cli.num_demos > 0 and env.recorder_manager.exported_successful_episode_count >= args_cli.num_demos:
omni.log.info(f"All {args_cli.num_demos} demonstrations recorded. Exiting the app.") print(f"All {args_cli.num_demos} demonstrations recorded. Exiting the app.")
break break
# Check if simulation is stopped # Check if simulation is stopped
...@@ -524,8 +524,8 @@ def main() -> None: ...@@ -524,8 +524,8 @@ def main() -> None:
# Clean up # Clean up
env.close() env.close()
omni.log.info(f"Recording session completed with {current_recorded_demo_count} successful demonstrations") print(f"Recording session completed with {current_recorded_demo_count} successful demonstrations")
omni.log.info(f"Demonstrations saved to: {args_cli.dataset_file}") print(f"Demonstrations saved to: {args_cli.dataset_file}")
if __name__ == "__main__": if __name__ == "__main__":
......
[package] [package]
# Note: Semantic Versioning is used: https://semver.org/ # Note: Semantic Versioning is used: https://semver.org/
version = "0.42.25" version = "0.42.26"
# Description # Description
title = "Isaac Lab framework for Robot Learning" title = "Isaac Lab framework for Robot Learning"
......
Changelog Changelog
--------- ---------
0.42.26 (2025-07-22)
~~~~~~~~~~~~~~~~~~~~
Changed
^^^^^^^
* Updated teleop scripts to print to console vs omni log.
0.42.25 (2025-07-17) 0.42.25 (2025-07-17)
~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
......
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