36
36
# The menagerie path is used to load robot assets.
37
37
# Resource paths do not have glob implemented, so we use a bare epath.Path.
38
38
MENAGERIE_PATH = EXTERNAL_DEPS_PATH / "mujoco_menagerie"
39
+ # Commit SHA of the menagerie repo.
40
+ MENAGERIE_COMMIT_SHA = "5e6af47a49bf8ae27581615b54045107b20ce584"
39
41
40
42
41
- def _clone_with_progress (repo_url : str , target_path : str ) -> None :
43
+ def _clone_with_progress (
44
+ repo_url : str , target_path : str , commit_sha : str
45
+ ) -> None :
42
46
"""Clone a git repo with progress bar."""
43
47
process = subprocess .Popen (
44
48
["git" , "clone" , "--progress" , repo_url , target_path ],
@@ -75,6 +79,15 @@ def _clone_with_progress(repo_url: str, target_path: str) -> None:
75
79
if process .returncode != 0 :
76
80
raise subprocess .CalledProcessError (process .returncode , ["git" , "clone" ])
77
81
82
+ # Checkout specific commit.
83
+ print (f"Checking out commit { commit_sha } " )
84
+ subprocess .run (
85
+ ["git" , "-C" , target_path , "checkout" , commit_sha ],
86
+ check = True ,
87
+ stdout = subprocess .PIPE ,
88
+ stderr = subprocess .PIPE ,
89
+ )
90
+
78
91
79
92
def ensure_menagerie_exists () -> None :
80
93
"""Ensure mujoco_menagerie exists, downloading it if necessary."""
@@ -88,6 +101,7 @@ def ensure_menagerie_exists() -> None:
88
101
_clone_with_progress (
89
102
"https://github.com/deepmind/mujoco_menagerie.git" ,
90
103
str (MENAGERIE_PATH ),
104
+ MENAGERIE_COMMIT_SHA ,
91
105
)
92
106
print ("Successfully downloaded mujoco_menagerie" )
93
107
except subprocess .CalledProcessError as e :
0 commit comments