Skip to content

Commit

Permalink
Fixed multiple ball mates sharing the same parent.
Browse files Browse the repository at this point in the history
  • Loading branch information
senthurayyappan committed Dec 12, 2024
1 parent 2780393 commit 6558091
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion onshape_api/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def plot_graph(graph: Union[nx.Graph, nx.DiGraph], file_name: Optional[str] = No
"""
colors = [f"#{random.randint(0, 0xFFFFFF):06x}" for _ in range(len(graph.nodes))] # noqa: S311
plt.figure(figsize=(8, 8))
pos = nx.spring_layout(graph)
pos = nx.shell_layout(graph)

if file_name:
nx.draw(
Expand Down
4 changes: 2 additions & 2 deletions onshape_api/urdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,10 @@ def get_robot_joint(

elif mate.mateType == MateType.BALL:
dummy_x = Link(
name=f"{parent}-dummy-x",
name=f"{parent}-{mate.name}-x",
)
dummy_y = Link(
name=f"{parent}-dummy-y",
name=f"{parent}-{mate.name}-y",
)

links = [dummy_x, dummy_y]
Expand Down

0 comments on commit 6558091

Please sign in to comment.