geofikpy package

Copyright (c) 2026 Gerhard Reinerth. All rights reserved.

geofikpy: Python wrapper for GeoFIK C++ library

geofikpy.J_from_q(q: Annotated[collections.abc.Sequence[SupportsFloat | SupportsIndex], 'FixedSize(7)'], ee: str = 'E') Annotated[list[Annotated[list[float], 'FixedSize(6)']], 'FixedSize(7)']

Compute joint configurations from Jacobian

Args:

q (np.ndarray[float]): Joint configurations of shape [7] ee (char, optional): End-effector frame [“E”, “F”, “8”], defaults to ‘E’

Returns:

J (np.ndarray[float, float]): Jacobian of shape [6, 7]

geofikpy.J_to_q(J: Annotated[collections.abc.Sequence[Annotated[collections.abc.Sequence[SupportsFloat | SupportsIndex], 'FixedSize(6)']], 'FixedSize(7)'], R: Annotated[collections.abc.Sequence[Annotated[collections.abc.Sequence[SupportsFloat | SupportsIndex], 'FixedSize(3)']], 'FixedSize(3)'], ee: str) Annotated[list[float], 'FixedSize(7)']

Compute joint configurations from Jacobian

Args:

J (np.ndarray[float, float]): Jacobian of shape [6, 7] R (np.ndarray[float, float]): Rotation matrix of shape [3, 3] ee (char): End-effector frame [“E”, “F”, “8”]

Returns:

q (np.ndarray[float]): Joint configurations of shape [7]

geofikpy.franka_J_ik_q4(r: Annotated[collections.abc.Sequence[SupportsFloat | SupportsIndex], 'FixedSize(3)'], ROE: Annotated[collections.abc.Sequence[SupportsFloat | SupportsIndex], 'FixedSize(9)'], q4: SupportsFloat | SupportsIndex, joint_angles: bool = False, Jacobian_ee: str = 'E', q1_sing: SupportsFloat | SupportsIndex = 1.570796326795) object

Compute IK with q4 locked and compute Jacobian

Args:

r (np.ndarray[float]): position of frame E with respect to frame O. ROE (np.ndarray[float]): Flattened rotation matrix of frame E with respect to frame O (row-first format). q4 (float): joint angle of joint 4 (radians) joint_angles (bool, optional): if false only Jacobians are returned, else the joint angles are also returned, defaults to False Jacobian_ee (char, optional): ee frame of the Jacobian, not the IK (‘E’, ‘F’, ‘8’ or ‘6’), defaults to ‘E’ q1_sing (float, optional): emergency value of q1 in case of singularity at shoulder joints (type-1 singularity)

Returns:
result (tuple[list[list[list[float]]], list[list[float]], int] | tuple[list[list[list[float]]], int]): Returns Jacobians, joint angles and number of solutions if joint_angles is True

else returns Jacobians and number of solutions if joint_angles is False

geofikpy.franka_J_ik_q6(r: Annotated[collections.abc.Sequence[SupportsFloat | SupportsIndex], 'FixedSize(3)'], ROE: Annotated[collections.abc.Sequence[SupportsFloat | SupportsIndex], 'FixedSize(9)'], q6: SupportsFloat | SupportsIndex, joint_angles: bool = False, Jacobian_ee: str = 'E', q1_sing: SupportsFloat | SupportsIndex = 1.570796326795) object

Compute IK with q4 locked and compute Jacobian

Args:

r (np.ndarray[float]): position of frame E with respect to frame O. ROE (np.ndarray[float]): Flattened rotation matrix of frame E with respect to frame O (row-first format). q6 (float): joint angle of joint 6 (radians) joint_angles (bool, optional): if false only Jacobians are returned, else the joint angles are also returned, defaults to False Jacobian_ee (char, optional): ee frame of the Jacobian, not the IK (‘E’, ‘F’, ‘8’ or ‘6’), defaults to ‘E’ q1_sing (float, optional): emergency value of q1 in case of singularity at shoulder joints (type-1 singularity)

Returns:
result (tuple[list[list[list[float]]], list[list[float]], int] | tuple[list[list[list[float]]], int]): Returns Jacobians, joint angles and number of solutions if joint_angles is True

