-
Notifications
You must be signed in to change notification settings - Fork 16.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GCS_MAVLink: home position should always send #23636
Conversation
e937511
to
af04b35
Compare
I've always thought that there cannot be a home position until the EKF origin has been set so I'm not sure the current code needs to be changed. |
well, it used to be once you get a GPS lock a GCS could ask you what your home location is. Now it takes a dozen seconds later and meanwhile swallows up your request without a NACK or anything |
your home isn't what's changing.. it's the origin that does and it's just adding to the message. The home is valid while it's rejecting the request... and frankly a GCS doesn't care about the EKF origin in most cases |
ping |
This likely deserves a discussion at a dev call |
PR that caused this new behavior: #21642 Outcome from devcall discussion: The field should really be NaN as default instead of 0. Same goes for q[4] and we should update the MAVLink spec saying so |
@peterbarker said he'll contact @hamishwillee regarding MAVLink changes |
He did. Makes a lot of sense. Regarding invalid values, by convention we use zero "if 0 is invalid in the context of the field" - I am assuming all zeros is an invalid quaternion. Consider also making the Lat/Lon/Alt as NaN invalid too, if it is possible the message will be requested when you have absolute but no local position. Also it is possible this might be streamed at low rate in some flight stacks, when there is no home position, or only some data is available. Lastly, if you get a request and you have no home position, NACK the request with MAV_RESULT_TEMPORARILY_REJECTED and don't send the message. Can you PR the changes upstream please. |
Actually there is already a PR to specify quaternions as NaN - @auturgy approved it, and I have merged it mavlink/mavlink#1843 |
af04b35
to
b6292aa
Compare
I've fixed this per @tridge 's comments and did it in two commits so we can drop the Home one if necessary.
|
9331f5a
to
fc7f6c4
Compare
When a GCS requests the home position and we respond via
send_home_position()
we used to always send it if home was set. Now we'll ignore the request for many more seconds untilhome.get_vector_from_origin_NEU()
returns true which is when the EKF origin is set. Is that really necessary? It's just populating another part of the home_position() message which is otherwise 0 and used to be hard-coded to 0. If a GCS really wants that info then it can re-request until it gets non-zero data there.