Skip to content

Commit 4fe8e6f

Browse files
stephane-caronStéphane Caron
authored andcommitted
WIP: Update description package syntax
1 parent fd219ae commit 4fe8e6f

File tree

3 files changed

+20
-12
lines changed

3 files changed

+20
-12
lines changed

robot_descriptions/sigmaban_description.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,16 @@
1919
SigmaBan description.
2020
"""
2121

22-
import os
22+
from os import getenv as _getenv
23+
from os import path as _path
2324

2425
from ._cache import clone_to_cache as _clone_to_cache
2526

26-
commit = os.getenv("ROBOT_DESCRIPTION_COMMIT", None)
27+
REPOSITORY_PATH: str = _clone_to_cache(
28+
"sigmaban_urdf",
29+
commit=_getenv("ROBOT_DESCRIPTION_COMMIT", None),
30+
)
2731

28-
REPOSITORY_PATH: str = _clone_to_cache("sigmaban_urdf", commit=commit)
32+
PACKAGE_PATH: str = _path.join(REPOSITORY_PATH)
2933

30-
PACKAGE_PATH: str = os.path.join(REPOSITORY_PATH)
31-
32-
URDF_PATH: str = os.path.join(PACKAGE_PATH, "robot.urdf")
34+
URDF_PATH: str = _path.join(PACKAGE_PATH, "robot.urdf")

robot_descriptions/simple_humanoid_description.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,18 @@
1919
Simple Humanoid description.
2020
"""
2121

22-
from os import path as _path
22+
import os
2323

2424
from ._cache import clone_to_cache as _clone_to_cache
2525

26-
REPOSITORY_PATH: str = _clone_to_cache("simple_humanoid_description")
26+
REPOSITORY_PATH: str = _clone_to_cache(
27+
"simple_humanoid_description", commit=os.getenv("ROBOT_DESCRIPTION_COMMIT", None)
28+
)
2729

28-
PACKAGE_PATH: str = _path.join(REPOSITORY_PATH)
30+
PACKAGE_PATH: str = os.path.join(REPOSITORY_PATH)
2931

30-
URDF_PATH: str = _path.join(PACKAGE_PATH, "urdf", "simple_humanoid.urdf")
32+
URDF_PATH: str = os.path.join(PACKAGE_PATH, "urdf", "simple_humanoid.urdf")
3133

32-
URDF_PATH_CLASSICAL: str = _path.join(
34+
URDF_PATH_CLASSICAL: str = os.path.join(
3335
PACKAGE_PATH, "urdf", "simple_humanoid_classical.urdf"
3436
)

robot_descriptions/solo_description.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,15 @@
1919
Solo description.
2020
"""
2121

22+
from os import getenv as _getenv
2223
from os import path as _path
2324

2425
from ._cache import clone_to_cache as _clone_to_cache
2526

26-
REPOSITORY_PATH: str = _clone_to_cache("example-robot-data")
27+
REPOSITORY_PATH: str = _clone_to_cache(
28+
"example-robot-data",
29+
commit=_getenv("ROBOT_DESCRIPTION_COMMIT", None),
30+
)
2731

2832
PACKAGE_PATH: str = _path.join(REPOSITORY_PATH, "robots", "solo_description")
2933

0 commit comments

Comments
 (0)