Skip to content
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

HOME_POSITION - quaternion can have an invalid value #1843

Merged
merged 4 commits into from
May 25, 2023

Conversation

hamishwillee
Copy link
Collaborator

HOME_POSITION includes a quaternion that specifies the slope and heading of the vehicle on takeoff.

Both PX4 and ArduPilot provide false values.

  • PX4 sets roll and pitch as (level vehicle) but specifies the yaw.
  • ArduPilot sets it to [1,0,0,0] (level vehicle facing North).

This change states that if the values are not known to be true then they should be set to NaN. I assume this is reasonable, but may not be mathematically. If it is OK , then we should raise bugs against the flight stacks to output the invalid value.

If not, we need alternative way to tell recipients that the data is at least partially bogus.

Fixes #1839

@flybrianfly
Copy link

Would it be better to just include the heading / yaw instead of using a quaternion? I'm not sure how I would use the slope information in real life - is anyone operating out of areas where the slope would actually be needed?

@hamishwillee
Copy link
Collaborator Author

The message has been used in the wild for a long time, so whether some alternative would be better is kind of irrelevant in the context of this message. We have to assume that it has been and that quaternion is useful. At that point the question for this message is how we make sure that it is unambiguous and ensure that flight stacks can provide sensible information (even if that might be to say "I'm not providing this info").

I don't know if the slope is actually needed - the fact that neither PX4 or ardupilot provide it indicates perhaps not. Perhaps a new message might make sense as well.

@julianoes
Copy link
Collaborator

What if we add roll and pitch to the two reserved fields in MAV_CMD_DO_SET_HOME (param2, param3)?

@hamishwillee
Copy link
Collaborator Author

What if we add roll and pitch to the two reserved fields in MAV_CMD_DO_SET_HOME (param2, param3)?

Not sure. I guess you could argue that if someone is willing to specify that the home position has a particular attitude then we should take that. I lean towards agree with James that this isn't actually of interest to people, and we should avoid adding anything until a use case that someone really needs is provided.

@auturgy
Copy link
Collaborator

auturgy commented May 24, 2023

Doesn't break anything, aids clarity and hopefully will flow through into the flight stacks

@hamishwillee
Copy link
Collaborator Author

I've updated to use invalid=['Nan'] tag too.

@auturgy I know that ArduPilot are already thinking about this. I figure we might have other values that should be set invalid values to but we can wait on that.

@julianoes Who would we point this to in PX4? I.e. lets make sure that there is at least an issue report so we can make sure that people are aware PX4 is non compliant with this change (probably).

Merging now. Thanks.

@hamishwillee hamishwillee merged commit 6c261d9 into master May 25, 2023
11 checks passed
@hamishwillee hamishwillee deleted the hamishwillee-patch-6 branch May 25, 2023 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clarification: Home Position Q
4 participants