Hi,
I am trying to create a sequence of MoveTo commands in Olympe. I have 6 GPS coordinates and I want the drone to visit each in order before returning to the first point. However, when I run the code, the drone only visits the first point. No matter what I try, I can’t seem to get it to visit a point then visit the next point. Below is how I’m currently structuring my sequence of moveTo commands (I have included 2 of the 6). Any help is greatly appreciated! For reference, I’ve tried adding a FlyingStateChanged hovering check in between commands following the suggestion of another post but it didn’t help.
EDIT: I have run the script through Sphinx and it works perfectly. Yet when I run it on a real drone it still doesn’t work.
import olympe
from olympe.messages.ardrone3.Piloting import TakeOff, Landing, moveTo
import olympe.enums.move as mode
from olympe.messages.ardrone3.PilotingState import FlyingStateChanged, moveToChanged
from olympe.enums.ardrone3.PilotingState import MoveToChanged_Status as status
drone(
moveTo(40.4155755, -79.9494166, 6.0, mode.orientation_mode.to_target, 0.0)
>> moveToChanged(latitude=40.4155755, longitude=-79.9494166, altitude=6.0, orientation_mode=mode.orientation_mode.to_target, status=status.DONE)
).wait().success()
drone(
moveTo(40.4152855, -79.949717, 6.0, mode.orientation_mode.to_target, 0.0)
>> moveToChanged(latitude=40.4152855, longitude=-79.949717, altitude=6.0, orientation_mode=mode.orientation_mode.to_target, status=status.DONE)
).wait().success()