GSoC 2019: AirSim Simulator Support for ArduPilot SITL Part II

Yeah, so this does work for me. Steps I followed -

  1. Add UE4Editor.exe to an allowed rule, see https://github.com/mahmoudajawad/wsl-hacks/blob/master/wsl2-networking.md
    The .exe file can be found in Engine/Binaries/Win64 in the folder where UE has been downloaded
    If using a pre-built environment, add the corresponding .exe file in the rule

  2. Added the following in my .profile

export WSL_HOST_IP=$(ipconfig.exe | awk '/WSL/ {getline; getline; getline; getline; print substr($14, 1, length($14)-1)}')
export DISPLAY=$WSL_HOST_IP:0
  1. In settings.json, set the IP addresses-
"LocalHostIp": "0.0.0.0",
"UdpIp": "192.168.179.223",

UdpIp is the IP address of Ubuntu 18.04 running under WSL, using ip addr show eth0

  1. I’m using XLaunch for the X11 windows, in that I added -ac as additonal argument, see https://github.com/microsoft/WSL/issues/4106

  2. Launching SITL - sim_vehicle.py -v ArduCopter -f airsim-copter -A --sim-address=$WSL_HOST_IP

So many things are needed since the address spaces are different in WSL 2 rather than the same on WSL 1. Should add to the Wiki as well, after some more testing or checking if steps can be reduced

2 Likes