Skip to content
Open
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
8 changes: 8 additions & 0 deletions scripts/reinforcement_learning/rsl_rl/play.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import os
import sys
import time
import logging
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import out of alphabetical order

The import logging statement is placed after import time, but the rest of the stdlib imports in this file follow alphabetical order (argparse, importlib, os, sys, time). logging should appear between importlib and os. The project's train.py already follows this ordering correctly.

Suggested change
import logging
import logging
import os
import sys
import time

(And remove import logging from line 13.)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!


import gymnasium as gym
import torch
Expand Down Expand Up @@ -66,6 +67,13 @@

sys.argv = [sys.argv[0]] + hydra_args

# Reduce noisy logs from third-party libraries without changing behavior.
# - onnxscript / onnx_ir: hide DEBUG converter chatter
# - isaaclab_physx: hide repetitive WARNINGs (e.g., body count mismatch) while keeping errors
logging.getLogger("onnxscript").setLevel(logging.INFO)
logging.getLogger("onnx_ir").setLevel(logging.INFO)
logging.getLogger("isaaclab_physx").setLevel(logging.ERROR)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overly broad suppression of isaaclab_physx warnings

Setting isaaclab_physx to logging.ERROR suppresses all WARNING-level messages from that namespace, not just the repetitive "body count mismatch" ones mentioned in the comment. isaaclab_physx is a first-party Isaac Lab library, and future warnings added to it (e.g., deprecation notices, configuration issues, or new diagnostics) will be silently dropped for any user running this play script.

A more targeted approach would be to use a logging.Filter to suppress only the known-noisy messages, while allowing other WARNING-level output through:

class _BodyCountFilter(logging.Filter):
    def filter(self, record):
        return "body count mismatch" not in record.getMessage()

logging.getLogger("isaaclab_physx").addFilter(_BodyCountFilter())

Alternatively, if the intent is intentional and the warning is truly always noise during play, a brief comment explaining why all warnings from this namespace are safe to discard would help future maintainers.


# Check for installed RSL-RL version
installed_version = metadata.version("rsl-rl-lib")

Expand Down
Loading