Skip to content

core: frontend: src: MainView.vue: fix incorrect vehicle rotations #3378

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

Conversation

ES-Alexander
Copy link
Collaborator

@ES-Alexander ES-Alexander commented Jun 17, 2025

model-viewer's orientation convention has inverted pitch and yaw directions compared to the aeronautical frame used by MAVLink's ATTITUDE message.

Summary by Sourcery

Bug Fixes:

  • Negate pitch and yaw values when rendering vehicle orientation to correct frame convention mismatch

Copy link

sourcery-ai bot commented Jun 17, 2025

Reviewer's Guide

Adjusted the computed orientation formatter to align with the aeronautical frame by negating pitch and yaw angles before constructing the return string.

Class diagram for updated orientation formatting in MainView.vue

classDiagram
    class MainView {
        +getOrientationString(): string
    }
    MainView : getOrientationString() now returns `${roll}rad -${pitch}rad -${yaw}rad` instead of `${roll}rad ${pitch}rad ${yaw}rad`
Loading

File-Level Changes

Change Details Files
Negate pitch and yaw values in orientation output
  • Prefixed pitch with a negative sign
  • Prefixed yaw with a negative sign
  • Updated return expression in orientation getter
core/frontend/src/views/MainView.vue

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @ES-Alexander - I've reviewed your changes - here's some feedback:

  • The default return string still uses “deg” while actual values are suffixed with “rad”—unify the units or convert to the viewer’s expected unit to avoid confusion.
  • Extract the pitch/yaw sign inversion into a shared helper function to centralize the aeronautical-to-model-viewer frame conversion and keep MainView.vue cleaner.
  • Consider normalizing angles (e.g. wrapping to –π…π) so you don’t end up with large unwieldy rotations in the model-viewer when values exceed a full turn.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The default return string still uses “deg” while actual values are suffixed with “rad”—unify the units or convert to the viewer’s expected unit to avoid confusion.
- Extract the pitch/yaw sign inversion into a shared helper function to centralize the aeronautical-to-model-viewer frame conversion and keep MainView.vue cleaner.
- Consider normalizing angles (e.g. wrapping to –π…π) so you don’t end up with large unwieldy rotations in the model-viewer when values exceed a full turn.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

model-viewer's [orientation convention](https://modelviewer.dev/docs/index.html#entrydocs-scenegraph-attributes-orientation) has inverted pitch and yaw directions compared to the aeronautical frame used by MAVLink's [ATTITUDE](https://mavlink.io/en/messages/common.html#ATTITUDE) message.
@ES-Alexander ES-Alexander force-pushed the fix-dashboard-vehicle-rotation branch from 1ff60ca to f52c83a Compare June 17, 2025 11:40
@patrickelectric patrickelectric merged commit 803fc3c into bluerobotics:master Jun 17, 2025
5 checks passed
@joaoantoniocardoso joaoantoniocardoso added move-to-stable Needs to be cherry-picked and move to stable and removed move-to-stable Needs to be cherry-picked and move to stable labels Aug 8, 2025
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.

3 participants