We are currently working on a project to get the drone to fly autonomously indoors. We are using the Ardupilot flight controller firmware that came with the .iso image, so everything is updated as per the Github instructions. We are using Dronekit to send attitude commands to the flight controller in Guided_No_GPS mode. We have installed a downward-facing LeddarOne LiDAR to give accurate height estimates to the flight controller and put a 2D RPLiDAR on top of the drone to give horizontal position estimates using a SLAM algorithm. Currently, we are able to maintain a stable horizontal position, but after hovering well for about 15 seconds, the drone will yaw left and suddenly drop in altitude. This drop makes the whole system unstable. We have run several tests sending yaw attitude commands to see the behavior of the drone. When a yaw command is sent to have the drone yaw left, the drone starts dropping in altitude right away. When told to yaw right, the drone starts yawing right without losing altitude, but seems to struggle to make the turn. Then, even though commands are still being sent to yaw right, the drone starts yawing left by itself and drops in altitude. What could possibly be causing this issue? Is it a hardware issue or a problem with parameters in the flight controller? This is the last step for us to move forward, so any help is appreciated!
The floor has a little bit of texture, but we are not using optical flow. The drone drops about 1m every time. We have noticed that this happens consistently between 18 and 20 seconds after takeoff every time. We recalibrated the drone, but it did not fix the issue.
We are using Ardupilot because we need to use dronekit to fly in guided_no_gps mode. When we updated to the newest ardupilot firmware (3.6.6), we couldn't get the rangefinder to be used as the altitude source anymore. We have followed those instructions for flashing the flight controller and performing an airframe reset. Thanks.