else returns Jacobians and number of solutions if joint_angles is False

geofikpy.franka_J_ik_q7(r: Annotated[collections.abc.Sequence[SupportsFloat | SupportsIndex], 'FixedSize(3)'], ROE: Annotated[collections.abc.Sequence[SupportsFloat | SupportsIndex], 'FixedSize(9)'], q7: SupportsFloat | SupportsIndex, joint_angles: bool = False, Jacobian_ee: str = 'E', q1_sing: SupportsFloat | SupportsIndex = 1.570796326795) object

Compute IK with q7 locked and compute Jacobian

Args:

r (np.ndarray[float]): position of frame E with respect to frame O. ROE (np.ndarray[float]): Flattened rotation matrix of frame E with respect to frame O (row-first format). q7 (float): joint angle of joint 7 (radians) joint_angles (bool, optional): if false only Jacobians are returned, else the joint angles are also returned, defaults to False Jacobian_ee (char, optional): ee frame of the Jacobian, not the IK (‘E’, ‘F’, ‘8’ or ‘6’), defaults to ‘E’ q1_sing (float, optional): emergency value of q1 in case of singularity at shoulder joints (type-1 singularity)

Returns:
result (tuple[list[list[list[float]]], list[list[float]], int] | tuple[list[list[list[float]]], int]): Returns Jacobians, joint angles and number of solutions if joint_angles is True

else returns Jacobians and number of solutions if joint_angles is False

geofikpy.franka_J_ik_swivel(r: Annotated[collections.abc.Sequence[SupportsFloat | SupportsIndex], 'FixedSize(3)'], ROE: Annotated[collections.abc.Sequence[SupportsFloat | SupportsIndex], 'FixedSize(9)'], theta: SupportsFloat | SupportsIndex, joint_angles: bool = False, Jacobian_ee: str = 'E', q1_sing: SupportsFloat | SupportsIndex = 1.570796326795, n_points: SupportsInt | SupportsIndex = 600, n_fine_search: SupportsInt | SupportsIndex = 3) object

Compute IK with q4 locked and compute Jacobian

Args:

r (np.ndarray[float]): position of frame E with respect to frame O. ROE (np.ndarray[float]): Flattened rotation matrix of frame E with respect to frame O (row-first format). theta (float): swivel angle (radians) joint_angles (bool, optional): if false only Jacobians are returned, else the joint angles are also returned, defaults to False Jacobian_ee (char, optional): ee frame of the Jacobian, not the IK (‘E’, ‘F’, ‘8’ or ‘6’), defaults to ‘E’ q1_sing (float, optional): emergency value of q1 in case of singularity at shoulder joints (type-1 singularity)

Returns:
result (tuple[list[list[list[float]]], list[list[float]], int] | tuple[list[list[list[float]]], int]): Returns Jacobians, joint angles and number of solutions if joint_angles is True

else returns Jacobians and number of solutions if joint_angles is False

geofikpy.franka_fk(q: Annotated[collections.abc.Sequence[SupportsFloat | SupportsIndex], 'FixedSize(7)'], ee: str = 'E') Annotated[numpy.typing.NDArray[numpy.float64], '[4, 4]']

Perform forward kinematics

Args:

q (np.ndarray[float]): Joint configurations of shape [7] ee (char, optional)): End-effector frame [“E”, “F”, “8”]

Returns:

T (np.ndarray[float, float]): Transformation matrix of shape [4, 4]

geofikpy.franka_ik_q4(r: Annotated[collections.abc.Sequence[SupportsFloat | SupportsIndex], 'FixedSize(3)'], ROE: Annotated[collections.abc.Sequence[SupportsFloat | SupportsIndex], 'FixedSize(9)'], q4: SupportsFloat | SupportsIndex, q1_sing: SupportsFloat | SupportsIndex = 1.570796326795, q7_sing: SupportsFloat | SupportsIndex = 0) tuple[Annotated[list[Annotated[list[float], 'FixedSize(7)']], 'FixedSize(8)'], int]

Perform IK with q4 locked

Args:

