Change gz-sim source code and have px4 run the correct custom gazebo build?

I’m trying to modify Gazebo’s source code from the gz-sim repo and rebuild it to run with make px4_sitl gz_r1_rover using my custom build. After following the Source Install from Gazebo, my changes aren’t appearing in the simulation, suggesting it’s still using the standard Gazebo installation. Is there an environment variable I need to set to make PX4 use my local Gazebo build?

This is important for a gz-sim PR I’m planning, to update the mecanum plugin for individual wheel control, in addition to the current body (x,y) and angular (z) velocity controls, as the PX4 side will manage inverse kinematics.

Where did you put the plugin? And how is it failing?

I used the joint velocity control plugin, the JointController plugin with the normal differential drive r1 rover just to test. What I did was, I hardcoded the joint velocity output to always be 0 in the plugin and it should be printing some comments I added but it was neither not driving nor was anything getting printed. This lead me to the conclusion that PX4 was using the wrong build.

What I actually want to accomplish is what I have started on this branch, but I don’t have the PX4 side ready, hence why I tested with the diff drive: