I have been trying to implement the asyncaction.py example (from the user guide, under “Advanced Usage Examples”) with the moveTo command in place of the moveBy command. While the unmodified code performs as expected both in simulation and in reality, after the substitution the drone takes off and suddenly lands. I am asking the drone to fly 15 meters above the home position. The changes made to the code are the following:
at line 11 added:
drone(GPSFixStateChanged(fixed=1, _timeout=10, _policy='check_wait')) drone_home = drone.get_state(HomeChanged)
in place of line 16 (the moveBy command):
>> moveTo(drone_home['latitude'], drone_home['longitude'], 15, MoveTo_Orientation_mode.NONE, 0.0)
Goes without saying that all the required messages and events are imported at the beginning of the file.
I verified in the logs that I am receiving the correct home position and sending the command as supposed. I receive the event MoveToChanged with status RUNNING. What seems to happen next is that the code sends the Landing command right after receiving the event MoveToChanged (RUNNING), triggering the event MoveToChanged with status CANCELED and making the drone land.
I am reporting the mentioned log section here:
05/09/2019 22:47:20.606607 _send_command Ardrone3.Piloting.MoveTo(c_double( 48.87890000000001), c_double(2.3677799999999998), c_double(15.0), c_uint(0), c_double(0.0)): has been sent asynchronously 05/09/2019 22:47:20.609058 _recv_cmd_cb ardrone3.GPSState.HomeTypeAvailabilityChanged(type=HomeTypeAvailabilityChanged_Type.TAKEOFF, available=1) 05/09/2019 22:47:20.610563 _recv_cmd_cb ardrone3.GPSState.HomeTypeChosenChanged(type=HomeTypeChosenChanged_Type.TAKEOFF) 05/09/2019 22:47:20.612524 _recv_cmd_cb ardrone3.PilotingState.NavigateHomeStateChanged(state=NavigateHomeStateChanged_State.available, reason=NavigateHomeStateChanged_Reason.enabled) 05/09/2019 22:47:20.614039 _recv_cmd_cb animation.availability(values='horizontal_panorama|dronie|horizontal_reveal|vertical_reveal|twist_up') 05/09/2019 22:47:20.661230 _recv_cmd_cb ardrone3.PilotingState.moveToChanged(latitude=48.87890000000001, longitude=2.3677799999999998, altitude=15.0, orientation_mode=MoveToChanged_Orientation_mode.NONE, heading=88.3249740600586, status=MoveToChanged_Status.RUNNING) 05/09/2019 22:47:20.663077 _send_command Ardrone3.Piloting.Landing(): has been sent asynchronously 05/09/2019 22:47:20.668825 _recv_cmd_cb animation.availability(values='') 05/09/2019 22:47:20.689465 _recv_cmd_cb ardrone3.PilotingState.moveToChanged(latitude=48.87890000000001, longitude=2.3677799999999998, altitude=15.0, orientation_mode=MoveToChanged_Orientation_mode.NONE, heading=88.3249740600586, status=MoveToChanged_Status.CANCELED) 05/09/2019 22:47:20.691268 _destroy_pomp_loop Pomp loop has been destroyed 05/09/2019 22:47:20.692668 destroy_timer Pomp loop timer has been destroyed 05/09/2019 22:47:20.694023 destroy_timer Pomp loop timer has been destroyed E pomp: fd=23, cb=0x7ff10a3b0700 not removed from loop E pomp: fd=22, cb=0x7ff10a3b0700 not removed from loop E pomp: fd=20, cb=0x7ff10ac134e0 not removed from loop E pomp: fd=19, cb=0x7ff10a3b0700 not removed from loop E pomp: fd=18, cb=0x7ff10a3b0700 not removed from loop E pomp: fd=17, cb=0x7ff10a3a5f10 not removed from loop E pomp: fd=16, cb=0x7ff10a3b0700 not removed from loop E pomp: fd=15, cb=0x7ff10a3b0700 not removed from loop 05/09/2019 22:47:20.695940 _destroy_pomp_loop Error while destroying pomp loop: -16 I arsdkctrl: discovery 'net': remove device name='ANAFI-0000000' id='000000000000000000' I arsdkctrl: internally disconnect device name='ANAFI-0000000' type=ANAFI4K id='000000000000000000' 05/09/2019 22:47:20.697338 _disconnected_cb Disconnected from device: ANAFI-0000000 05/09/2019 22:47:20.699350 _device_removed_cb Device has been removed I arsdkctrl: discovery 'net': stop 05/09/2019 22:47:20.700092 _stop_discovery Discovery has been stopped 05/09/2019 22:47:20.700604 _stop_discovery Discovery object has been destroyed 05/09/2019 22:47:20.703845 _destroy_net_backend Net backend has been destroyed 05/09/2019 22:47:20.704341 _destroy_manager Manager has been destroyed 05/09/2019 22:47:20.793137 _destroy_pomp_loop Pomp loop has been destroyed