Re: [Flightgear-devel] Aerobatics using flight gear and JSBSim

2006-06-14 Thread Hugo Vincent
Sorry about that, prematurely hit send. Here is the link:http://forums.x-plane.org/index.php?showtopic=13050st=0Might be interesting, or maybe even relevant to modelling things like snap rolls in JSBSim.
Regards,Hugo Vincent.On 6/15/06, Hugo Vincent [EMAIL PROTECTED] wrote:
I came across this discussion about adding a new open source FDM toX-Plane, using CFD methods to get really really high fidelity models.On Wed, 2006-06-14 at 20:32 -0500, Jon S. Berndt wrote: Snap roll:
 This is indeed the recipe for a snap roll: starting from a speed slightly above the stall, apply a sudden yaw with the rudder, apply opposite aileron, and pull back on the yoke. SNAP! --- One wing stalls and the plane rolls
 over. [I liked the clever use of the word, recipe with the phrase snap *roll*] This would be hard to model using lookup tables, but it might be possible
 using JSBSim functions and a table or tables, together. Could be fun. I need to think about this one. The first idea that comes to mind is that if the aircraft speed minus the yaw rate times some characteristic lateral length
 (span/2?) falls below the stall speed, then a rolling moment would be generated - maybe a yawing moment, too. Jon ___
 Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net 
https://lists.sourceforge.net/lists/listinfo/flightgear-devel
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Aerobatics using flight gear and JSBSim

2006-06-14 Thread Hugo Vincent
I came across this discussion about adding a new open source FDM to
X-Plane, using CFD methods to get really really high fidelity models.


On Wed, 2006-06-14 at 20:32 -0500, Jon S. Berndt wrote:
 Snap roll:
 
 This is indeed the recipe for a snap roll: starting from a speed slightly
 above the stall, apply a sudden yaw with the rudder, apply opposite aileron,
 and pull back on the yoke. SNAP! --- One wing stalls and the plane rolls
 over.
 
 [I liked the clever use of the word, recipe with the phrase snap *roll*]
 
 This would be hard to model using lookup tables, but it might be possible
 using JSBSim functions and a table or tables, together. Could be fun. I need
 to think about this one. The first idea that comes to mind is that if the
 aircraft speed minus the yaw rate times some characteristic lateral length
 (span/2?) falls below the stall speed, then a rolling moment would be
 generated - maybe a yawing moment, too.
 
 Jon
 
 
 
 ___
 Flightgear-devel mailing list
 Flightgear-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/flightgear-devel



___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] apt.dat changes ?

2006-06-12 Thread Hugo Vincent

On 12/06/2006, at 9:37 PM, Thomas Förster wrote:
 snip
 Of course this also means that only an svg editor is not enough to  
 fully
 specify an airport.

In the case of Inkscape (I don't know about any of the other SVG  
editors), a reasonably simple plugin should suffice for editing the  
non-graphical aspects of the airport layout.

___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] Generic Protocol (generic.cxx etc) - Binary Mode

2006-04-26 Thread Hugo Vincent
Any one had a chance to look over the patch yet?What needs to be changed/fixed/rewritten/redesigned(!) before it can be applied to the main CVS version?Hugo.On 4/25/06, 
Hugo Vincent [EMAIL PROTECTED] wrote:
Thanks Erik,Here is the patch. Let me know what needs to be changed, fixed, orrefactored before it can go into CVS. Note that at this point, thebinary protocol is output only.Also attached is a really simple protocol to test the patch
(bintest.xml). Run FGFS with:$ fgfs ... --generic=file,out,24,bintest_out,bintestAs well, there is a Python script (sorry, the script is a horribly dirtyhack) to decode and print the results. Execute it with:
$ python test_decode.pyTo do list for the generic binary support:* use ntohl() etc to make the protocol independent of host endianess.* add CRC checksum as a possible packet footer* add binary input support
* test thoroughlyCheers,Hugo VincentOn Mon, 2006-04-24 at 09:59 +0200, Erik Hofman wrote: Hugo Vincent wrote:  I also updated OpenGC for this change and made a OpenGC.xml
 protocol  file, but it appears the OpenGC project is more or less dead. Also,  Network/opengc.cxx is a bit of a mess and seemingly unmaintained; it  might be nice to get rid of it and replace it with a XML file at some
  stage. One approach is to directly replace opengc.cxx with an XML file  that emulates the structure of the ogcFGData class, - however different  compilers probably pad the variables in the class differently (for
  alignment/efficiency), so a patch to OpenGC does need to be made.   If anyone wants the generic binary mode patch, or better yet, wants to  add it into the main FlightGear repository, reply (to the list).
   Also, if anyone else has uses or requirements for binary protocols, let  discuss them here, so that we can make generic binary support as broad  and applicable as possible.
 I think it would be valuable, exactly for the reason mentioned above. Erik


