GSoC 2019: AirSim Simulator Support for ArduPilot SITL Part II

Same issue here…
Tried WSL 1 & 2. Even tried using a VM with no success.
If i use 0.0.0.0 or windows ip as LocalHostIp in the settings.json, airsim just freezes once it opens.
switching to 127.0.0.1 loads the graphics with no response.
same message from sitl:
“no sensor message received in last 1s, error - bad file descriptor, resending servos”

I get a similar error message with slight variation. “No sensor message received in last 1s, error - Resource temporarily unavailable, resending servos”

Using Colosseum. Latest Windows 11. UE5.2.1.

image

In the settings file, I set the LocalHostIp to 0.0.0.0 and UdpIp to the ip found with ip addr show eth0 (one starting after “brd”).

Added “export WSL_HOST_IP=$(cat /etc/resolv.conf | grep nameserver | awk ‘{print $2}’)” to .profile.

Hi @iampete . I am trying to make this work but unable to do it. Do u have any suggestions? Im unable to connect sitl to Airsim (I followed the steps as suggested by rajat2004). But still says connection refused.

1 Like

were you able to resolve this issue ? facing same issue

1 year ago, I found rajat2004 comment and follow with great success.
but recently, when i revisit airsim and try connect airsim with ardu pilot (because i’m unemployed :smile: ), i ran into the problem again, not sure why??
→ But, rajat2004 comment still supper helpful to me, I follow the step in follow the steps in https://github.com/mahmoudajawad/wsl-hacks/blob/master/wsl2-networking.md specifically these step

, and then restart wsl and i sucessful connect ardu pilot and airsim

  • In 1 year, i haven’t pulled new code from ardu pilot, i still use airsim on unreal 4.27.2, but i updated window 11 alot, so i think one of those updates cause problem
  • Hope this comment can help
  • fly on :flags:

What worked for me is to tell Airsim and SITL explicitly which IP addresses to use. I didn’t use rajat2004 fix.
So your C:\Users\YourUsername\Documents\AirSim\settings.json looks like this:
{
“SeeDocsAt”: “AirSim/docs/settings.md at main · microsoft/AirSim · GitHub”,
“SettingsVersion”: 1.2,
“LogMessagesVisible”: true,
“SimMode”: “Multirotor”,
“OriginGeopoint”: {
“Latitude”: 37.334947,
“Longitude”: -122.012715,
“Altitude”: 583
},
“Vehicles”: {
“Copter”: {
“VehicleType”: “ArduCopter”,
“UseSerial”: false,
“LocalHostIp”: “192.168.0.85”, ← this is IP of your main Windows
“UdpIp”: “172.26.240.75”, ← this is IP of your Linux(Ubuntu) under WSL2.
“UdpPort”: 9003,
“ControlPort”: 9002
}
}
}

And you run your SITL under WSL2 by this command:
sim_vehicle.py -v ArduCopter -f airsim-copter --console --map --sim-address=192.168.0.85

It worked on Colosseum fork of Airsim on UnrealEngine 5.4 (after fixing build errors). But I guess it should work on older UE versions (5.2 is last officially supported) as well.

2 Likes