Strange, I copied over the FGNetFDM2Props function (commented out the
stuff that doesn't involve htond's and htonf calls, and I'm printing
out the current latitude, longitude, and altitude. The altitude is
coming through perfectly now (in meters), however, the latitude and
longitudes are screwy. Am I missing some further conversions? I'm
starting in the default airport:
fgfs --native-fdm='socket,out,30,localhost,5050,udp' \
--native-ctrls='socket,in,30,,5060,udp' \
--geometry=1024x768
My print statements:
cout<<"Packet is "<<numbytes<<" bytes long"<<endl;
FGNetFDM2Props( &fdm, true );
cout<<"Pos ("<<fdm.latitude<<", "<<fdm.longitude<<")"<<endl;
cout<<"altitude of: "<<fdm.altitude<<endl;
cout<<endl<<endl;
What I'm getting:
Packet is 392 bytes long
Pos (0.655888,-2.1361)
altitude of: 246.866
I go into the file->Browse internal properties, and the lat long's
look fine. What might I be missing here?
-Drew
That's when I was almost to a thousand feet altitude, so alt's working
great. The latitude and longitude are moving slightly. What am I
missing here?
On 3/3/06, Drew Kirkpatrick <[EMAIL PROTECTED]> wrote:
> Thanks Curt, I actually tried to grab the native_fdm.cxx function call
> FGNetFDM2Props( &fdm, false ) by including the header native_fdm.hxx
> and trying to link in all the lib*.a's. But I'm hopelessly lost in
> compile and linking errors.
>
> Think it would be easier if I look up that function and just
> reimplement it in my code. I'm sure that will get it working tonight.
> Thanks again, I'm sure I'll be bugging ya later with something...
>
>
>
> -Drew
>
>
> On 3/3/06, Curtis L. Olson <[EMAIL PROTECTED]> wrote:
> > Drew Kirkpatrick wrote:
> >
> > >Yeah, I'm using the native-fdm class as the data structure to receive
> > >the binary data, I think that's the data the udp packets is sending
> > >out when you register the native-fdm/socket/out bit to fgfs. Someone
> > >correct me if I'm wrong here? I just have my syntax boned up and am
> > >not reading the binary data correctly. Can't find my book with sockets
> > >stuff around here, think I left it at work. Anyone have an example of
> > >reading a udp stream with native-fdm protocol?
> > >
> > >
> > >
> >
> > By default I believe FG converts the data to network byte order, so you
> > will probably need to convert the numbers back to your native endianess
> > before they can be used. You could look in native_fdm.cxx to see how we
> > use htonl() and friends.
> >
> > Curt.
> >
> > --
> > Curtis Olson http://www.flightgear.org/~curt
> > HumanFIRST Program http://www.humanfirst.umn.edu/
> > FlightGear Project http://www.flightgear.org
> > Unique text: 2f585eeea02e2c79d7b1d8c4963bae2d
> >
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> > that extends applications into web and mobile media. Attend the live webcast
> > and join the prime developer group breaking into this new coding territory!
> > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> > _______________________________________________
> > Flightgear-users mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/flightgear-users
> >
>
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Flightgear-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-users