Skip to content

MOVE_LIN_REL_TRF

The MOVE_LIN node linearly moves the robot's tool to an absolute Cartesian position relative to the robot's tool reference frame which is set by the SET_TRF node. Inputs ------ ip_address: String The IP address of the robot arm. Params: x : float The x coordinate of the position to move to y : float The y coordinate of the position to move to z : float The z coordinate of the position to move to alpha : float The alpha coordinate (rotation in radians about the x axis) of the position to move to. beta : float The beta coordinate (rotation in radians about the y axis) of the position to move to. gamma : float The gamma coordinate (rotation in radians about the z axis) of the position to move to. Returns: out : String The IP address of the robot arm.
Python Code
from flojoy import flojoy, String
from PYTHON.utils.mecademic_state.mecademic_state import query_for_handle
from PYTHON.utils.mecademic_state.mecademic_helpers import safe_robot_operation


@safe_robot_operation
@flojoy(deps={"mecademicpy": "1.4.0"})
def MOVE_LIN_REL_TRF(
    ip_address: String,
    x: float,
    y: float,
    z: float,
    alpha: float = 0,
    beta: float = 0,
    gamma: float = 0,
) -> String:
    """
    The MOVE_LIN node linearly moves the robot's tool to an absolute Cartesian position relative to the robot's tool reference frame which is set by the SET_TRF node.

    Inputs
    ------
    ip_address: String
        The IP address of the robot arm.

    Parameters
    ----------
    x : float
        The x coordinate of the position to move to
    y : float
        The y coordinate of the position to move to
    z : float
        The z coordinate of the position to move to
    alpha : float
        The alpha coordinate (rotation in radians about the x axis) of the position to move to.
    beta : float
        The beta coordinate   (rotation in radians about the y axis) of the position to move to.
    gamma : float
        The gamma coordinate (rotation in radians about the z axis) of the position to move to.

    Returns
    -------
    String
        The IP address of the robot arm.

    """
    robot = query_for_handle(ip_address)
    robot.MoveLinRelTRF(x=x, y=y, z=z, alpha=alpha, beta=beta, gamma=gamma)
    robot.WaitIdle()
    return ip_address

Find this Flojoy Block on GitHub

Example

Having problems with this example app? Join our Discord community and we will help you out!
React Flow mini map

In this example, the MOVE_LIN_REL_TRF node moves the robot arm in a straight line to a specified Cartesian position.

The node takes in the x, y, and z coordinates, along with optional alpha, beta, and gamma rotations in radians.

After initiating the linear movement, the node waits for the robot arm to become idle, indicating that the movement is complete.

The MOVE_LIN_REL_TRF node is useful in workflows where linear movements are required, such as drawing a straight line or moving from one point to another in a straight path.