Zum Inhalt

GripTargetFactory

A factory class which is able to create GripPositions for a set of given parameters.

Attributes:

Name Type Description
face_to_mount GripperFace

the face which should be mounted

num_rotations int

the number of rotations from the default configuration (facing from robot base towards mount)

parent robolink.Item

the grip target reference frame

parent_name str

the name of the grip target reference frame

prepare_offset float

the offset used for the prepare positions

mat np.ndarray

the base of grip position coordinate system

get_grip_position(self, grip_position_type)

Creates and returns a grip position for the specified type.

Parameters:

Name Type Description Default
grip_position_type GripPositionType

the type of the desired grip position

required

Returns:

Type Description
GripPosition

the grip position

Source code in core/grip_target_generation/GripTargetFactory.py
56
57
58
59
60
61
62
63
64
65
66
67
68
69
def get_grip_position(self, grip_position_type: GripPositionType) -> GripPosition:
    """Creates and returns a grip position for the specified type.

    Args:
        grip_position_type: the type of the desired grip position

    Returns:
        the grip position
    """
    cs, target = self._get_or_create_target(
        prepare_horizontally=grip_position_type == GripPositionType.PREPARE_SIDE,
        prepare_vertically=grip_position_type == GripPositionType.PREPARE_TOP
    )
    return GripPosition(self, grip_position_type, cs, target)

rotated(self, num_rotations)

Returns a GripTargetFactory which is identical to the current one except the rotation.

Parameters:

Name Type Description Default
num_rotations

the relative number of 90° turns

required

Returns:

Type Description
GripTargetFactory

the rotated factory

Source code in core/grip_target_generation/GripTargetFactory.py
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
def rotated(self, num_rotations) -> 'GripTargetFactory':
    """Returns a `GripTargetFactory` which is identical to the current one except the rotation.

    Args:
        num_rotations: the relative number of 90° turns

    Returns:
        the rotated factory
    """
    return GripTargetFactory(
        face_to_mount=self.face_to_mount,
        num_rotations=self.num_rotations + num_rotations,
        parent=self.parent,
        prepare_offset=self.prepare_offset
    )