Yaw, Roll Pitch

Discussion in 'Plugins' started by RussellHodgson, May 28, 2020.

  1. RussellHodgson

    RussellHodgson Registered

    Joined:
    Sep 22, 2014
    Messages:
    331
    Likes Received:
    108
    Does anyone know which variables in the InternalsPlugin.h file are the yaw, pitch and roll for the car?

    Thanks in advanced.
     
  2. The Iron Wolf

    The Iron Wolf Member

    Joined:
    Feb 20, 2016
    Messages:
    982
    Likes Received:
    951
    You need to calculate that from the vehicle orientation matrix. Here's math used in CC:

    orientation is TelemInfoV01::mOri matrix
    public const byte RowX = 0;
    public const byte RowY = 1;
    public const byte RowZ = 2;

    Yaw = (float)Math.Atan2(orientation[rFactor2Constants.RowZ].x, orientation[rFactor2Constants.RowZ].z),

    Pitch = (float)Math.Atan2(-orientation[rFactor2Constants.RowY].z,
    Math.Sqrt(orientation[rFactor2Constants.RowX].z * orientation[rFactor2Constants.RowX].z + orientation[rFactor2Constants.RowZ].z * orientation[rFactor2Constants.RowZ].z)),

    Roll = (float)Math.Atan2(orientation[rFactor2Constants.RowY].x,
    Math.Sqrt(orientation[rFactor2Constants.RowX].x * orientation[rFactor2Constants.RowX].x + orientation[rFactor2Constants.RowZ].x * orientation[rFactor2Constants.RowZ].x))
     
  3. RussellHodgson

    RussellHodgson Registered

    Joined:
    Sep 22, 2014
    Messages:
    331
    Likes Received:
    108
    That you very much!

    And to confirm this provides the results in radians, correct?
     

Share This Page