r (np.ndarray[float]): position of frame E with respect to frame O. ROE (np.ndarray[float]): Flattened rotation matrix of frame E with respect to frame O (row-first format). q4 (np.ndarray[float]): joint angle of joint 4 (radians) qsols: array to store 8 solutions q1_sing (float, optional): emergency value of q1 in case of singularity at shoulder joints (type-1 singularity), defaults to PI/2 q7_sing (float, optional): emergency value of q7 in case of singularity of S7 intersecting S (type-2 singularity), defaults to 0

Returns:

result (tuple[list[list[float]], int): Solutions and number of solutions of IK

geofikpy.franka_ik_q6(r: Annotated[collections.abc.Sequence[SupportsFloat | SupportsIndex], 'FixedSize(3)'], ROE: Annotated[collections.abc.Sequence[SupportsFloat | SupportsIndex], 'FixedSize(9)'], q6: SupportsFloat | SupportsIndex, q1_sing: SupportsFloat | SupportsIndex = 1.570796326795, q7_sing: SupportsFloat | SupportsIndex = 0) tuple[Annotated[list[Annotated[list[float], 'FixedSize(7)']], 'FixedSize(8)'], int]

Perform IK with q6 locked

Args:

r (np.ndarray[float]): position of frame E with respect to frame O. ROE (np.ndarray[float]): Flattened rotation matrix of frame E with respect to frame O (row-first format). q6 (np.ndarray[float]): joint angle of joint 4 (radians) qsols: array to store 8 solutions q1_sing (float, optional): emergency value of q1 in case of singularity at shoulder joints (type-1 singularity), defaults to PI/2 q7_sing (float, optional): emergency value of q7 in case of singularity of S7 intersecting S (type-2 singularity), defaults to 0

Returns:

result (tuple[list[list[float]], int): Solutions and number of solutions of IK

geofikpy.franka_ik_q7(r: Annotated[collections.abc.Sequence[SupportsFloat | SupportsIndex], 'FixedSize(3)'], ROE: Annotated[collections.abc.Sequence[SupportsFloat | SupportsIndex], 'FixedSize(9)'], q7: SupportsFloat | SupportsIndex, q1_sing: SupportsFloat | SupportsIndex = 1.570796326795) tuple[Annotated[list[Annotated[list[float], 'FixedSize(7)']], 'FixedSize(8)'], int]

Perform IK with q7 locked

Args:

r (np.ndarray[float]): position of frame E with respect to frame O. ROE (np.ndarray[float]): Flattened rotation matrix of frame E with respect to frame O (row-first format). q7 (np.ndarray[float]): joint angle of joint 7 (radians) qsols: array to store 8 solutions q1_sing (float, optional): emergency value of q1 in case of singularity at shoulder joints (type-1 singularity), defaults to PI/2

Returns:

result (tuple[list[list[float]], int): Solutions and number of solutions of IK

geofikpy.franka_ik_swivel(r: Annotated[collections.abc.Sequence[SupportsFloat | SupportsIndex], 'FixedSize(3)'], ROE: Annotated[collections.abc.Sequence[SupportsFloat | SupportsIndex], 'FixedSize(9)'], theta: SupportsFloat | SupportsIndex, q1_sing: SupportsFloat | SupportsIndex = 1.570796326795, n_points: SupportsInt | SupportsIndex = 500, n_fine_search: SupportsInt | SupportsIndex = 3) tuple[Annotated[list[Annotated[list[float], 'FixedSize(7)']], 'FixedSize(8)'], int]

Perform IK with predefined swivel angle

Args:

r (np.ndarray[float]): position of frame E with respect to frame O. ROE (np.ndarray[float]): Flattened rotation matrix of frame E with respect to frame O (row-first format). theta (np.ndarray[float]): swivel angle (radians) q1_sing (float, optional): emergency value of q1 in case of singularity at shoulder joints (type-1 singularity), defaults to PI/2 n_points (int, optional): number of points to discretise the range of q7, defaults to 500 n_fine_search (int, optional): Number of fine search iterations, defaults to 3

Returns:

result (tuple[list[list[float]], int): Solutions and number of solutions of IK

geofikpy.franka_swivel(q: Annotated[collections.abc.Sequence[SupportsFloat | SupportsIndex], 'FixedSize(7)']) float

Compute swivel angle given joint angles

Args:

q (np.ndarray[float]): joint angles

Returns:

theta (float): swivel angle (radians)