Beispiel #1
0
def parse_from_halcon(hstring):
    """\
    Convert tuple data in string format from HALCON into the camera ID and
    target pose.

    @param hstring: The string data from HALCON.
    @type hstring: C{str}
    @return: Camera ID and target pose.
    @rtype: C{str}, L{Pose}
    @raise ValueError: String is malformed.
    """
    hstring = hstring.split(',')
    camera = hstring.pop(0)
    pose = parse_pose_string(','.join(hstring))
    return camera, pose
Beispiel #2
0
def parse_from_halcon(hstring):
    """\
    Convert tuple data in string format from HALCON into the camera ID and
    target pose.

    @param hstring: The string data from HALCON.
    @type hstring: C{str}
    @return: Camera ID and target pose.
    @rtype: C{str}, L{Pose}
    @raise ValueError: String is malformed.
    """
    hstring = hstring.split(',')
    camera = hstring.pop(0)
    pnum = int(hstring.pop(0))
    try:
        pose = A.Pose(R=A.Rotation.from_axis_angle(pi, A.Point((1, 0, 0)))) + parse_pose_string(','.join(hstring))
    except:
        pose = None
    return camera, pnum, pose