Jump to content
The simFlight Network Forums

Pitch, Roll, Yaw value's out off FSUICP


 Share

Recommended Posts

Hello,

I want to read the Pitch, Roll and the Yaw out of fsuipc.

I made a program that reed the value out of FSX.

this is a part of my program;

Public Class MotionBase

Private Const AppTitle As String = "MotionBase"

' Register the Offsets we're interesing in for this application

Dim Pitch As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H3078)

Dim Roll As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H3080)

Dim Yaw As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H3088)

' Basic integer read example

Private serialPort As New IO.Ports.SerialPort

_____________________________________________________________________________________

' FSUIPC documentation for this offset and display the result.

Dim PitchDegrees = (Pitch.Value * 360.0# / (65536.0# * 65536.0#))

Me.TextPitch.Text = PitchDegrees

Dim RollDegrees As Double = (Roll.Value * 360.0# / (65536.0# * 65536.0#))

Me.TextRoll.Text = RollDegrees

Dim YawDegrees As Double = (Yaw.Value * 360.0# / (65536.0# * 65536.0#))

Me.TextYaw.Text = YawDegrees

_____________________________________________________________________________________

Private Function PitchDegrees() As String

Throw New NotImplementedException

End Function

Private Function RollDegrees() As String

Throw New NotImplementedException

End Function

Private Function YawDegrees() As String

Throw New NotImplementedException

End Function

post-39570-0-19359600-1359917337_thumb.j

I get stranges values (zie picture) the jump from a minus and maxium number will the plane is flying horizontal (pitch has to be zero than).

The 3078, 3080 and the 3088 acceleration in radians/sec/sec relative to the body axes in double floating point format.

If have try to translate the value to defrees like this;

DimYawDegrees As Double= (Yaw.Value /3.14159265# * 180#)

but it doesn't seem to help.

I want the value in a range of -50 degrees to +50 degrees to juse for a servo.

How can I do that??? (I'm sorry I'm still learning the programm language) :oops:

Link to comment
Share on other sites

I want to read the Pitch, Roll and the Yaw out of fsuipc.

I made a program that reed the value out of FSX.

' Register the Offsets we're interesing in for this application

Dim Pitch As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H3078)

Dim Roll As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H3080)

Dim Yaw As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H3088)

You do realise these are accelerations, not the actual current pitch, roll and yaw values? Also they are 64-bit ("double") floating point numbers, not integers. You are only reading the least significant 32-bits as if they are integers, which will give you rubbish. Please do actually read the details provided in the Offsets list which tell you all this.

I want the value in a range of -50 degrees to +50 degrees to juse for a servo.

Accelerations are NEVER "in degrees", degrees per second per second maybe. Velocities are in radians or degrees per second, only the actual angles can be measured in degrees.

Pete

Link to comment
Share on other sites

Hello Pete,

Thanks for the reply.

I thought I read in a topic that I have to juse the acceleration value?

And yes you are right it is given in rad/sec/sec.

I want to built a 6 DOF motionbase, but I have little knowledge of programming.

Thats why I try to read the value first to visual basic.

I have also thried the 0578 (fsuipc offset) but I can't get a decent value out of it.

So thanks for your reply.

I will try to find the the actual current pitch, roll and yaw values

Thanks and greeting,

Henk (Holland)

Link to comment
Share on other sites

I thought I read in a topic that I have to juse the acceleration value?

For a motion platform, yes, the aceleration values are the best source, because the pilot only feels accelerations, not velocities or angles. But you said you were expecting it to be between -50 and +50 degrees. Accelerations are not angular measurements like that.

I want to built a 6 DOF motionbase, but I have little knowledge of programming.

Such a project seems rather advanced for someone without programming experience.

I have also thried the 0578 (fsuipc offset) but I can't get a decent value out of it.

0578 is the pitch value, and that is an angle, and furthermore it is an integer. it represents the pitch in FS's own internal units. The conversion formula is provided in the offsets list.

I will try to find the the actual current pitch, roll and yaw values

They are Pitch, Bank and Heading, in offsets 0578, 057C and 0580, and all in the same units. So that is easy. but I don't know what you think you'd do with them to drive a platform. If you want the platform merely to adopt those angles, then it will be much like one of those toy motion devices which are designed to amuse children rather than a proper motion simulator. I'm pretty sure that the correct way is to use scaled versions of the accelerations to determine speed and direction of lift and drop, follwed by a period of "wash-out" to let things level out again without the pilot noticing, ready for the next accelerations.

However, I'm certainly no expert on the matter, only explaining what i believe and have read. You need to do your own research. But I do know it isn't easy, and can involve some sophisticated programming.

Regards

Pete

Link to comment
Share on other sites

Hi Pete,

Thanks for the information.

Yes, you're right Ineed more information.

That's why I looking on Google and this forum.

I'm trying to understand the language of visuel basic and the Arduin Uno.

With every little step forwart I as happy as a child :mrgreen: .

So Thanks for your time and information.

I'm verry pleased with the registerd FSUIPC.

I't a wonderful program.

Thanks!!!

Link to comment
Share on other sites

  • 1 year later...

Hello,

 

I'm a new programmer with FSUIPC  :razz:  But I've some problems or questions.
I try to read pitch, bank and heading value.
I've done that :

private Offset<float> heading = new Offset<float>(0x0580); //Read the heading value
private Offset<float> bank = new Offset<float>(0x057C);//Read the Bank(Roll) value
private Offset<float> pitch = new Offset<float>(0x0578);//Read the Pitch value

But when I read the value of the pitch, for example, I've this result :

PITCH OFFSET VALUE : -2.26553752912112E+304

 

and with the convertion : pitch.Value * 360f / (65536f * 65536f);

 

I've this result : PITCH VALUE : -1.89895162005816E+297

 

I don't understand what can I do with this big value  :???:

 

My project is :
Make a Communication between FSX and Unity3d, with your dll, FSUIPC.dll

 

Thank you in advance for your answer.

Link to comment
Share on other sites

Hello again,

 

I try with one of your answer, with a floating variable like this :

float newNewPitch = pitch.Value;
newPitch = newNewPitch * 360f / (65536f * 65536f);

newPitch is a float variable.

 

This time my result is PITCH OFFSET VALUE : 9.232419E-38 without conversion

with conversion8.407791E-45

 

Have you an idea ?

Thank you again.

Link to comment
Share on other sites

Blackhawk,

 

The offsets are declared with a type according to the offset size, not the data type you will eventually convert the raw data into.

 

Please review my UserGuide.pdf that comes in the zip file, especially page 7 which explains which c# types you need to use with different offset sizes. If you don't understand this you'll never be able to use the DLL properly.

 

If you need more help, you can ask in my sub-forum under this one.

 

Paul

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.