October 18, 200520 yr Hello,I'm developping for fun an autopilot as an external exe module. I experience a major trouble : the time to get and send the props is quite long : 2,5 secs per cycle. It is impossible to get a stable flight with such an interval, also with a good PID algo...Anyone an idea ?ThanksJ
October 18, 200520 yr >Hello,>>I'm developping for fun an autopilot as an external exe>module. I experience a major trouble : the time to get and>send the props is quite long : 2,5 secs per cycle. It is>impossible to get a stable flight with such an interval, also>with a good PID algo...>>Anyone an idea ?Hi,while your question is probably better asked and answered on the FlightGear Devel list where developers regularly check for- and reply to such inquiries, I can tell you that there are various ways to interface with FlightGear. Given that you are complaining about the lag, you seem to be using the plaintext telnet (i.e. generic) interface for transfers of multiple properties?This particular interface was certainly never intended to be "high-bandwidth", rather it was meant to be a simple way to satisfy average requirements. Likewise, the update interval for the telnet interface is not particularly high. So, while the telnet interface is currently certainly one of the most convenient net interfaces for FlightGear, it isn't really suited for high performance transfers from/to FlightGear without modifications.However, in order to really determine whether this is your actual problem, you should minimally tell us how many properties you poll or set per interval.Also, the best approach would probably be to simply create a customized hardcoded interface for your autopilot project, if you look unter $FG_SRC/Network, you'll find the various hardcoded network interfaces (protocols, that is) for FlightGear. These are generally based on binary transmission of data (variables), using structs sent mainly via UDP.Basically, you could simply take an existing set of source files, rename and modify them to your needs, and add them to your compiler's Makefile.You will then want to add corresponding support for your newly created interface to the options.* files, as well as possibly the options.xml file under $FG_ROOT. So, in the end you could easily tell FlightGear to run your custom protocol with arbitrary update intervals.If you aren't all that familiar with C++ programming and UDP, the easiest solution to your problem would probably be to simply speed up the update interval for the telnet protocol, additionally or alternatively you might also want to look into XML configurable protocols, these can be easily created using PropertyList encoded XML files, and because of the pre-configured variables that will be transferred, they can reduce the transmission overhead somewhat. Simply look unter $FG_ROOT/Protocol and make sure to take a look at the README files within this folder, as well as the I/O related README files under $FG_ROOT/Docs in general.Also, you will probably want to subscribe to the FlightGear Devel mailing list and possibly search the mailing list archives as well, simply because interfacing external software with FlightGear can certainly be considered to be one of the most FAQ.Additionally, please note that it might be prudent to think about implementing your application in a non-platform dependent fashion if you intend to make it available to a broader audience. So, depending on how much of your application has already been fininshed, it may be viable to think about using cross-platform GUI toolkits such as wxWidgets for the GUI part and cross-platform networking libraries such as "the torque network library" for the network I/O. As another aside, please note that FlightGear has already several initial implementations of autopilots integrated, as well as support for PID controllers. Thus, it might be an interesting option to simply take the current source code and adapt it to your needs, that way you would ultimately also ensure that your code might possibly be suitable for inclusion into the official FlightGear source tree.
October 19, 200520 yr Hi,Thank's for your full answer.I will have a look in the network dir, and direct my futures requests in the good forum.Have a nice day !J
October 21, 200520 yr >Hi,>>Thank's for your full answer.>>I will have a look in the network dir, and direct my futures>requests in the good forum.Well, it's not really a web based forum, rather it's a MAILING LIST, where you have to subscribe to (look at flightgear.org / Lists) and then discussions are held via E-Mail.
Create an account or sign in to comment