-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
common.xml: deprecate the _INT frames #2092
common.xml: deprecate the _INT frames #2092
Conversation
the frame of an altitude is not dependent on how the altitude is being transported (how other fields in the same message are being transported). ArduPilot has treated these frames to be the same as the non-_INT equivalents in most places for a very long time. We can save some confusion and perhaps a small amount of flash space if we remove the _INT frames
I've created a PR on the ArduPilot repository for discussion at our next DevCall. |
We discussed at our DevCall and we think this is a good change. Just waiting for some discussion upstream. |
The I'll raise in the meeting this evening. |
I wasn't in the ArduPilot dev call, but my assumption is the problem is:
|
On Tue, 12 Mar 2024, Hamish Willee wrote:
The _INT cases explicitly specify that lat/lon are scaled 1E7, while
the others imply they are not. PX4 handles the case to make the
decision about the way to decode the values.
I'd be a little worried if PX4 could accept a 1e0 in an _INT
message - but that's what you're implying :-P
|
OK, so I think I get this. You're basically always scaling when sending in a COMMAND_INT irrespective of the This made sense to @julianoes who has implemented this and treated those frames as synonymous.
Sorry if I'm being dim. I'm a bit worried about touching frames - it always ends badly. |
Correct.
Yes. Many years ago we found many bugs in the way we treat these frames - leading to a lack of correct multiplication or incorrect application thereof.
Nice!
I agree.
Yes.
:-) |
I guess I am the confused person 😄 If I can chip in as mostly a user, and a very rare and novice contributor to either project, this would make my life easier. Recently we were trying to use a new feature of ArduPilot and ran exactly into the issue this change would prevent. This is my current understanding, relying mostly on documentation:
quoted from ArduPilot/ardupilot#26387 |
@Maarrk Yes. The theory is that these two frames should always be synonymous when used in a COMMAND_INT. However because they both exist and this is not always obvious, not every usage correctly allows either frame to be used. Peter wants to clarify this. I'm supportive. I just know that frame definitions have historically caused much pain to modify. |
Do you think there could be a mention of that in the command microservice documentation? Especially since it explicitly forbids using an unexpected frame:
Proposed addition (I can make the PR to devguide if you think it's OK):
I hope it's not too verbose, but past me would appreciate it. Thank you both for taking this on and for your commitment to stability! |
Thanks @Maarrk |
On Tue, 19 Mar 2024, Hamish Willee wrote:
We really want to discourage people calling this, so that in future we can rename and remove it. Any thoughts on that?
Sounds good. We need a very long time-frame for removing this stuff, of
course. We need a couple of years before we can suggest to GCS operators
to not send in the _INT frames to allow firmware implementors to make
their adjustments.
And then we need a couple more years before we can remove the framesfrom
the firmwares...
|
@@ -280,10 +280,11 @@ | |||
<description>This is the same as MAV_FRAME_BODY_FRD.</description> | |||
</entry> | |||
<entry value="10" name="MAV_FRAME_GLOBAL_TERRAIN_ALT"> | |||
<description>Global (WGS84) coordinate frame with AGL altitude (at the waypoint coordinate). First value / x: latitude in degrees, second value / y: longitude in degrees, third value / z: positive altitude in meters with 0 being at ground level in terrain model.</description> | |||
<description>Global (WGS84) coordinate frame with AGL altitude (altitude at ground level).</description> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, I have removed mention of waypoint because the location depends on context - it doesn't have to be a waypoint.
I removed the mention of terrain map because again, this depends on context - it might come from a LIDAR or similar.
@julianoes Can you sanity check this one too? As part of that, can you check whether PX4 does indeed use these as synonyms and support either in the cases where the command is sent? I'll ping in Auterion too. |
I doubt PX4 does it correct yet, we'll have to fix that. |
@auturgy @peterbarker Any final words on this one? If not, I'll merge (probably next week). Feedback from Silvan and Alessandro in Auterion positive. |
LGTM, thanks! Perhaps fewer commits would be nice, but that's it. |
Commits will get squashed on merge. Probably no need to wait until next week. |
OK. I'm feeling brave., |
* common.xml: deprecate the _INT frames the frame of an altitude is not dependent on how the altitude is being transported (how other fields in the same message are being transported). ArduPilot has treated these frames to be the same as the non-_INT equivalents in most places for a very long time. We can save some confusion and perhaps a small amount of flash space if we remove the _INT frames * Replace the deprecated types where they are used * Rename lat/lon from X pos/Y pos in WGS84 frame * Update message_definitions/v1.0/common.xml * simply the global frames * Apply suggestions from code review * Apply suggestions from code review * Update common.xml --------- Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
* common.xml: deprecate the _INT frames the frame of an altitude is not dependent on how the altitude is being transported (how other fields in the same message are being transported). ArduPilot has treated these frames to be the same as the non-_INT equivalents in most places for a very long time. We can save some confusion and perhaps a small amount of flash space if we remove the _INT frames * Replace the deprecated types where they are used * Rename lat/lon from X pos/Y pos in WGS84 frame * Update message_definitions/v1.0/common.xml * simply the global frames * Apply suggestions from code review * Apply suggestions from code review * Update common.xml --------- Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
the frame of an altitude is not dependent on how the altitude is being transported (how other fields in the same message are being transported).
ArduPilot has treated these frames to be the same as the non-_INT equivalents in most places for a very long time.
We can save some confusion and perhaps a small amount of flash space if we remove the _INT frames
HamishW Edit
This marks MAV_FRAME_GLOBAL_INT, MAV_FRAME_GLOBAL_RELATIVE_ALT_INT, MAV_FRAME_GLOBAL_TERRAIN_ALT_INT as deprecated in favour of using their non-
_INT
alternatives, and simplifies the descriptions of scaling in the various messages.The
_INT
variants were clearly created to allow specification of frames where the values of lat/lon are scaled, to go with the corresponding ones that don't make any statements about scaling. However these are used mainly in COMMAND_INT which explicitly specifies the scaling anyway - so the two values are synonyms (also true elsewhere these are used).ArduPilot and MAVSDK, and presumably PX4 tend to implement code such that the INT versions are just synonyms. But sometimes one option or the other is forgotten, and this results in bugs. The idea here is to deprecate the pointless options, and eventually stop them being sent by GCS.