I am using a Pixhawk 2.1 Cube on Arducopter v3.6.4 with a Raspberry Pi 3 Model B running dronekit scripts. What I want to do is takeoff, go to a point and land there and after some time take off and return to the home location. I tried to run it on SITL but was unsuccessful. The quad takes off and goes to the point and lands. But after landing it disarms the motors and doesn't arm again.
What I did was change the mode from GUIDED to LAND in dronekit. I ran the arm_and_takeoff() function but it just refuses to arm. I interrupt the script and then run the code again and it flies as usual but doesn't arm and takeoff once it lands.
Is there anyway to overcome this problem?