Need dronekit help


I am trying to perform a simple ‘cross’ manuever, which the CC RPi executes, using some dronekit and MAVLink methods. I was expecting the drone to move in the North, South, East, West directions sequentially without changing its heading, but did not go as planned. I tested the script in a dronekit-sitl instance and it worked perfectly, but in the field was another story. The drone went forward, but then did a cw circle instead of rolling left and then did the same when it was time to roll to the right, except it did a ccw circle. I think that it did these circles by yawing because the drone changed its heading to complete the circles. I have attached the log file and my code… maybe someone can help?

I am thinking that it might be a time thing i.e. I might have to put more time.sleep() so that it runs smoother. I do see smoother movements in SITL, so I will try out in the field as well.

Or, it might have something to do with this post… I’ll do some more digging.