Skip to content

Ardupilot with airsim: Error while receiving rotor control data #4492

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Kevinlibaba opened this issue Apr 21, 2022 · 11 comments
Open

Ardupilot with airsim: Error while receiving rotor control data #4492

Kevinlibaba opened this issue Apr 21, 2022 · 11 comments
Labels
ardupilot bug-report for issues filed as bug reports

Comments

@Kevinlibaba
Copy link

Kevinlibaba commented Apr 21, 2022

Bug report

  • AirSim Version/#commit:Binary 1.7.0
  • UE/Unity version:N/A
  • autopilot version:master
  • OS Version:Ubuntu 18.04

What's the issue you encountered?

When I run the binary with ArduCopter's setting, an error was occurred as follows:

[2022.04.21-06.56.16:031][  0]LogStaticMesh: Allocated 512x387x128 distance field atlas = 48.4Mb, with 220 objects containing 33.5Mb backing data
Error while receiving rotor control data - ErrorNo: -1
[2022.04.21-06.56.16:108][  0]LogTemp: Error while receiving rotor control data - ErrorNo: -1
Error while receiving rotor control data - ErrorNo: -1
[2022.04.21-06.56.16:208][  0]LogTemp: Error while receiving rotor control data - ErrorNo: -1
[2022.04.21-06.56.16:217][  0]LogContentStreaming: Texture pool size now 1000 MB
Error while receiving rotor control data - ErrorNo: -1
[2022.04.21-06.56.16:309][  0]LogTemp: Error while receiving rotor control data - ErrorNo: -1
[2022.04.21-06.56.16:407][  0]LogVulkanRHI: Creating new VK swapchain with present mode 0, format 44, color space 0, num images 3
Error while receiving rotor control data - ErrorNo: -1
[2022.04.21-06.56.16:410][  0]LogTemp: Error while receiving rotor control data - ErrorNo: -1
Error while receiving rotor control data - ErrorNo: -1
Error while receiving rotor control data - ErrorNo: -1
Error while receiving rotor control data - ErrorNo: -1
Error while receiving rotor control data - ErrorNo: -1

How can the issue be reproduced?

1.Set the 'VehicleType' in settings to ArduCopter/ArduRover, and run airsim with binary. the error will be occurred.
2.If set the 'VehicleType' back to SimpleFlight", anything went to well.

Include full error message in text form

see log file.

Settings

my setting.json is as follows (from here):

{
  "SettingsVersion": 1.2,
  "LogMessagesVisible": true,
  "SimMode": "Multirotor",
  "OriginGeopoint": {
    "Latitude": -35.363261,
    "Longitude": 149.165230,
    "Altitude": 583
  },
  "Vehicles": {
    "Copter": {
      "VehicleType": "ArduCopter",
      "UseSerial": false,
      "LocalHostIp": "127.0.0.1",
      "UdpIp": "127.0.0.1",
      "UdpPort": 9003,
      "ControlPort": 9002
    }
  }
}

@jonyMarino jonyMarino added ardupilot bug-report for issues filed as bug reports labels May 2, 2022
@samuelctabor
Copy link

Are you running both on Linux? For using on Windows with Ardupilot on a separate machine or in WSL2 you'll need some settings changes.

@Kevinlibaba
Copy link
Author

Kevinlibaba commented May 23, 2022

Are you running both on Linux? For using on Windows with Ardupilot on a separate machine or in WSL2 you'll need some settings changes.

@samuelctabor Thanks, Yes, both are running on Ubuntu 18.04

@talha-opteran
Copy link
Contributor

I believe the AirSim binary is waiting for a response from Ardupilot. If you run Ardupilot, it should resume. Usually the execution order is Ardupilot and then AirSim.

@dimikout3
Copy link

dimikout3 commented Sep 29, 2022

I have recently encountered the same problem. A quick fix is changing the UdpPort and ControlPort

