Menu

#2904 MagnetiCompass: Expose roll and pitch of disc for animatoin

2020.4
Verified
Low
2024-09-09
2024-07-27
No

Hi,
to fix the c172 and c182 compass animations, I need the pitch and roll props exposed.
(Ref. Ticket https://github.com/HHS81/c182s/issues/599)

I added a PR to my repo, please check and merge:
git https://beni.hallinger.org/git/flightgear.git
branch magneticCompass_exposePitchAndRoll

Discussion

  • Benedikt Hallinger

    Added another commit to simulate damping due to fluid.

    However, the result of this PR still looks not good.
    Probably someone more capable should look over the math and logic.

    For example, with the current filter setting the disc has roll when the plane clearly is level when standing still on the ground (tested at EGGK rwy 08R)

     
  • Benedikt Hallinger

    And also the disc bounces around a little too much in my opinion. the idea of the filter is to simulate a damping fluid (lowpass is maybe a bad choice for that. Prior that I used exponential filters in XML space and that did the trick. Don't know how to code a exponential filter however.
    I think I'll ask in the list.

     
  • Benedikt Hallinger

    I fixed that in my branch, and it looks good now, I think.

    The filter is tuned (can be changed at magnetic-compass config and runtime by setting the <fluid-viscosity type="double">8.2</fluid-viscosity> property. it is accepted at runtime at the instruments node, and at config time in instrumentation.xml.
    it defaults to 8.2 which I guesstimated to the vicsosity and expected damping of kerosine.
    As I'm no real pilot, we need to work with that, or someone can provide better numbers. But at least it looks good.

    If the 3d model does not support pitch/roll of the disc, nothing changes (so the set of changes are downwards compatible).

     
  • James Turner

    James Turner - 2024-08-13

    Nice, will take a look in the next few days - are you happy for this to be merged directly?

    As usual with insturment changes, I would greatly prefer if unit-test coverage is added for this, it would really help with compatability and regression testing.

     
  • Benedikt Hallinger

    Hi James, thanks.

    Would be cool if someone could look over this.
    Also no idea really, how to add unit tests; but this is a purely cosmetic change as by now.

     
  • Benedikt Hallinger

    @jmturner Hi, did you found something, or is this mergeable now?

     
  • James Turner

    James Turner - 2024-09-08

    Merged, please test and we can close.

     
  • James Turner

    James Turner - 2024-09-09
    • status: New --> Verified
    • assigned_to: Benedikt Hallinger
     

Log in to post a comment.