HITL Simulation (X-Plane): Can 2 separate computers be used?

#1

I want to run X-Plane 10 on a separate dedicated Windows 10 PC and run QGC (HITL mode) on my Ubuntu 18.04 LTS machine. I want to connect the two machines using an Ethernet cable.

Are there anything I should be well aware of while trying to do this?

#2

I wanted to do something similar: jMavSim on Windows, and the firmware in SITL on Raspberry Pi. There is more info on slack.

Here were the instructions to launch:

  1. Launch Jmavsim with: java -Djava.ext.dirs= -jar jmavsim_run.jar -tcp droneIP:4570 -lockstep
  2. Launch the px4_sitl with: make px4_sitl_default none
  3. Launch mavlink-routerd with: mavlink-routerd -t 4560 -p Jmavsim-machine-IP:4570

You can use mavlink-routerd to open additional ports to connect QGC for example.

#3

Pardon my ignorance but all that seems a lot more sophisticated than what I am trying to do. Don’t get me wrong, I’m glad that you shared all that. I get to try and learn that now.

What I was thinking about doing is something like this:

From X-Plane side, I can send and receive UDP messages from another computer using an Ethernet cable. What I am uncertain about is if QGC can be directed to sending/receiving the UDP messages through that same ethernet connection.

I am looking at the manual for the QGC HITL here. I don’t even see the setup for any communication using a remote IP.

#4

I found my answer!

Yes! It is totally possible to do what I intended to do. I just hooked everything up and tested. It works!

QGC did have this:

I am writing this instruction only in case some other user is trying to do the same thing as I did:

  1. To avoid confusion, turn off your wifi during this set up.
  2. Hook up your Ubuntu machine and the Windows 10 machine using the ethernet cable.
  3. Go to your windows Network and Sharing Center. Under “Connections” it should show you the “Ethernet” one. Click on it to reveal Ethernet Status. At the bottom of that, click on “Properties”.
  4. There you’ll see something like this:

Click on the IPv4 and then click on “Properties” (highlighted).
4. In the properties thing that opens, Click on “Use the following IP address” and enter a meaningful IP (ex. 192.168.253.1) and enter 255.255.255.0 for the Subnet mask. Then click “OK” at the bottom of this properties section.
5. On your Ubuntu machine, go to your Network settings and pick Wired connections. In the settings for the wired connections, go to IPV4 and select Manual.
6. For Address, enter an IP differenet from the one you entered on the windows machine (ex. 192.168.253.2) and for netmask, enter the same 255.255.255.0. Then click “Apply”.

Now you should be able to test the connection by typing “ping 192.168.253.x” from the terminal or command line (based on which machine you are using. If you are on the windows machine, replace the x in the IP with 2 and if you are on Ubuntu, replace it with 1. The point here is that you are meant to ping the IP address of the other machine. In my example, the Ubuntu one’s address is 192.168.253.2 and the Windows machine’s IP is 192.168.253.1.

Once that is set up, just follow this guide to make sure you are setting up QGC properly for the HITL simulation. Also, remember to pick the right IP address on the HIL config window on QGC. You have to change the “127.0.0.1” to the IP addresss of the computer that is running the X-Plane simulation.