Dear George,
thank you for your reply. I have downloaded the application you suggested me but I did not find what I need.
In my scenario I have a simulation platform the determines orientation, position and velocities of several aircrafts; what I want to do is to send this information to a fgear multiplayer server by means of Flight Gear Multiplayer Protocol.

I tried to use (by porting them into C# code) the following code snippets (from multiplay.cxx and multiplaymgr.cxx):

// multiplay.cxx --------------------------------------------------------------
    // The quaternion rotating from the earth centered frame to the
    // horizontal local frame
    SGQuatf qEc2Hl = SGQuatf::fromLonLatRad((float)lon, (float)lat);
    // The orientation wrt the horizontal local frame
    float heading = ifce->get_Psi();
    float pitch = ifce->get_Theta();
    float roll = ifce->get_Phi();
    SGQuatf hlOr = SGQuatf::fromYawPitchRoll(heading, pitch, roll);
    // The orientation of the vehicle wrt the earth centered frame
    motionInfo.orientation = qEc2Hl*hlOr;

// multiplayermgr.cxx --------------------------------------------------------------
  SGVec3f angleAxis;
  motionInfo.orientation.getAngleAxis(angleAxis);
  for (unsigned i = 0 ; i < 3; ++i)
    PosMsg.orientation[i] = XDR_encode_float (angleAxis(i));



However, using the above code snippets I am not able to get "good" orientation values; for instance consider the following values...

lon = 0
lat = 0
heading = 0
pitch = 0
roll = 0

from these values I get the following orientation values...

qEc2Hl:
X: 0
Y: -0,7071068
Z: 0
W: 0,7071068

hlOr:
X: 0
Y: 0
Z: 0
W: 1


qEc2Hl*hlOr:
X: 0
Y: 0
Z: 0
W: 1


AngleAxis[]:
X: 0
Y: -0,999999965771459
Z: 0


Can you help me with this issue?
Thank you in advance for your support and cooperation.
Kind regards

Marco







> Date: Mon, 31 Aug 2009 11:36:03 +1000
> From: george.patterson@gmail.com
> To: flightgear-devel@lists.sourceforge.net
> Subject: Re: [Flightgear-devel] MP Protocol - aircraft orientation
>
> 2009/8/31 Marco Lecora <lecora_marco@hotmail.it>:
> > Hi,
> > I need to send from a C# application the position of several aircrafts to a flight gear multiplayer server.
> > The question is ... how can I get the aircraft orientation values from position, yaw, pitch and roll?
> > thank you in advance.
> > marco
> >
>
> Hi Marco,
>
>
> You are wanting to use the so-called generic protocol. This allows you
> to log what you wish.
>
> I found that the link below was very thorough. While I did not run the
> compiled binary (no MS Windows here), the set up instructions are
> very clear and helpful. (Especially if you are writing your own
> server.)
>
> http://geoffmclane.com/fg/fgfs-046.htm
>
> Let us know if you get stuck.
>
>
>
> George
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Flightgear-devel mailing list
> Flightgear-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Una risposta istantanea? Usa Messenger da Hotmail