def plan_exists(plan):
    """This function can be used to check if a plan trajectory was computed.

    Parameters
    ----------
    plan : :py:obj:`!moveit_msgs.msg.RobotTrajectory`
        The computed robot trajectory.

    Returns
    -------
    :py:obj:`bool`
        Bool specifying if a trajectory is present
    """

    # Check if a trajectory is present on the plan object
    if not all(
        [
            not (
                len(plan.joint_trajectory.points) >= 1
            ),  # True when no trajectory was found
            not (
                len(plan.multi_dof_joint_trajectory.points) >= 1
            ),  # True when no trajectory was found
        ]
    ):
        # A trajectory was found
        return True
    else:

        # No trajectory was found
        return False