Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@
- Edvard Bruun <<ebruun@princeton.edu>> [@ebruun](https://github.com/ebruun)
- Victor Pok Yin Leung <<leung@arch.ethz.ch>> [@yck011522](https://github.com/yck011522)
- Begüm Saral <<begum.saral@tum.de>> [@begums](https://github.com/begums)
- Swastik Verma <<swastikjee09@gmail.com>> [@Swastik-Verma](https://github.com/Swastik-Verma)
7 changes: 5 additions & 2 deletions src/compas_fab/robots/robot_cell.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,11 @@ def get_link_names(self, group: Optional[str] = None) -> list[str]:
base_link_name = self.get_base_link_name(group)
end_effector_link_name = self.get_end_effector_link_name(group)
link_names = []
for link in self.robot_model.iter_link_chain(base_link_name, end_effector_link_name):
link_names.append(link.name)
if base_link_name is not None and base_link_name == end_effector_link_name:
link_names.append(base_link_name)
else:
for link in self.robot_model.iter_link_chain(base_link_name, end_effector_link_name):
link_names.append(link.name)
return link_names

def get_link_names_with_collision_geometry(self) -> list[str]:
Expand Down
3 changes: 3 additions & 0 deletions tests/robots/test_robot_cell.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ def _test(rc: RobotCell, rcs: RobotCellState):
_test(*rfl)
_test(*ur10e_gripper_one_beam)
_test(*abb_irb4600_40_255_gripper_one_beam)
robot_cell, robot_cell_state = ur10e_gripper_one_beam
link_names = robot_cell.get_link_names("endeffector")
assert link_names == ["tool0"]
Comment on lines +181 to +183

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't really test that the fix works. You'd need to add a test that has a robot with a single link group.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback! I'm a bit busy right now but will address both points soon.



def test_default_touch_links_returns_first_geometry_bearing_link():
Expand Down
Loading