Skip to content

Commit f9f0103

Browse files
chase6305Jietao Chen
andauthored
Fix: add component type check on add_component (#50)
Co-authored-by: Jietao Chen <chenjietao@dexforce.com>
1 parent 4a6832a commit f9f0103

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

embodichain/toolkits/urdf_assembly/urdf_assembly_manager.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,11 @@ def add_component(
230230
raise ValueError("component_type must be a string")
231231
if not isinstance(urdf_path, (str, Path)):
232232
raise ValueError("urdf_path must be a string or Path")
233+
if component_type not in self.SUPPORTED_COMPONENTS:
234+
raise ValueError(
235+
f"Unsupported component_type: {component_type}. "
236+
f"Supported types: {self.SUPPORTED_COMPONENTS}"
237+
)
233238

234239
component = URDFComponent(
235240
urdf_path=urdf_path, params=params, transform=transform

0 commit comments

Comments
 (0)