1

With both DKPy-SITL and our APM2 board, the wait_ready method is causing our program to raise an API Exception due to the command list (waypoints) taking too long to download. In the past (with droneapi) this wasn't an issue for me. Some waypoints are being downloaded, but the process takes about 10 seconds for each one, which leads me to believe something weird is going on.

Are there any ways to speed up the download process? I've posted the relevant code below.

self.vehicle = connect(connection_string, baud=baud_rate,
            status_printer=dronekit_printer, wait_ready=True)

and later in another asynchronous method

def commands(self):  
    commands = self.vehicle.commands
    commands.download()
    commands.wait_ready()
    return commands

The error occurs on commands.wait_ready(). There has to be a faster way to download commands than sitting there for over 30 seconds on an i7 4790k processor, especially since I've run the same code off a slower computer in the past with droneapi. If need be, I can raise an issue on the dronekit github as well.

Indeed
  • 139
  • 14

1 Answers1

1

I had the same issue. First time download call always goes well (0 commands). Once you have uploaded some commands the second time you try to download it fails ('Timeout' exception). What I did to solve this was calling clear without download after the first time. Something like this:

            cmds = vehicle.commands
            if not cmds.count > 0:
                # Download
                cmds.download()
                # Wait until download is finished
                cmds.wait_ready()
            cmds.clear()
            # Add / Modify the commands here and then upload them
epinal
  • 1,415
  • 1
  • 13
  • 27
  • 3DR has let Dronekit fall by the wayside rather than give it the full-time programmers it needs. As a result, we've moved away from it to make our own Mavproxy modules that allow us to work without all of the unnecessary overhead introduced by Dronekit. – Indeed Sep 28 '16 at 20:38
  • I agree. Please mark the answer as solution if it solved your problem. Thanks – epinal Sep 29 '16 at 19:48
  • The issue is that the initial download typically is not zero commands, so it isn't even a solution. I had posted this in the hope that it would attract the attention of the developers, but 3DR didn't even have them on full-time payroll anymore so who knows if they even saw it. – Indeed Sep 30 '16 at 23:50