Impulsive control of underactuated mechanical systems