Repository navigation
Conversation
|
One issue is that |
|
@tcr3dr Very cool.
You could kick off a commands download every time this is accessed "within a timeframe"? A bit ugly, particularly if there are a lot of points - since waiting for download is blocking. The bigger problem is that you could easily swamp an "in progress" update of the local commands before they are flushed. I think we have no choice but to handle this case in documentation. What we should do though is make this attribute writeable. I am fairly sure that the command to set the home position is in Copter/Rover/Plane already. Something to think about ... Support for requesting the HOME_POSITION using MAV_CMD_GET_HOME_POSITION is in master but not in any release yet. Obviously using this is the "rght" thing to do, but will not be backward compatible with current releases. I guess you have a clever plan to deal with that. |
|
@tcr3dr This build crashes if clear() is called on an empty object. So basically the below crashes - but it should work - you shouldn't need to do anything special to get a vehicle.commands object ready to clear (uncommenting the lines works) The error shown is: Copyable test code below. |
|
@tcr3dr |
|
@tcr3dr I ran mission_import_export.py and got The result was an endless loop after the end of the cmds list - see below. The first waypoint still appears to be the home location? |
3e44275 to
b53b174
Compare
|
@tcr3dr excellent! I'll try test this today. BTW, if you clear then add a command, without flushing between, will the autopilot successfully clear then add the commands? If so, then no change needed. If there is potential for race condition then it seems to me that you will always need to flush and possibly delay between commands, and arguably we should then always call flush inside clear so that users don't need to. |
|
@tcr3dr Thanks! The good:
The bad:
It may be that you still expect home location to be in the commands array. I hope not, but even so something is not quite right. Some debug:
Does that make sense? |
|
@hamishwillee Fixed the home_location errors. I think that clear() then add() will not require a flush() inbetween. For example: This is the whole transaction, i.e. we don't talk to Pixhawk until the flush() command. |
|
And for the hell of it, |
|
Looking good so far ...
|
|
@tcr3dr Thats it, docs all up to date for |
|
@hamishwillee The rounding error is unavoidable. I believe all the params are encoded as 32-bit floats, not 64-bit doubles (Python's native datatype). This is demonstrated here: A documentation-level advisory would help. |
81e4b5e to
19a817a
Compare
This is what's returned by the autopilot. Since the 0,0,0 tuple is "magical" (as far as I can tell) I would be amenable to either returning None in this case (since that's our default) or returning what it does now. |
|
@hamishwillee I'll wait for your review on this tonight that the two open bugs are resolved. Then I'm happy to merge. /cc @mrpollo for additional code review. |
|
@hamishwillee I don't want to remove |
7b40a8a to
ccbf6c3
Compare
|
Branch fixed, again. |
I am not sure. My inclination is to leave this as is - on the assumption it might be useful to know that a home position has not yet been set. |
Updated: I have added a note in the mission_import_export docs to explain why they are different. This is a logical place because the example shows a side-by-side comparison - so it is most obvious here. We also need a programming/idioms/unexpected behaviour doc at some point and it should go there too - placeholder is #397 |
…. Update home_location in API Ref too
|
@hamishwillee This branch still has broken |
|
Absolutely - looking forward to seeing this in a live branch. I presume that setting the home location is also still broken? |
Moves home_location out of commands array.
|
@hamishwillee Not sure. I believe not, but let me confirm on a new PR... |
Replaces #207. See #132.