def get_body_world_transform(robot, body_name, use_theoretical_model=True):
    """
    @brief Get the transform from world frame to body frame for a given body.

    @details It is assumed that update_quantities has been called.

    @param  robot           The jiminy robot
    @param  body_name       The name of the body
    @return transform       Object representing the transform

    @pre body_name must be the name of a body existing in model.
    """
    if use_theoretical_model:
        pnc_model = robot.pinocchio_model_th
        pnc_data = robot.pinocchio_data_th
    else:
        pnc_model = robot.pinocchio_model
        pnc_data = robot.pinocchio_data
    return pnc_data.oMf[pnc_model.getFrameId(body_name)]
