Repository navigation
Extracts MPState object logic into Vehicle. Implements wait_ready. - #401
Conversation
c4c9a2a to
534085d
Compare
534085d to
9f2fac9
Compare
|
Looks a lot simpler. What, if any testing/documentation do you "know" you need form me? This merge misses a lot of the documentation changes we "temporarily lost" this morning - e.g I replaced use of flush() everywhere and had started to use home_location. I am assuming that will be fixed up? I guess we will in particular need to document the use of wait_ready in the migrating guide. |
There was a problem hiding this comment.
in this case this should be def location_callback(vehicle, attr_name): see attr_name instead of location, attr_name is a string
|
lots of changes, left some comments but non blocking on merge, this looks good 👍 |
Extracts MPState object logic into Vehicle. Implements wait_ready.
|
@tcr3dr Hey, but the docs still don't include my previous updates - e.g. The slice is no longer needed and was removed. Do I need to go through all the examples and re-verify my changes went in? |
|
@hamishwillee Hm. It may have been overwritten by git due to its proximity to a wait_valid invocation; my fault, though I can't find the original commit now where it was changed. Can you find the commit in which it was modified? It should be this "lost" commit or one of it's parents, if I recall: 8958a38 Or was it a different PR? |
|
@hamishwillee I think the commits got pulled in. If you look in that commit, the |
|
Excellent - sorry, I'll fix that! |
This is a pretty heavy PR, but also the last major refactor I have planned.
Rather than obtusely split parameter logic between a MAVLink handler and a Vehicle object, the Vehicle object (through "message" handlers and "event loop" handlers) now implements all of its own core logic inside the class. There is still some slightly awkward coupling going on between the classes, but there's far less of it, and the code to manage properties is all in one place.
As a side effect of this, we're now able to track the status of most attributes, and as such have a working
wait_readyimplementation on the vehicle that serves as the basis forawait_param(which should be deprecated and replaced) as well as other methods likewait_valid, etc.Additionally, we get rid of the MAVLink rx handlers and only expose the
on_messageprimitive, which acts as our MAVLink interaction story. Ideally, we can abstract the message contruction story as well, though I haven't put much thought into it.