Re: [Flightgear-devel] Determining range?
Dave Culp wrote: ... how do I get the distance from my current Lat/Long to another Lat/Long? There's a function in SimGear that does this. See SimGear/simgear/math/sg_geodesy.cxx for a function called int geo_inverse_wgs_84() This may be overkill for your application. Dave Don't forget to check the reference : http://williams.best.vwh.net/avform.htm (Aviation Formulary ) Harald. ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] Determining range?
On Saturday 17 September 2005 23:48, Mike Kopack wrote: Hey gang, As part of my simulated UAV control system project, I needed to augment the built in Autopilot system in FG with a module in my own system (which is written in java) that takes the aircraft's current position, and a desired position (lat/long/altitude/desired arrival time) and figures out the proper autopilot heading to lock to and altitude locks etc. Now, I'd like to figure out how to handle that last variable: Arrival time. To do it, I need to know how far I have left to travel, and how long I have to get there. The time isn't a problem, but how do I get the distance from my current Lat/Long to another Lat/Long? My investigations online show that there's no real way to directly convert from Lat/Long to meters. I know that the GPS system in FG calculates this distance. I just need to know what the formulas are that are used to arrive at this distance. Hi Mike Take a look at Aviation Formulary V1.42 http://williams.best.vwh.net/avform.htm It has everything you'll ever need formula wise for great circle navigation. Distance, initial course, cross track error, working out an enroute point at x distance from the origin along the route, etc It uses a spherical earth model which means there is a maximum error of about 0.2% which should be acceptable if I'm not mistaken. There is a worked examples section. Distance between points d=2*asin(sqrt((sin((lat1-lat2)/2))^2 + cos(lat1)*cos(lat2)*(sin((lon1-lon2)/2))^2)) The distance from LAX to JFK is === d = 2*asin(sqrt((sin((lat1-lat2)/2))^2+ cos(lat1)*cos(lat2)*(sin((lon1-lon2)/2)^2)) = 2*asin(sqrt((sin(0.592539-0.709186)/2))^2+ cos(0.592539)*cos(0.709186)*(sin((2.066470-1.287762)/2)^2)) = 2*asin(sqrt((-0.05829)^2 +0.829525*0.758893*0.379591^2)) = 2*asin(0.306765) = 0.623585 radians = 0.623585*180*60/pi=2144nm or d = acos(sin(lat1)*sin(lat2)+cos(lat1)*cos(lat2)*cos(lon1-lon2)) = acos(sin(0.592539)*sin(0.709186)+ cos(0.592539)*cos(0.709186)*cos(0.778708)) = acos(0.811790) = 0.623585 radians = 0.623585*180*60/pi=2144nm The initial true course out of LAX is: == sin(-0.778708)=-0.7020 so tc1 = acos((sin(lat2)-sin(lat1)*cos(d))/(sin(d)*cos(lat1))) = acos((sin(0.709186)-sin(0.592539)*cos(0.623585))/ (sin(0.623585)*cos(0.592535)) = acos(0.408455) = 1.150035 radians = 66 degrees Regards Paul ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
[Flightgear-devel] new multiplayer patch
Hi list. I have prepared a new patch for multiplayer, which fixes endianess issues with multiplayer code. It's basically identical to the patch I sent before my vacation, but contains minor fixes. Multiplayer should now be working under all unix-like environments and windows native. The basic trick is to let configure check for endianess of the host system. It will not work on system not using configure in the build process (excluding windows), ie. possibly MACOS. For those system we should provide #ifdefs in tiny_xdr.hpp. The patch is available at http://www.o-schroeder.de/fg_server/patch.php The patch has proven to be stable during my vacation, so I suggest to put it into cvs. regards, Oliver ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
[Flightgear-devel] BUG: current cvs does not compile under linux
Hi list. The current cvs version of flightgear does not compile under linux. The error message is: cut g++ -DHAVE_CONFIG_H -I. -I. -I../../src/Include -I../.. -I../../src -I/usr/X11R6/include -I/usr/local//include -g -O2 -D_REENTRANT -c jpg-httpd.cxx In file included from jpg-httpd.cxx:46: jpg-httpd.hxx:38:43: simgear/screen/jpgfactory.hxx: No such file or directory In file included from jpg-httpd.cxx:46: jpg-httpd.hxx: In constructor `HttpdImageChannel::HttpdImageChannel()': jpg-httpd.hxx:69: error: invalid use of undefined type `struct trJpgFactory' jpg-httpd.hxx:53: error: forward declaration of `struct trJpgFactory' jpg-httpd.hxx:73: error: `init' undeclared (first use this function) [...] cut A quick fix is to use an undocumented configure option: ./configure --without-jpeg-factory (this option should show up when ./configure --help is called) regards, Oliver ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] BUG: current cvs does not compile under linux
Am Sonntag 18 September 2005 11:03 schrieb Oliver Schroeder: A quick fix is to use an undocumented configure option: ./configure --without-jpeg-factory Ok, another fix is to configure simgear: ./configure --with-jpeg-factory So, the defaults in configure should be changed. Either for simgear or for flightgear. regards, Oliver ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] new multiplayer patch
Oliver Schroeder wrote: Hi list. I have prepared a new patch for multiplayer, which fixes endianess issues with multiplayer code. It's basically identical to the patch I sent before my vacation, but contains minor fixes. Multiplayer should now be working under all unix-like environments and windows native. The basic trick is to let configure check for endianess of the host system. It will not work on system not using configure in the build process (excluding windows), ie. possibly MACOS. For those system we should provide #ifdefs in tiny_xdr.hpp. Hi Oliver, I've committed a modified patch. First of all I've used the #if BYTE_ORDER == BIG_ENDIAN preprocessor directive to detect endianness instead of using the autoconf FOO. Secondly I've updated the code to use the ulEndianSwap() function instead of defining our own (my system doesn't even define byteswap.h). All in all the code is much cleaner now. Thanks for the patch. Erik ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
[Flightgear-devel] Build problem with today's CVS update
Hello, Updated my source copy this morning, including the endian patches. Several tries, including a full autogen.sh in simgear and flightgear, don't yield a full compile. Simgear compiles without error reported. Flightgear builds until it gets to the /FDM/ExternalNet directory. There the compile of externalnet.cxx includes simgear/io/lowlevel.hxx, which references simgear_config.h, and that is not found. I located simgear_config.h in the simgear/ directory here. Sounds like a path problem? -- Bill Earnest [EMAIL PROTECTED] Linux Powered Allentown, PA, USA Computers, like air conditioners, work poorly with Windows open. ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] Build problem with today's CVS update
William D. Earnest wrote: Hello, Updated my source copy this morning, including the endian patches. Several tries, including a full autogen.sh in simgear and flightgear, don't yield a full compile. Simgear compiles without error reported. Flightgear builds until it gets to the /FDM/ExternalNet directory. There the compile of externalnet.cxx includes simgear/io/lowlevel.hxx, which references simgear_config.h, and that is not found. I located simgear_config.h in the simgear/ directory here. Sounds like a path problem? I'm having the same problem here. While simgear_config.h can be found in the source tree it doesn't appear to get installed. Is this a problem in the simgear makefile (and simgear_config.h *should* be installed), or a problem in lowlevel.hxx (in that it shouldn't be referencing simgear_config.h) Jon ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
[Flightgear-devel] Release 0.0.7 of Digitrak Autopilot
To everyone who has helped, thanks. My goal is to model the behaviors and capabilities of the Digitrak with as much accuracy is possible given my ability and the limitations of Flight Gear. I doubt it would be possible or desirable to model the electrical characteristics of the sensors or reverse engineer the actual code. The short term goal is to model the basic behavior of the autopilot, to get the basic modes working, then see what is possible. My long term goal is to model the building blocks, the gyros, the magnetic compass and let those feed into the autopilot's calculations. This will help model the autopilot without depending on any of the other instruments. The ultimate goal would be to model it well enough to use as a training tool. I will continue to use the orientation properties from the flight model as a way of modeling the digital gyro input until I can look into coding my own gyro. Flight Gear has made it possible to do more than put a face on a standard autopilot, for which I am grateful. Although the controller derived from the standard autopilot may not model the actual Digitrak in detail, I think that with the exception of turbulence handling the behavior should be very similar to other autopilots for most normal capabilities. Holding a heading is holding a heading, making standard turn is making a standard turn. The main difference is the GPS intensive nature of the navigation. The latest version is http://www.city-gallery.com/vpilot/flightgear/digitrak-debug-0.0.7.zip which supports the GPS Track and Heading Hold modes (to get the latter you must fail the gps by setting gps-valid to 'off' in properties. The next capability to tackle is following a flight plan. Feel free to comment or make corrections, Steve ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
RE: [Flightgear-devel] Release 0.0.7 of Digitrak Autopilot
To everyone who has helped, thanks. My goal is to model the behaviors and capabilities of the Digitrak with as much accuracy is possible given my ability and the limitations of Flight Gear. I doubt it would be possible or desirable to model the electrical characteristics of the sensors or reverse engineer the actual code. The short term goal is to model the basic behavior of the autopilot, to get the basic modes working, then see what is possible. My long term goal is to model the building blocks, the gyros, the magnetic compass and let those feed into the autopilot's calculations. This will help model the autopilot without depending on any of the other instruments. The ultimate goal would be to model it well enough to use as a training tool. Just out of curiosity, have you looked at the flight control system modeling capabilities in JSBSim? I realize that limits you to JSBSim aircraft, which in itself might be a show-stopper. Also, the newest and most useful features are in the codebase which has not yet quite made it into FlightGear CVS. However, it still might be interesting for you. the JSBSim FCS model that will be [shortly?] placed into the FlightGear branch features: - Sensor modeling (for scalar values - not vectors, yet) that features some failure modes controllable via properties. - Sensors can output quantized values of arbitrary bit width. - Sensors can feature noise and drift. - The flight control system components include generic filters and an integrator. - There is a function component that can model a user-defined function that includes sine, cosine, abs, etc. functions. - Other components include summers, gains, scheduled gains, scale-mapping, switches, and kinematic controls (for modeling landing gear, aerosurfaces, etc.) You can read about the flight control system more in some of the JSBSim newsletters. I've already implemented a test autopilot. It's a lot of fun to play with. The point is that you have complete control. Just an idea. Jon ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] Build problem with today's CVS update
Jon Stockill wrote: I'm having the same problem here. While simgear_config.h can be found in the source tree it doesn't appear to get installed. Is this a problem in the simgear makefile (and simgear_config.h *should* be installed), or a problem in lowlevel.hxx (in that it shouldn't be referencing simgear_config.h) Argh, sorry folks, my bad. I thought I had figured it all out ... but forgot this file gets installed and hence simgear_config.h isn't available anymore. This is fixed again. Erik ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d