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

common: SIM_STATE specify attitude units as rad #2095

Merged
merged 1 commit into from
Mar 20, 2024

Conversation

Maarrk
Copy link
Contributor

@Maarrk Maarrk commented Mar 16, 2024

The fields roll, pitch and yaw of SIM_STATE message do not specify their unit. Even if the recommended use is only for human-readable outputs, I believe it would be beneficial to have the unit specified.

Reasons for choosing radians:

  • angular speeds of the same message are in rad/s
  • consistency with ATTITUDE, MANUAL_SETPOINT, LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET, HIL_STATE, [GLOBAL_|VICON_]VISION_POSITION_ESTIMATE
  • ArduPilot already sends them as rad (I don't have a PX4 setup ready to confirm)

Other units used for roll and pitch angles in common dialect:

  • MAV_CMD_DO_SET_HOME - doesn't refer to attitude, but terrain
  • MAV_CMD_DO_MOUNT_CONTROL, MOUNT_ORIENTATION - refers to gimbal and is deprecated, new messages use rad
  • HIGH_LATENCY - deprecated
  • MAV_CMD_NAV_TAKEOFF - degrees, but MAV_CMD_NAV_TAKEOFF_LOCAL uses rad
  • Specifically yaw is often set in degrees in navigation context

@hamishwillee
Copy link
Collaborator

PX4 does not appear to implement this. If ArduPilot already sets this as radians then that is what we should do.

@julianoes @auturgy Could you please confirm this makes sense to you?

Copy link
Collaborator

@julianoes julianoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never seen this message, fine with me.

@hamishwillee
Copy link
Collaborator

OK, confirmed ArduPilot uses radians for these https://github.com/ArduPilot/ardupilot/blob/master/libraries/SITL/SITL.cpp#L1215 and PX4 does not care. So merging.

@hamishwillee hamishwillee merged commit 1f084f1 into mavlink:master Mar 20, 2024
13 checks passed
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.

None yet

3 participants