-
Notifications
You must be signed in to change notification settings - Fork 26
Closed
Description
In pose_evaluation library we had implemented the following, but decided they ought to be in pose-format instead:
def copy_pose(pose: Pose) -> Pose:
return pose.get_components([component.name for component in pose.header.components])
def remove_components(
pose: Pose,
components_to_remove: List[str] | str,
points_to_remove: List[str] | str | None = None,
):
if points_to_remove is None:
points_to_remove = []
if isinstance(components_to_remove, str):
components_to_remove = [components_to_remove]
if isinstance(points_to_remove, str):
points_to_remove = [points_to_remove]
components_to_keep = []
points_dict = {}
for component in pose.header.components:
if component.name not in components_to_remove:
components_to_keep.append(component.name)
points_dict[component.name] = []
for point in component.points:
if point not in points_to_remove:
points_dict[component.name].append(point)
return pose.get_components(components_to_keep, points_dict)Metadata
Metadata
Assignees
Labels
No labels