There is a machine that is capable of machining brake rotors on your vehicle. This is the best way to machine rotors, as it eliminates any imperfections in the brake rotors or any runout in the bearing/hub assembly. The smoothest brake jobs I've done have been with one of these tools.
Another reason to employ this tool is when you have what is referred to as a captive rotor. A captive rotor is a rotor held on by the hub assembly. These rotors cannot simply be removed after the wheel and brake caliper have been removed; you also need to remove the hub assembly to remove the brake rotor.
This is often a labor-intensive process. If you or your shop has access to an on-the-car brake lathe, you could machine the rotors right on the vehicle without removing them if there was enough metal left. Early 90s Honda Accords are a good example of a vehicle with captive rotors. Here's a video demonstrating the process of replacing those rotors just so you get an idea of what’s involved in their replacement.
As you can see, it's pretty involved. If you have captive rotors on your vehicle, I strongly urge you to find a shop with an on-the-car brake lathe to handle your warped rotors should you run into that issue. It might save you a ton of time and money.