Quadcopter Not Taking Off in Airsim Simulation
I have gotten the Airsim environment up and running on linux, but I am unable to make the quadcopter take off. I have followed every step on the Airsim tutorial, and all my software for the Unreal Engine, Airsim, Pixhawk, and Ubunutu is up to date to the tutorial specifications. First, I attempted to use a controller to fly the quadcopter; the controller would be able to arm the quadcopter, but when I thrusted up, nothing would happen. Upon checking the RC inputs on QGroundControl and calibrating the settings multiple times, there was no change in the simulation. With the controller not working, I attempted to use DroneShell to test out different commands, but I ran into the same issues. I was able to arm the quadcopter, but taking off did not work. I either got drone hasn't came [sic] to expected z of -3.000000 within time 15.000000 sec within error margin or rpclib: function 'takeoff' (called with 1 arg(s)) threw an exception when I prompted the "takeoff" command. Using the "getimage" command did save pictures to the Airsim folder (which I verified), so I know the Unreal Simulation is able to connect with the DroneShell. I also observed that using the "disarm" command did not make the propellers stop spinning. Does anybody know if I am doing something wrong, and how to fix the errors?
You seem to be experiencing the exact same problems I reported in issue #85. Just pulled and built the latest AirSim version to test this again, and I can confirm the issues persist. GetImage works fine, takeoff throws the same error you mention. I too wait for a solution ;)
I added some documentation in sitl.md under Check the Home Position before trying to takeoff, can you check if that is the issue you are running into here?
I am getting the same error as above using the actual PixHawk Hardware. Could it be an issue with how it is set up with QGroundControl? I followed all the steps in the tutorial and its firmware is up to date so I do not know what could be causing this issue.
When you run DroneShell.exe does it get past the "waiting for GPS location" step ? if not I'm guessing your forgot to put your PX4 in HIL mode by selecting "HIL Quadrocopter X" in QGroundControl. Also, please try the latest PX4 firmware (ignore my video that says version 1.4.4). Use 1.6.0 instead.
I was looking at the qgroundcontrol and it kept saying the accel, mag, and gyro calibration failed. I looked it up online and it's not showing me any solutions, so that may be our problem. I ran unreal and drone shell and saw that it was getting past the step of getting the gps location. Additionally I am running the latest PX4 firmware (1.6.0 px4fmu-v2_default.px4).
Sounds like you need to select the simulation AirFrame as shown below:

@lovettchris we already selected the HIL Quadcopter X
Can you paste a screen shot of the Unreal simulator, you should see some text in the top left that looks like this:


It says "taking off Detected" but the Quad never takes off. We get the same error when using Drone Shell in addition to Drone Shell spitting out ("drone hasn't came [sic] to expected z of -3.000000 within time 15.000000 sec within error margin or rpclib: function 'takeoff' (called with 1 arg(s)) threw an exception")
How come the drone looks ghosted and has no shadow? Is the drone under the ice? Mine looks like this:

It is not under the ice, I am using reduced graphics settings so it does not display the shadow of the quad. What should the altitude typically be for this map? I read that this simulator uses the NED frame so should z initially be positive or close to 0? When I type position on drone shell, it displays Local position: x=0.0410362, y=-0.117092, z=11.0654 Global position: lat=47.6415, lon=-122.14, alt=127.71
The z coordinate is a little high (NED coordinate system has negative z when drone is above ground). This is what I get :
position: x=0.00353828, y=0.0042316, z=1.02402 Global position: lat=47.6415, lon=-122.14, alt=122.276
Does your drone do a little freefall before hitting the ground when you hit Play ? Are you getting no movement at all ? Can you also try "movetoposition -z -20" ?
Yes it does do a free fall after we hit the play button but afterwards the drone does not take off at all (even when I type "movetoposition -z -20" . Additionally when I turned the graphics to maximum I see a shadow so I know the quad is not inside the ice. I moved the player start to a different location and when I type "pos" on DroneShell it says z = 0.271578 which is more reasonable than the previous position I was getting.
Ok, try and lower your PlayerStart actor in the UE editor a little bit so the freefall is minimized.
I just checked in a fix that might help with the case where local position 'z' coordinate is unusually high, please pull latest bits and try again.
Actually, just found a proper fix, please try again...
I updated to most current commit, and I am running the simulator on windows. As you can see from the pictures, it is displayed that drone is armed and taking off, but the drone itself is not going anywhere. Using "movetoposition -z -20" seems to be making no difference also. Do you know any more solutions to this issue?
There is a "CPU" setting under Edit/Editor Preferences, search for "CPU" and uncheck the box labelled "Use Less CPU when in Background".
Also, can you attach the PX4 log file mentioned when you ARM the drone, the above shows the path "/fs/microsd/log/sess021", you can download the log from PX4 using QGroundControl, or you can use the "get" command in MavLinkTest.exe, like this:
get /fs/microsd/log/sess021/* d:\temp\logs
Then zip the appropriate log and attach it to this issue...
I used QGroundControl to save the log. When I opened QGroundControl though, the display was showing the drone was fluctuating between manual and arm mode before I put in any commands. After attempting to arm the drone, the display on QGroundcontrol was fluctuating between land, takeoff, disarm. The log file I posted is of those occurrences.
This is the QGroundControl mavlink log, it is good, but I was looking also for the PX4 log (PX4 has an sdcard with it's own logs) which you can download using QGroundControl using this toolbar button:
, then click
on the right side, to see the logs, pick the most recent one and download it.
This QGroundControl mavlink log is interesting it does show the following telling status messages:
no RC
failsafe mode on
If this is the problem (you have no RC) then you can tell PX4 to ignore that problem by setting the following PX4 parameters:
NAV_RCL_ACT 0
You can use QGroundControl to set this parameter, the value zero means "disabled":
