SITL for fixed-wing and X-Plane

Hi,
I would like to try out pixhawk autopilot firmware using SITL (since I don’t yet have an autopilot for testing) for fixed-wing using X-Plane. I see that there are instructions for X-Plane using HITL, but not for SITL. Is it possible?

I managed to compile the SITL binary and tried to run it using ./px4 but it expects a connection on port 14560. Should QGroundControl initiate this connection or X-Plane? I also could not see anything when opening the HIL Widget on QGC (it is empty). Is that expected?

At the moment there’s a gazebo plane you can use with SITL. make posix_sitl_default gazebo_plane

I’m also interested in X-Plane SITL, but don’t currently know enough about the simulation or X-Plane QGC/HIL interface to implement what’s missing.

Let me know if you’d like to work on SITL X-Plane support.

I do not know either much about how the connection would work. I understand the diagram under SITL directory but the ports do not match what the SITL firmware is expecting, so I’m not sure which connection is missing.

I would imagine that the simulator is expected to connect to the firmware and send HIL_* messages using mavlink in SITL. With HITL with X-Plane, I think it is QGC who connects to the autopilot and to X-Plane, and generates the relevant messages. I think that if QGC could be made to connect to the SITL firmware it should work, but as I mentioned I don’t even see any options in QGC in the HIL Widget.

I think if there was sufficient interest in X-Plane SITL we’d update the PX4 SITL simulation driver to connect directly to X-Plane. Then QGC would connect only to PX4 via UDP. HIL via QGC + X-Plane + Pixhawk was always kind of annoying and awkward.

What about a simple proxy process which would handle X-Plane UDP connection and translate data to MAVLINK messages? Or is there more to it?

Actually, this would seem mostly what I refered to (even better, as an X-Plane plugin):

https://code.google.com/archive/p/lucas-research/wikis/MAVLinkXPlane.wiki?pageId=101682270854530309922

I think it needs some adaptation to how PX4 handles communication (the docs mention TCP, not UDP).

Source available at GitHub:

Just one final comment: I would still be interested in knowing if QGC should support this scenario or not. If anyone else knows, please let me know.