Re: [Flightgear-devel] Generic Protocol (generic.cxx etc) - Binary Mode

2006-04-24 Thread Hugo Vincent
Thanks Erik,

Here is the patch. Let me know what needs to be changed, fixed, or
refactored before it can go into CVS. Note that at this point, the
binary protocol is output only.

Also attached is a really simple protocol to test the patch
(bintest.xml). Run FGFS with:
$ fgfs ... --generic=file,out,24,bintest_out,bintest

As well, there is a Python script (sorry, the script is a horribly dirty
hack) to decode and print the results. Execute it with:
$ python test_decode.py

To do list for the generic binary support:
* use ntohl() etc to make the protocol independent of host endianess.
* add CRC checksum as a possible packet footer
* add binary input support
* test thoroughly

Cheers,
Hugo Vincent


On Mon, 2006-04-24 at 09:59 +0200, Erik Hofman wrote:
 Hugo Vincent wrote:
 
  I also updated OpenGC for this change and made a OpenGC.xml protocol
  file, but it appears the OpenGC project is more or less dead. Also,
  Network/opengc.cxx is a bit of a mess and seemingly unmaintained; it
  might be nice to get rid of it and replace it with a XML file at some
  stage. One approach is to directly replace opengc.cxx with an XML file
  that emulates the structure of the ogcFGData class, - however different
  compilers probably pad the variables in the class differently (for
  alignment/efficiency), so a patch to OpenGC does need to be made. 
  
  If anyone wants the generic binary mode patch, or better yet, wants to
  add it into the main FlightGear repository, reply (to the list).
  
  Also, if anyone else has uses or requirements for binary protocols, let
  discuss them here, so that we can make generic binary support as broad
  and applicable as possible.
 
 I think it would be valuable, exactly for the reason mentioned above.
 
 Erik
 
 


bintest.xml
Description: application/xml
Index: Protocol/README.Protocol
===
RCS file: /var/cvs/FlightGear-0.9/data/Protocol/README.Protocol,v
retrieving revision 1.2
diff -u -p -r1.2 README.Protocol
--- Protocol/README.Protocol	22 Jun 2003 08:02:28 -	1.2
+++ Protocol/README.Protocol	25 Apr 2006 01:19:39 -
@@ -1,5 +1,5 @@
 The generic communication protocol for FlightGear provides a powerfull way
-of adding a simple ASCII based output only protocol, just by defining an
+of adding a simple ASCII based or binary protocol, just by defining an
 XML encoded configuration file.
 
 The definition of the protocol consists of variable separators, line separators,
@@ -16,8 +16,9 @@ Each chunck defines:
 			%s	string
 			%i	integer	(default)
 			%f	float
+		(not used or needed in binary mode)
 
-factor	an optionale multiplication factor which can be used for
+factor	an optional multiplication factor which can be used for
 		unit conversion. (for example, radians to degrees).
 offset	an optional offset which can be used for unit conversion.
 		(for example, degrees Celsius to degrees Fahrenheit).
