Skip to content

Commit

Permalink
Add joint validation in Model class
Browse files Browse the repository at this point in the history
  • Loading branch information
Giulero committed Dec 11, 2023
1 parent 469f054 commit 4b5f2f6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/adam/model/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ def build(factory: ModelFactory, joints_name_list: List[str]) -> "Model":
links = factory.get_links()
frames = factory.get_frames()

# check if the joints in the list are in the model
for joint_str in joints_name_list:
if joint_str not in [joint.name for joint in joints]:
raise ValueError(
f"{joint_str} is not in the robot model. Check the joints_name_list"
)

# set idx to the actuated joints
for [idx, joint_str] in enumerate(joints_name_list):
for joint in joints:
Expand Down

0 comments on commit 4b5f2f6

Please sign in to comment.