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

Deriving Euler Angles From Game Data

Discussion in 'New users start here - FAQ' started by OldGuy, May 24, 2016.

  1. OldGuy

    OldGuy New Member

    Joined:
    May 24, 2016
    Messages:
    8
    Location:
    UK
    Balance:
    92Coins
    Ratings:
    +3 / 0 / -0
    Hi All,

    This is my first post so if it looks like I am making a basic mistake - I probably am!

    Having looked at the SimTools documentation it looks like SimTools can read from a game (e.g. FSX, X-Plane) orientation information such as roll, pitch and yaw angles. It can then pass these values to a motor controller board.

    For the project I am thinking about it would be useful to derive the Euler angles from the roll/pitch/yaw data output from the game. I can code an algorithm to do this, but I have no idea if this algorithm could be linked to the SimTools software. It would be the Euler angles, and not the roll/pitch/yaw that SimTools reads from the game, that is the desired output. To summarise:

    SimTools reads in game roll/pitch/yaw angles -> user algorithm derives Euler angles -> Euler angles are output

    Alternatively if SimTools can read either angular velocities in the local aircraft coordinates, or the global to local transformation matrix, I can work with these as well to derive the Euler angles.

    Many thanks for any help in advance!

    OldGuy
    • Like Like x 1
  2. Historiker

    Historiker Dramamine Adict Gold Contributor

    Joined:
    Dec 16, 2010
    Messages:
    2,158
    Occupation:
    Retired
    Location:
    Michigan USA
    Balance:
    9,176Coins
    Ratings:
    +2,159 / 19 / -1
    My Motion Simulator:
    3DOF, DC motor, Arduino, Motion platform, 6DOF
    This might help when considering plugins for Simtools 2.0 (in Beta right now). Might not be worth it to learn the old method considering the new.

    http://www.xsimulator.net/community...tools-2-0-api-documentation.8236/#post-101504

    EDIT: On second thought it only makes sense to give you the information on creating plugins with version 1.x, for background if nothing else.

    Good luck and let us know what you come up with.

    http://www.xsimulator.net/community...ugin-for-simtools-1-0-api-documentation.4612/
    Last edited: May 25, 2016
  3. OldGuy

    OldGuy New Member

    Joined:
    May 24, 2016
    Messages:
    8
    Location:
    UK
    Balance:
    92Coins
    Ratings:
    +3 / 0 / -0
    Many thanks for the reply Historiker.

    It is good to see the ability to write some code (looks like Visual Basic) to process the data read from the game before sending it onwards to the motor controller.

    I have some more specific questions. For a game such as a flight sim / space sim:
    1. Can I read roll / pitch / yaw angles of the aircraft / spacecraft I am flying - getting the values out in degrees or radians
    2. I presume these values are read many times a sceond - typically (I know this will depend on hardware) how many times a second are the values read?
    3. Can I store the values I read now so that I get access to them the next time the code is run ? E.g. this gives me access to the current roll angle and the previous roll angle
    4. Are functions such as cos sin and tan implemented?

    Many thanks for any help in advance, and sorry to ask so many questions ...

    Once I get enough credits I do plan to download the software and examine it for myself.

    OldGuy
  4. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,553
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    145,136Coins
    Ratings:
    +10,779 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    SimTools itself does not need credits to download and comes with the LFS plugin to allow people to test it: http://www.xsimulator.net/simtools-motion-simulator-software/

    Perhaps it would help if you explain what it is you plan to do.
  5. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,575Coins
    Ratings:
    +1,831 / 32 / -1
    Hi OldGuy,
    1. I believe so. Those values are initially read by simtools plugin's in degrees or radians. Simtools is usually used to scale the values to ones needs so I think full scale can be used also. But definitely within the plugin itself.
    2. You set this to your needs also, as fast as 1ms is possible. But the data won't update faster than the title outputs telemetry. I'm not sure if the plugins loop itself can run faster than this setting though.
    3. No, not in simtools itself. But you can include code (make variables) in the plugin that could do this for you. You can also send raw data to another program via a NET interface to process (but you can't send it back in).
    4. I believe most math functions are possible within the plugin also.
    • Like Like x 1
    Last edited: May 26, 2016
  6. OldGuy

    OldGuy New Member

    Joined:
    May 24, 2016
    Messages:
    8
    Location:
    UK
    Balance:
    92Coins
    Ratings:
    +3 / 0 / -0
    Many thanks for the help.

    If I can derive the Euler angles from the game data then there is a chance I can have a go at reproducing the aircraft / spacecraft motion on a physical rig - probably in a Lego model at first just to demonstrate the concept! I suspect a motor control board or two and small motors will be needed along the way too with this proof of concept! Poisitional feedback on the motors would be a necessity as well.

    Years ago I wrote an algorithm to generate the Euler angles from gyro data derived from physical testwork (i.e. nothing to do with computer simulation at all). Actually we were putting cars through all sorts of rollover testwork. With a 10 kHz sample rate on the gyros I used an explicit time integration scheme which derived the Euler angle velocities by using data sampled moments before. This led to a very simple algorithm. Once armed with the Euler angles I translated the accelerometer data from the rolling (and sometimes pitching) car local coordinates into laboratory global coordinates where the data processing team could then make use of it.

    Web searches have yielded algorithms to generate Euler angles from direction cosine matrices (handling gimball lock), and from gyro data (i.e. body angular velocities). Maybe, just today, I may have come across some papers I can use to get the Euler angles from body roll / pitch / yaw angles - but it is late and I have to get up for work tomorrow. It looks like the weekend before I will get back to the algorithms.

    Once I get the algorithm sorted I will download SimTools and have a go at extracting the Euler Angles from the body roll / pitch / yaw angles.

    Thanks again,

    OldGuy
    • Like Like x 1