{
  "SettingsVersion": 1.2,
  "LogMessagesVisible": true,
  "SimMode": "Multirotor",
  "OriginGeopoint": {
    "Latitude": -35.363261,
    "Longitude": 149.165230,
    "Altitude": 583
  },
  "Vehicles": {
    "Copter": {
      "VehicleType": "ArduCopter",
      "UseSerial": false,
      "LocalHostIp": "127.0.0.1",
      "UdpIp": "127.0.0.1",
      "UdpPort": 5760,
      "ControlPort": 5760
    }
  }
}

However, when the AirSim is started the quadcopter just increase its vertical speed constantly, so you can not really control it.

@crose72
Copy link

crose72 commented Jul 20, 2023

Are you running both on Linux? For using on Windows with Ardupilot on a separate machine or in WSL2 you'll need some settings changes.

Can you expand on this? I'm using WSL2 Ubuntu-20.04 and I've followed the instructions but I'm seeing the same error message.

@WangLouis
Copy link

Test environment:
Windows 11 Pro build 22000.708,
running Ubuntu 22.04LTS under WSL2.
Installed Unreal Engine v4.27.2 via Epic Games Launcher.
Complied AirSim under Visual Studio 2022 (Community) , and ArduPilot in WSL2 with waf.

same issue
1.Set the 'VehicleType' in settings to ArduCopter, and run airsim with binary. the error will be occurred.
2.If set the 'VehicleType' back to SimpleFlight", anything went to well.

Has anyone solved the problem? Thanks

@crose72
Copy link

crose72 commented Jul 29, 2024

@WangLouis @Kevinlibaba try this: https://discuss.ardupilot.org/t/gsoc-2019-airsim-simulator-support-for-ardupilot-sitl-part-ii/46395/29?u=crose4

I had this problem for 2 years which kept me from using AirSim with WSL2. Getting the ip address of WSL2 and windows like the post suggests is what solved it for me. Hope it helps!

@WangLouis
Copy link

@crose72
thank you for your help~ but i can't solved it.

1.When i use ip address of WSL2 , It is error
https://www.youtube.com/watch?v=YJyt5aou1rI

2.'VehicleType' back to SimpleFlight", anything went to well.
https://www.youtube.com/watch?v=MqZPbHv2HoQ

3.Set the 'VehicleType' in settings to ArduCopter, the error will be occurred.
https://www.youtube.com/watch?v=G8It1qr6jrk

Should AirSim be executed first or WSL2 SITL be executed first? Thank you

@WangLouis
Copy link

@crose72

That worked, I got it , thank you so much!

“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.
AirSim be executed first.
WSL2 Ardupilot SITL be executed second.

@crose72
Copy link

crose72 commented Aug 6, 2024

@crose72

That worked, I got it , thank you so much!

“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.
AirSim be executed first.
WSL2 Ardupilot SITL be executed second.

Sorry I didn't get back to you earlier. I'm glad you've got it now! Your settings and process look correct.

@valeriavalery
Copy link

I have recently encountered the same problem. A quick fix is changing the UdpPort and ControlPort

{
  "SettingsVersion": 1.2,
  "LogMessagesVisible": true,
  "SimMode": "Multirotor",
  "OriginGeopoint": {
    "Latitude": -35.363261,
    "Longitude": 149.165230,
    "Altitude": 583
  },
  "Vehicles": {
    "Copter": {
      "VehicleType": "ArduCopter",
      "UseSerial": false,
      "LocalHostIp": "127.0.0.1",
      "UdpIp": "127.0.0.1",
      "UdpPort": 5760,
      "ControlPort": 5760
    }
  }
}

However, when the AirSim is started the quadcopter just increase its vertical speed constantly, so you can not really control it.

Hi! I have the same problem... I changed the ports but after that the quadcopter started to increase its vertical speed... do you know how can I solve?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ardupilot bug-report for issues filed as bug reports
Projects
None yet
Development

No branches or pull requests

8 participants