Skip to content

Commit 606301b

Browse files
Check that URDF_PATH is defined in show command
1 parent a6820da commit 606301b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

robot_descriptions/_command_line.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ def show(
141141
module = import_module(f"robot_descriptions.{name}")
142142
except ModuleNotFoundError:
143143
module = import_module(f"robot_descriptions.{name}_description")
144+
if not hasattr(module, "URDF_PATH"):
145+
raise ValueError(
146+
"show command only applies to URDF, check out the "
147+
"``show_in_mujoco.py`` example for MJCF descriptions"
148+
)
144149

145150
if collision:
146151
robot = yourdfpy.URDF.load(
@@ -175,6 +180,11 @@ def animate(
175180
module = import_module(f"robot_descriptions.{name}")
176181
except ModuleNotFoundError:
177182
module = import_module(f"robot_descriptions.{name}_description")
183+
if not hasattr(module, "URDF_PATH"):
184+
raise ValueError(
185+
"show command only applies to URDF, check out the "
186+
"``show_in_mujoco.py`` example for MJCF descriptions"
187+
)
178188

179189
if collision:
180190
robot = yourdfpy.URDF.load(

0 commit comments

Comments
 (0)