Zum Inhalt

GripPositionType

An enum describing the different types of grip positions.

GRIP means directly at the mount ready to grip while PREPARE_TOP and PREPARE_SIDE define position types located a little further away from the cube where it is safe to maneuver.

GRIP

A grip position directly at the mount, ready to grip/release the cube.

PREPARE_SIDE

A preparation position to the side of the mount, used for collision free, linear movement.

PREPARE_TOP

A preparation position above the mount, used for collision free, linear dipping.

get_type(face_to_mount, cube_is_gripped) staticmethod

Returns a reasonable prepare position based on the given parameters.

Parameters:

Name Type Description Default
face_to_mount GripperFace

the face which should be mounted

required
cube_is_gripped bool

flag, indicating whether the cube is currently gripped

required

Returns:

Type Description
GripPositionType

the suiting prepare position type

Source code in core/grip_target_generation/GripPosition.py
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
@staticmethod
def get_type(face_to_mount: GripperFace, cube_is_gripped: bool) -> 'GripPositionType':
    """Returns a reasonable prepare position based on the given parameters.

    Args:
        face_to_mount: the face which should be mounted
        cube_is_gripped: flag, indicating whether the cube is currently gripped

    Returns:
        the suiting prepare position type
    """

    # prepare position type:
    # - gripped cube
    #   - MAIN -> TOP
    #   - Y_POSITIVE -> TOP
    #   - Y_NEGATIVE -> TOP
    #   - GRIPPED_X_POSITIVE -> TOP
    #   - GRIPPED_X_NEGATIVE -> TOP
    # - released cube
    #   - MAIN -> TOP
    #   - Y_POSITIVE -> SIDE
    #   - Y_NEGATIVE -> SIDE
    #   - GRIPPED_X_POSITIVE -> SIDE
    #   - GRIPPED_X_NEGATIVE -> SIDE


    prepare_grip_position_type = GripPositionType.PREPARE_SIDE
    if face_to_mount == GripperFace.MAIN or cube_is_gripped:
        prepare_grip_position_type = GripPositionType.PREPARE_TOP
    return prepare_grip_position_type

GripPosition

A class representing a specific position relative to the mount.

Attributes:

Name Type Description
target_factory GripTargetFactory

the factory which created this position

grip_position_type GripPositionType

the type of this position

relative_grip_coordinate_system spatial.CoordinateSystem

the coordinate system describing this position in respect to the targets parent (usually the mount)

target robolink.Item

the created target associated with this position

target_name str

the name of the target (used for debugging and pickling)