You don’t need to put anything in the wrapper - it is totally empty, and exists merely to satisfy the library arbitrarily requiring that you give it something to call pidWrite on. You will be using the loop output manually.
You’ve made a good start - to finish, you need to configure the PIDController, and then use its output (via. the get() function) in the else block of your drive code. To do this:
Firstly, your constructor is not quite right - you need to pass the gyro object itself as the source, not its source type. The PIDController will then call pidGet() on it automatically. You will likely need to set the source type of the gyro so that it returns angle, rather than angular velocity - the gyro documentation likely will tell you how to do this.
Secondly, you need to configure the input range of your PIDController. This should be either 0 to 360 or -180 to 180, depending on how your gyro object implements pidGet(). You also will need to set the input range to be continuous (using setContinuous()) - this indicates that the values are on a circle (rather than a line), which is an important property of headings ;). You may also want to configure an output range, but it is not strictly necessary - however, you must configure the input range for a gyro loop to work properly.
You can forego configuring tolerance, as you will not be exiting the loop when you reach your setpoint.
After that’s done, you need to to make some small modifications to your drive code so that it actually uses the output.
Firstly, you should add a “drivingStraight” boolean so you can detect the state change, rather than just the current state - there are some things you want to do explicitly when you transition between turning and driving straight and vice-versa.
When you go from driving straight to turning, you want to disable and reset the PIDController. This will ensure the controller is not running when you don’t need it to (this isn’t so important since it’s not automatically outputting, but is still good practice) and that you don’t “carry over” any accumulated integral error from one instance of driving straight to the next.
When you go from turning to driving straight, you want to enable the PIDController and set the setpoint to the current heading. You must do this on the state change - you cannot simply keep doing this every iteration, or your setpoint will just track your current heading and the loop will be useless.
Finally, you simply need to send pid.get() (this is the output of the controller!) as the turn command in the drive straight portion (I believe this is what you’re currently using joystick twist for in your turning case - I strongly suggest you switch to a two-joystick setup and use the x axis of a second joystick for this in the interest of drivebility), and then you should be good to go. Keep in mind, you might need to negate this value if your gyro angle’s “positive” is not the same as your drive subroutine’s “positive.” You’ll be able to see this, because it will result in an unstable loop.