Skip to content

Commit

Permalink
better mujoco arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
codekansas committed Feb 2, 2025
1 parent 24de69b commit 083cd5c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions kscale/web/cli/robot_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,11 +444,11 @@ async def mujoco(class_name: str, no_cache: bool) -> None:
launches the Mujoco viewer using the provided MJCF file.
"""
try:
from mujoco.viewer import launch_from_path
import mujoco.viewer
except ImportError:
click.echo(
click.style(
"Mujoco and mujoco-python-viewer are required; install with `pip install mujoco mujoco-python-viewer`",
"Mujoco and mujoco-python-viewer are required; install with `pip install mujoco`",
fg="red",
)
)
Expand All @@ -463,8 +463,9 @@ async def mujoco(class_name: str, no_cache: bool) -> None:
click.echo(click.style(f"No MJCF file found in {extracted_folder}", fg="red"))
return

click.echo(f"Launching Mujoco viewer with: {click.style(str(mjcf_file.resolve()), fg='green')}")
launch_from_path(str(mjcf_file.resolve()))
mjcf_path_str = str(mjcf_file.resolve())
click.echo(f"Launching Mujoco viewer with: {click.style(mjcf_path_str, fg='green')}")
mujoco.viewer.launch_from_path(mjcf_path_str)


if __name__ == "__main__":
Expand Down

0 comments on commit 083cd5c

Please sign in to comment.