A spacecraft is set to launch on a mission to nudge an asteroid off course.