1. Do not share user accounts! Any account that is shared by another person will be blocked and closed. This means: we will close not only the account that is shared, but also the main account of the user who uses another person's account. We have the ability to detect account sharing, so please do not try to cheat the system. This action will take place on 04/18/2023. Read all forum rules.
    Dismiss Notice
  2. For downloading SimTools plugins you need a Download Package. Get it with virtual coins that you receive for forum activity or Buy Download Package - We have a zero Spam tolerance so read our forum rules first.

    Buy Now a Download Plan!
  3. Do not try to cheat our system and do not post an unnecessary amount of useless posts only to earn credits here. We have a zero spam tolerance policy and this will cause a ban of your user account. Otherwise we wish you a pleasant stay here! Read the forum rules
  4. We have a few rules which you need to read and accept before posting anything here! Following these rules will keep the forum clean and your stay pleasant. Do not follow these rules can lead to permanent exclusion from this website: Read the forum rules.
    Are you a company? Read our company rules

Roll/Pitch vector to yaw/pitch/roll

Discussion in 'Miscellaneous' started by vthinsel, Oct 3, 2016.

  1. vthinsel

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    439
    Location:
    FRANCE
    Balance:
    6,010Coins
    Ratings:
    +564 / 2 / -0
    My Motion Simulator:
    Arduino, 4DOF
    Hello !

    I'm struggling with mathematics... I should been more focused at school I guess..... :confused:
    Codemasters game give world vector for roll and pitch (https://docs.google.com/spreadsheets/d/1UTgeE7vbnGIzDz-URRk2eBIPc_LR1vWcZklp7xD9N0Y/edit?usp=sharing)
    From that I can calculate yaw vector . So far, so good. Now, I need to turn this into yaw pitch and roll in degrees/rad. I tried to apply this : http://stackoverflow.com/questions/...rix-to-euler-tait-bryan-angles-pitch-yaw-roll
    But it doesn't give expected results. roll/pitch do not move correctly when steering or accelerating/braking.
    Do I have to transform the roll/pitch/yaw vectors to something else before I apply the euler transformation ?

    One raw/pitch/yaw will be OK, I'll then move on heave/sway/surge. Playing with derivatives should do the job (event if we already have m_gforce_lat and m_gforce_lon)

    Goal is to make a generic Codemasters UDP plugin.

    Thanks for your lights !
  2. vthinsel

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    439
    Location:
    FRANCE
    Balance:
    6,010Coins
    Ratings:
    +564 / 2 / -0
    My Motion Simulator:
    Arduino, 4DOF
    Up :)

    I got F1 2016 on PS4, and UDP telemetry looks good. At least, it seems to follow the codemasters spec. I can attach the raw file, to be used with my python tools.
    I'am able to extract roll and pitch vector (as well as GForceLon and GForceLat)

    Roll(0) = BitConverter.ToSingle(UDPBytes, 44)
    Roll(1) = BitConverter.ToSingle(UDPBytes, 48)
    Roll(2) = BitConverter.ToSingle(UDPBytes, 52)
    Pitch(0) = BitConverter.ToSingle(UDPBytes, 56)
    Pitch(1) = BitConverter.ToSingle(UDPBytes, 60)
    Pitch(2) = BitConverter.ToSingle(UDPBytes, 64)

    From that, I calculate yaw vector :
    Yaw(0) = Pitch(1) * Roll(2) - Pitch(2) * Roll(1)
    Yaw(1) = Pitch(2) * Roll(0) - Pitch(0) * Roll(2)
    Yaw(2) = Pitch(0) * Roll(1) - Pitch(1) * Roll(0)

    But now, I'm a bit stuck to compute the needed yaw/pitch/roll value expected by simtools ? Could someone shed some light ? I'm really really bad at math / trigo

    Hopefully, codemasters will activate UDP on dirt as well... the generic UDP codemasters plugin is on its way :)
    Last edited: Nov 28, 2016