• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

MSFS2020 SDK Simconnect & Quaternions

Messages
13
Country
spain
Hello everyone.
First of all, thanks to the developers of this forum, as they have allowed me to get closer to the small, big world of simulation design. Although I'm getting older, I continue to study and learn in this fascinating world. Well, let's get to the point.
My project consists of modeling a low-poly aircraft in Blender, exporting it to MSFS2020, and moving it (currently on the ground) following the position (LLA) and orientation (yaw-pitch-bank) data previously recorded in a file, with the user aircraft, at 1-second intervals. The peculiarity of the project is that I want to pass quaternions for the rotations, not Euler angles. I'm at that point now.
I'm using MSFS2020 1.38.2.0 and SDK 0.24.5, which includes SimConnect.dll v11.0.62651.3. The working environment is VB.NET in Visual Studio, and I can't find the appropriate variable or units in the SDK to define the quaternions and then send them to the plane using SetDataOnSimObject. I know it can be done, but I don't know if the SDK-SimConnect version allows it.
I'd like to know if there's a more up-to-date downloadable version of the SDK for MSFS 2020 version 1.38.2.0 because I can't find it.
Regards.
 
AFAIK, the answer is No to all of your questions. There is no newer SDK and it will only allow you to pass Euler angles (x,y,z). Although Blender/3DS/etc. produce the modeldef file with quaternions, the data that is sent to control those quaternions is in Euler format.

I'm not sure if I mean this but... 'thank you' for forcing me to get a superficial grasp on quaternions to be able to answer your question! I shall now have nightmares about Hamilton and Clifford for the rest of my life. Well, this week anyway 😄
 
Hello Dragon.
Don't have nightmares because of me, 😂😂.
Thank you so much for your quick and realistic response. From it, I'm clear:
1. I'll try Euler's way.
2. Sir Hamilton didn't count on Asobo.

Best regards,
Janu
 
Hello,

Good to hear you are taking on such a challenging project. As @DragonflightDesign mentioned, no, SimConnect does not have Quaternion "units", so they cannot be directly set onto the SimObject. However, I regularly use Quaternions in my computations, and then convert them to Euler angles in a format that SimConnect accepts.
 
Hello Misho

Thank you for your interest in the question raised. I would also like to mention that you use quaternions to calculate rotations, ultimately converting them to Eulerian rotations and sending the latter to SimConnect. This is exactly the path I'm considering, given
@DragonFlightDessign's response confirming that there are no SimVars for quaternions.

I would like to know if this solution, consisting of converting to quaternions to perform the calculations (LERPS) and returning to heading-pitch-bank to be able to send them with existing SimConnect variables, gives more satisfactory results compared to interpolation and sending Eulerian rotations.

By "more satisfactory," I mean smoothness of motion, absence of gimball look...

Thank you both, and best regards.
Janu
 
Hi Janu,

No, there are no SimVars for quaternions, I can guarantee you that. All you can set, as far as the object's location and attitude, is Latitude, Longitude, Altitude, and Roll, Pitch and Heading. This, however, is a location somewhere on a sphere, so there is a special coordinate system given for this case, and it is called NED (North-East-Down). It is basically a local cartesian coordinate system, whose plane is a tangent to Earth's sphere. More info on Wiki.

I am using Quaternions in my spaceflight physics module, and it is very smooth, and there is no gimbal lock. You can see that in the video below, where I control Capt. Sim's Space Shuttle Orbiter. From time index 0:40m to 1:00m, I pitch it 180 degrees (nose up, and it ends up upside down), and as you can see, it is very smooth and no gimbal lock.

 
Hi Misho
I'll thoroughly study the wiki link you provided.

As for the shuttle, what can I say? It's wonderful to see it rotate smoothly in all directions without losing its orbit. Marvelous! Congratulations on that masterful work.

A question about using quaternions: is the process you follow (which is the one I should follow) to work with them and then convert them into heading-pitch-bank rotations to send them with SetDataOnSimObject?

Thank you very much and best regards.
 
As for the shuttle, what can I say? It's wonderful to see it rotate smoothly in all directions without losing its orbit. Marvelous! Congratulations on that masterful work.
Thank you! What you see is actual forces being applied to a rigid body, not just applying angles to axis.
A question about using quaternions: is the process you follow (which is the one I should follow) to work with them and then convert them into heading-pitch-bank rotations to send them with SetDataOnSimObject?
Yes, that's the idea. Use quaternions for ALL your rotation calculations, then get Euler angles from the quaternions and apply them to SimObject(s). Quaternion C++ classes are available for free online and SHOULD provide robust functionality for conversion to Euler. If not, you can write your own. However, I need to warn you: this is very complicated stuff, and you need to be good at math, or, willing to learn and lose nerves and hair in the process the way I did :D Especially 3D vectors, matrices, quaternions, as they are all related and intertwined.

Good luck!
 
Last edited:
I'm taking careful note of your instructions, Misho.

I think I can handle vector and matrix calculus relatively well, but the transition from Euler to quaternions and vice versa is certainly tricky and will surely give me more than one unpleasant surprise.

I'm very grateful to both of you and will keep you posted on the process.

Best regards,
Janu
 
Back
Top