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

Mavlink ATTITUDE message yaw not matching specification #6577

Closed
nathanjel opened this issue Feb 6, 2021 · 0 comments
Closed

Mavlink ATTITUDE message yaw not matching specification #6577

nathanjel opened this issue Feb 6, 2021 · 0 comments

Comments

@nathanjel
Copy link
Contributor

nathanjel commented Feb 6, 2021

Current Behavior

Mavlink ATTITUDE message reports yaw in [0..2*PI] range. Message specification says it should be [-PI...PI].

Steps to Reproduce

  1. Setup specific serial port as Mavlink
  2. Connect to the specific serial port by Mavlink client (here python code that does to_json())
  3. See the message, yaw is larger than PI:
    {"mavpackettype": "ATTITUDE", "time_boot_ms": 39887824, "roll": -0.01745329238474369, "pitch": -0.04014257341623306, "yaw": 4.0543999671936035, "rollspeed": 0.0, "pitchspeed": 0.0, "yawspeed": 0.0}

Expected behavior

Reported yaw value between [-PI...PI].

Suggested solution(s)

DECIDEGREES_TO_RADIANS(attitude.values.yaw),

Change to

DECIDEGREES_TO_RADIANS((attitude.values.yaw > 1800) ? -(3600-attitude.values.yaw) : attitude.values.yaw),

Additional context

I can fix this and submit merge request. Before that I just want to confirm if this is not a "feature" driven by specific reasons.

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

No branches or pull requests

1 participant