PX4 SITL with Simulink/Gazebo

Hello everyone,

I have an FDM in simulink that i want to simulate in SITL with px4 and QGroundControl. I found a working connector that can be used to interface simulink with px4 (Pixhawk software-in-the-loop (SIL) connector for Simulink - File Exchange - MATLAB Central).
However I am running into some problems.

I was wondering if I can simulate my model in gazebo and connect it to px4. How can I achieve that? I am aware of the already available gazebo models that can be run in SITL with px4 using px4_sitl gz_name_of_model. My question is, how can i do it with my custom model. The model is of a tailsitter and dyanmics are non-linear. In simulink I am using a 6DOF model with non-linear coefficients computed using CFD (against speed and angle of attack). However gazebo LiftDrag Plugin assumes a linear model.

Any help regarding these issues will be highly appreciated.

I’m also trying that right now, kinda failing but still trying.
A developer in discord shared with me two links (they added “mono cam” to the repo).

that will give you a starting point:

[take a look at these two PRs which adds a model and the associated airframe file, along with a new world [gz] X500 mono_cam_down and aruco world by dakejahl · Pull Request #23450 · PX4/PX4-Autopilot · GitHub
Downward mono cam + aruco tag by dakejahl · Pull Request #48 · PX4/PX4-gazebo-models · GitHub]

I have been build a new UAV by gazebo and I fly it by px4 simulation a few years. you have to change LiftDrag Plugin, see GitHub - mengchaoheng/DuctedFanUAV-Autopilot: This is an autopilot for DFUAV, forked from PX4-Aotupilot, supports gazebo simulation (ubuntu/macOS), and has been flight tested on DFUAV equipped with pixhawk.