def update_controls(control, perturbations, brake=False):
    """
    Update controls with the perturbed values

    Args:
        control: original control values to be updated
        perturbations: perturbed control values
        brake: whether to update brake or not

    Returns:
        control: updated perturbed controls
    """
    control.steer = perturbations.steer
    control.throttle = perturbations.throttle
    if brake:
        control.brake = perturbations.brake

    return control