PX4 control of Gazebo simulation

I am looking to implement my own controller in the PX4 firmware by replacing position control module in the PX4. I have the controller coded in C++ and it produces the same results as my Matlab simulator which is good. Now, I would like to modify the PX4 firmware and test it in SITL with the Gazebo simulator for my multicopter. I understand the Gazebo is powered by the PX4 but I am wondering what influence do the position, rate, and attitude control modules (mc_pos_control, mc_rate_control, and mc_att_control) have on the gazebo simulator? I recently commented out each control module and sent offboard commands to the multicopter in gazebo. Nothing changed from before so it seems these control modules are doing nothing?

How is the gazebo multicopter being controlled? And is it possible then to even test my controller in gazebo before on hardware?

@ssmith-81 The PX4 user guide explains in detail how the Gazebo simulator is integrated with PX4: Simulation | PX4 User Guide

Hello,
Firstly, do you use QGround Control ? If not, you’d better to install it. it makes it possible to change flight modes.
I have the same path in the presence. I modeled the position control mode in Simulink. But have you managed to map inputs of joystick into the controller and to model the mixer ?
Best regards