@@ -44,6 +45,16 @@ any other charachters just need to be ad
 The var_separator is placed between each variable, while the line_separator is
 placed at the end of each lot of variables.
 
+To enable binary mode, simply include a binary_modetrue/binary_mode tag in
+your XML file. The format of the binary output is tightly packed, with 1 byte for
+bool, 4 bytes for int, and 8 bytes for double. At this time, strings are not
+supported. A configurable footer at the end of each line or packet of binary
+output can be added using the binary_footer tag. Options include the length
+of the packet, a magic number to simplify decoding. Examples:
+
+	binary_footermagic,0x12345678/binary_footer
+	binary_footerlength/binary_footer
+	binary_footernone/binary_footer			!-- default --
 
 A simple protocol configuration file then could look something like the
 following:
@@ -57,6 +68,7 @@ following:
   output
line_separatornewline/line_separator
var_separatornewline/var_separator
+   binary_modefalse/binary_mode
 
chunk
 namespeed/name
Index: src/Network/generic.cxx
===
RCS file: /var/cvs/FlightGear-0.9/source/src/Network/generic.cxx,v
retrieving revision 1.17
diff -u -p -r1.17 generic.cxx
--- src/Network/generic.cxx	9 Mar 2006 21:41:51 -	1.17
+++ src/Network/generic.cxx	25 Apr 2006 01:41:26 -
@@ -79,51 +79,99 @@ FGGeneric::~FGGeneric() {
 
 // generate the message
 bool FGGeneric::gen_message() {
-
 string generic_sentence;
 char tmp[255];
+length = 0;
 
 double val;
 
 for (unsigned int i = 0; i  _out_message.size(); i++) {
 
-if (i  0)
+if (i  0  !binary_mode)
generic_sentence += var_separator;
 
 switch (_out_message[i].type) {
 case FG_INT:
 val = _out_message[i].offset +
   _out_message[i].prop-getIntValue() * _out_message[i].factor;
-snprintf(tmp, 255, _out_message[i].format.c_str(), (int)val);
+if (binary_mode) {
+*((int

[Flightgear-devel] Generic Protocol (generic.cxx etc) - Binary Mode

2006-04-23 Thread Hugo Vincent
Hi everyone,

I am new to FlightGear and am using it for a UAV project (yep, yet
another one - see http://www.albatross-uav.org).

I need FlightGear to output binary-formatted data into UDP packets to
support a custom protocol used in the system (that is, to have data from
FlightGear look like data coming from the UAV, to test the ground
station software etc.). 

There has been talk on the mailing list before (e.g. here:
http://www.opensubscriber.com/message/flightgear-devel@flightgear.org/1750238.html
by Michael Meyers) about added binary support to the generic protocol,
but it seems nothing was done about it. 

I added basic binary mode support to Network/generic.cxx that is enabled
with a binary_modetrue/binary_mode tag in the protocol XML file. The
patch is quite small, and if the binary_mode tag is not found it does
not fail (meaning any existing protocol XML files continue to work). As
well as supporting simple packed binary output, configurable data can be
added at the end of each packet (aka line in ASCII protocols), such as
a magic number, or the length of the packet. Other things like a CRC
checksum of the packet could be added easily.

I also updated OpenGC for this change and made a OpenGC.xml protocol
file, but it appears the OpenGC project is more or less dead. Also,
Network/opengc.cxx is a bit of a mess and seemingly unmaintained; it
might be nice to get rid of it and replace it with a XML file at some
stage. One approach is to directly replace opengc.cxx with an XML file
that emulates the structure of the ogcFGData class, - however different
compilers probably pad the variables in the class differently (for
alignment/efficiency), so a patch to OpenGC does need to be made. 

If anyone wants the generic binary mode patch, or better yet, wants to
add it into the main FlightGear repository, reply (to the list).

Also, if anyone else has uses or requirements for binary protocols, let
discuss them here, so that we can make generic binary support as broad
and applicable as possible.

Cheers,
Hugo Vincent.




---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel