Flying Anafi indoors causes random yawing

Hi,

I recently tried to fly an Anafi drone using both Olympe and using the FreeFlight app. Outdoors the drone works great. However, as soon as I am indoors, the drone starts to yaw. I ran the script below, which requested the drone to move left and right 1m continuously. You can see I don’t send any yaw commands. However, during this test, the drone yawed randomly.

# -*- coding: UTF-8 -*-

import olympe
from olympe.messages.ardrone3.Piloting import TakeOff, moveBy, Landing

drone = olympe.Drone("192.168.42.1")
drone.connection()
drone(TakeOff()).wait()
drone(moveBy(0,  1, 0, 0)).wait()
drone(moveBy(0, -1, 0, 0)).wait()
drone(moveBy(0,  1, 0, 0)).wait()
drone(moveBy(0, -1, 0, 0)).wait()
...
drone(Landing()).wait()
drone.disconnection()

Reading through the forums, I found this question, which had similar problems. @Maxime replied stating: “Indoors the lighting, the ground reflection and its uniformity can induce a drift”. To reduce the possibility that a uniform ground pattern causes the yawing, I taped patterns on the floor using black duct tape. However, doing this did not change the behavior of the drone, and it still yawed without me sending yaw commands.

I ran more tests to try and figure out what exactly was causing the issue, and I think I have narrowed it down to bad compass readings. This video is a test I ran indoors where I hold the cage and then using the FreeFlight app display the compass readings. As I hold the drone and walk towards the north, you can see that the direction of north changes.

My questions are:

  1. Is there a way to fix the compass readings, either by turning them off or feeding them new data?
  2. Does the Anafi drone use a down-facing camera as part of its localization algorithm (i.e., why didn’t marking the floor help?). If it does use a down-facing camera, should I do something specifically in the Olympe code to activate it?

Any advice on the matter would be appreciated :slight_smile:

Hi,

If you fly indoor a building made with steel (steel building, steel frame building, reinforced concrete building, …) the compass sensor readings may not be accurate/usable.

There is currently no way to disable a sensor or to feed external data into the sensors readings.

Anafi use its down-facing “vertical” camera as part of its localization algorithm. A floor with a non-repeating texture (grass for example) works best. A translucent, uniform or repeating texture floor (a giant checkerboard for example) may invalidate the speed readings from the vertical camera.

No, there is nothing to do from Olympe the vertical down-facing camera is always activated.

The drone firmware is already filtering out invalid sensors readings (compass, vertical camera, barometer, …) and doesn’t get fooled easily. The loss of valid compass sensor readings when flying indoor may deteriorate the precision of the drone heading control. That would be expected and I don’t think there is something simple we could do to improve the drone behavior in this case. The real question is does the drone gets completely fooled by the compass? Can you quantify the drone “yawing” during your test?

1 Like

Thanks for the quick and detailed response @ndessart. From your response, I tried two things:

The first thing was I cluttered the floor of the indoor area (6m X 6m X 2.5m) with random objects of different sizes, colors, shapes (I took all the junk I could find and put on the floor). I used the FreeFlight app and the Anafi controller and flew around inside. The cluttered floor seemed to help a little, but as soon as I got near a metal cabinet or a wall (which I assume has some metal in it), the drone started yawing again. To quantify the amount of yaw, flying at a height of 1.8m, I used roll and pitch commands to trace a square along the edge of the indoor area. After completing 1 lap of the square, the Anafi drone yawed a complete 360 degrees, despite me never giving any yaw commands (I only gave roll and pitch commands).

The second thing I came up with was a mechanical way to nullify any false sensor readings from the compass. I took a small magnet I had lying around and taped it to the back of the drone. Repeating the same square test I did above, the drone performed flawlessly and had no yawing issues. This again leads me to believe that the compass is at fault. The downside to this is that after each flight, the drone wants to do magnetometer calibration, and any yaw commands I send it are pretty unresponsive (it yaws really slowly even when I have the controllers yaw stick all the way to the left or right).

I love the Anafi, but I guess this issue comes down to the Anafi not being designed to be flown indoors with so many metal objects around it (resulting in a weak GPS and noisy compass readings).

Any suggestions, thoughts, or comments on anything above would be appreciated. My goal is to be able to have the Anafi fly indoors as it would outdoors. Thanks again for the help so far :slightly_smiling_face:

Hi Carl,

I just got the confirmation that this is actually a known issue and we are already working on a fix to ignore the compass readings automatically when flying near a steel structure. I’ll try to get back to you when I’ll have more information on this. I think that this fix should land in a future firmware update in a couple of months from now.

It could be nice to disable the compass/calibration with the SDK but unfortunately currently this is not possible. I’ll submit this feature idea for a future SDK release.

I’m glad you’ve found this clever workaround with the magnet but that doesn’t solve the magnetometer calibration problem anyway. I am afraid you will have to wait for a firmware release that fixes this issue.

2 Likes