Disabling Gazebo Odometry Publisher/PX4 Link

Hello,

I’m studying GPS spoofing attacks in a SitL situation, and thus need both the ground truth and the false truth that the drone is sensing. Knowing this, I’m first running the system in Gazebo and I attached a odometry-publisher-system plugin in Gazebo to give the ground truth.

The problem is that this plugin somehow links to the External Vision capability of PX4 as part of the INS, which means that there is now redundant sensors during simulation. This means that even if the system is reading falsified GPS, there are still sufficient true readings for the system to be working normally.

Is there any way to get PX4 to not activate this external vision capability? Or do I need to resort to a different method of finding ground truth (mavros?).

What’s the PX4 version that you’re trying this with and new or classic Gazebo?

New Gazebo, PX4 version of 1.15.

Ok, what about just disabling publishing odometry in the EKF?

https://github.com/PX4/PX4-Autopilot/blob/release/1.15/src/modules/ekf2/EKF2.cpp#L709

Yeah, I ended up just commenting out the fusion link. I was originally unsure if that would be safe to do because I was unsure of the setup I would be using when moving to hardware setup, but it was the most straightforward method and it seemed to work.