A gradient sampling method based on ideal direction for solving nonsmooth optimization problems