I am trying to fly my Ardupilot drone with Optitrack indoors. I followed the instructions here: Optitrack for Non-GPS Navigation — Copter documentation. The only configuration I could not follow was the EK2_ENABLE to 0 because EK2 does not show up on my mission planner.
I am successfully getting the initial position from Optitrack and I change the mode to ALT_HOLD and arm the throttle successfully but when I try takeoff 3, I either get a Got COMMAND_ACK: NAV_TAKEOFF: FAILED or I don’t get this output but either way my drone never takes off. I don’t think it’s a hardware issue because I can takeoff with my RC controller.
I have also tried taking off in STABILIZE, GUIDED_NOGPS, AUTO, and GUIDED mode but the same issue persists. I read somewhere that I could only take off in GUIDED mode, although this contradicts the instructions for flying indoors; I tried it but I failed the pre-arm check because AHRS is waiting for home. I would appreciate any help to resolve this problem.
Here is the log file: 2 12-31-1979 5-00-00 PM.bin - Google Drive
Hi,
I tried using the setorigin 0 0 0 before arming and taking off but I am still unable to get lift off.
I am sending the takeoff command through the command prompt that pops up when I run MAVProxy.
I set the optitrack code as directed in the documentation, then set the origin. Lastly, I enter in optitrack start to get my position. (I have tried the start before setting the origin as well.) I then enter arm throttle then takeoff 3. I also used a valid long and lat but I didn’t change anything. When I arm the motors spin but takeoff is not successful.
Similar to what @Tristan_Redish suggests, setting the origin is required (setting home is NOT required). It’s best to set origin to a valid location (e.g. where the vehicle actually is) instead of 0,0,0.
To take-off autonomously the vehicle should be in Guided mode.
Re the contradictions in the wiki regarding indoor flight, I suspect it is the Indoor Flying Guidelines page that is causing confusion. I’ll try to clarify this but what your setup requires is the Non-GPS wiki pages.
Thanks for the info. I went through the wikis and made some changes to my setup. I added an extra marker so I have 4 markers on my drone. According to Indoor Flying Guidelines — Copter documentation, I set up GPS1TYPE, FS_THR_ENABLE and FENCE_ENABLE as instructed but BATT_FS_LOW_ACT did not show up on my Mission planner.
According to Non-GPS Navigation — Copter documentation, I tried to set EKF home origin but I got a “No SRTM data for this area”, but I was not too worried about it since I do the setorigin in MAVProxy. Finally for the optitrack specific setup, everything is configured with the exception of EK2_ENABLE as posted originally.
After these changes, I ran MAVProxy, this time I set the origin with the accurate long and lat, I also used the altitude from sea level. I was able to takeoff using a takeoff 1 command but the drone kept rising. The space from my floor to my celing is ~2.5m so I expected the drone to stop after getting to 1m but I didn’t. I also tried setting the origin with a 0m altitude but go the same result.
Am I missing something to stop and hold position when takeoff altitude is reached? PS. I am using guided mode as suggested.
The EKF origin and AHRS home are very different things. It’s OK to set the EKF origin but you should not set the AHRS Home. The difference is explained here on the wiki.
I suspect the issue with the vehicle climbing too high is that the AHRS home was set and the takeoff command is always relative to home.