Help with Controlling Pololu G2 Motor Driver with Ardusub

I am working on a custom ROV that will be using three brushed thruster motors for control. The motor drivers I have acquired are the Pololu G2 High-Power Motor Driver 24v21 https://www.pololu.com/product/2995

If possible I would like to run the motor controller in locked-antiphase PWM operation (0% duty cycle is full reverse, 50% duty cycle is stopped, 100% duty cycle is full forward). The way I am currently going about it is by editing AP_Motors6DOF.cpp to output the correct PWM signal for locked-antiphase operation of the motor driver. My plan is to set the PWM frequency to 20kHZ (recommended for this motor driver) from the default value, then change the lines of code to set the pulse width output.

This is the code I have changed so far, but I don’t know how to set the PWM frequency to a different value than the default.

int16_t AP_Motors6DOF::calc_thrust_to_pwm(float thrust_in) const
{
     return constrain_int16(25 + thrust_in * 25, 0, 50);
}

My understanding is that these values are in microseconds, so these values should provide the output I am looking for assuming a 20kHz PWM frequency.

I would appreciate it if anyone could help me with altering the PWM frequency from the default, or let me know if there are any flaws with my thought process and/or there are better ways to go about this.

Thanks!