Skip to content

DKPY2: flush() should be renamed #368

Closed

Description

@tcr3dr

flush() is misleading because it only operates on commands. vehicle.commands.upload() would be a more correct name for this behavior.

The idea of a flush() or batching of message changes until they are ready is a useful idea, but not one which is supported (and potentially cannot be supported under MAVLink currently)

Activity

  1. hamishwillee commented on Oct 23, 2015

    @hamishwillee
    Contributor

    Thanks. That was news to me - all the docs and examples assume that flush is needed for any change - e.g. for a new mode etc. I'll correct that!

  2. tcr3dr commented on Oct 23, 2015

    @tcr3dr
    ContributorAuthor

    I was surprised too :)

    def flush(self):

  3. hamishwillee commented on Oct 23, 2015

    @hamishwillee
    Contributor

    @tcr3dr So looking at this we also have to do this for clear right? However we don't need to for other vehicle.command operations like takeoff and goto?

  4. tcr3dr commented on Oct 27, 2015

    @tcr3dr
    ContributorAuthor

    @hamishwillee Yup. I think anything which statically modifies the command array... I think we want to improve this API rather than figuring out the conditions where we need to use flush().

  5. hamishwillee commented on Oct 27, 2015

    @hamishwillee
    Contributor

    @tcr3dr We typically take too long to get this sort of change in - better to document how it works now if that is a quick job than leave wrong for an indeterminate amount of time. In any case #372 fixes the docs issue.

    With respect to improving the API I'm really not sure what a developer would want here. While I would love to be able to batch up as below and send there is too much state information involved - any of these can fail

    mode change to guided
    arm
    takeoff
    
    -> sendall
    

    Even with commands, I'm not really sure you lose anything much if we were to make every single add operation be sent immediately - certainly not for the companion computer case, and possibly not even for the GCS case.

    Upshot, not so concerned about the flush case. Far more concerned about providing APIs that confirm success/you can wait on. In particular a nice takeoff that handles everything for you in the ideal case but otherwise reports what is blocking in a sensible way.

  6. tcr3dr commented on Nov 2, 2015

    @tcr3dr
    ContributorAuthor

    As of #384 this will be fixed to make all commands properties batched and suffixed by an .upload() step.

  7. tcr3dr commented on Nov 3, 2015

    @tcr3dr
    ContributorAuthor

    Completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions