Skip to content

Commit 4a5c9fb

Browse files
Add example to load with a specific commit
1 parent 982445a commit 4a5c9fb

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

examples/specific_commit.py

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env python3
2+
# -*- coding: utf-8 -*-
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
# Copyright 2024 Inria
6+
7+
"""
8+
We can load specific commit to pin the version of any robot description using
9+
the ``commit`` keyword argument. In this example, we load a Universal Robots
10+
UR5e from a specific commit of the MuJoCo Menagerie repository that distributes
11+
it. This example requires MuJoCo, which is installed by ``pip install mujoco``.
12+
13+
See also:
14+
https://github.com/robot-descriptions/robot_descriptions.py/discussions/86
15+
"""
16+
17+
from robot_descriptions.loaders.mujoco import load_robot_description
18+
19+
if __name__ == "__main__":
20+
model = load_robot_description(
21+
"ur5e_mj_description",
22+
commit="cc3868ec21bae324e6dd3b01ea185b6e6f0fa172",
23+
)
24+
print(f"UR5e successfully loaded in {model=}")

0 commit comments

Comments
 (0)