Re: [Flightgear-devel] how to find remaining fuel
Hi, I seemed to have had a feature in my code that caused the tanks to be filled making me think that the tanks were increasing in fuel. The code seems to work correctly now. Thanks, Seamus On Mon, 28 Feb 2005, Andy Ross wrote: Seamus Thomas Carroll wrote: The fuel levels seem to retrieve correctly. I then added the following code to set the fuel levels for when the c172 aircraft starts: fgSetDouble( /consumables/fuel/tank[0]/level-gal_us, tank1 ); fgSetDouble( /consumables/fuel/tank[1]/level-gal_us, tank2 ); The 172 is a JSBSim aircraft, so Jon or one of the JSB crew will have to provide specifics about this particular situation. But for YASim aircraft (really: users of the Nasal fuel system), this will not work. You can set the current fuel only using the level-lbs properties. The -gal_us and -norm are output-only convenience properties that may be useful to panel code. Setting them is a noop; their values will be clobbered by the FDM. If I remember correctly, JSBSim does not currently support setting fuel state through the property system. Instead, since you are in C++, you should be able to find an interface there. Andy ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] how to find remaining fuel
Hi, I am using the following piece of code to read the fuel levels: double fueln = 0; // get the fuel levels; for( int count = 0; count 7; count++ ) { string tank = /consumables/fuel/tank[+ su-intTostring(count)+]/level-gal_us; cout setprecision(6) tank count : setw(10) fgGetDouble( tank.c_str() ) endl; fueln = fueln + fgGetDouble( tank.c_str() ); } The fuel levels seem to retrieve correctly. I then added the following code to set the fuel levels for when the c172 aircraft starts: fgSetDouble( /consumables/fuel/tank[0]/level-gal_us, tank1 ); fgSetDouble( /consumables/fuel/tank[1]/level-gal_us, tank2 ); Now when i read the fuel levels strange things start to happen. At time 21 seconds the tanks read as: tank 0: 2.624356 tank 1: 2.624356 tank 2: 0.00 tank 3: 0.00 tank 4: 0.00 tank 5: 0.00 tank 6: 0.00 At time 25 seconds the tanks read as: tank 0: 2.641097 tank 1: 2.641097 tank 2: 0.00 tank 3: 0.00 tank 4: 0.00 tank 5: 0.00 tank 6: 0.00 There his more fuel at time 25 then at time 21. I assume i must be setting the fuels levels incorrectly. Does anyone know of a different method? Thanks, Seamus On Fri, 4 Feb 2005, Andy Ross wrote: I found time this afternoon to refresh my memory about how the fuel stuff works. The FDM reads these properties to determine the amount of fuel in each tank. YASim uses this only for computing the inertia tensor and total aircraft mass, it doesn't care about fuel per se. /consumables/fuel/tank[n]/level-lbs The FDM reads the following boolean property to determine whether to kill an engine: /engines/engine[n]/out-of-fuel The FDM *adds* to this property to contain a running total of fuel consumed for each engine. If it currently has a value of 7, and this timestep 4.2 lbs of fuel were consumed by this engine, then it should be set to 11.2. /engines/engine[n]/fuel-consumed-lbs And that's it. Everything else related to fuel, including user-configurability of tank selection and/or filling, is handled by the nasal script/gui for you. IMHO, it's really about as simple for the FDM as is possible. Andy ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
[Flightgear-devel] How to check if plane is fully initialized
Hi, Thanks for all the help with the fuel issue. I am curios if there is a way to check if the plane has been fully initialized. It seems to me that fgMainLoop starts executing about 6 seconds before the plane is fully initialized. I would like to call my update functions only after the initialization is fully complete. Thanks, Seamus ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
Re: [Flightgear-devel] how to find remaining fuel
I have been using the c172 aircraft. Is it controlled by jsbsim or ysim? Thanks, Seamus On Fri, 4 Feb 2005, Innis Cunningham wrote: Lee Elliott writes /consumables/fuel/total-fuel-norm gives the total remaining fuel, normalised to 0-1. Hmm.Dont know that this is available under jsbsim. LeeE Cheers Innis ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
[Flightgear-devel] how to find remaining fuel
Hi, I am trying to find the variable that contains the remaining fuel on a plane. Also, is there a variable that contains the current km per litre? Thankyou, Seamus ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
RE: [Flightgear-devel] how to find remaining fuel
Hi, If i was able to find the avialable fuel property i could work out a kmperlitre based on distance travelled and fuel consumed over a period of time. Doesnt a plane run out of fuel after a period of time? I tried grepping for fuel and the word fuel must have shown up 100 times and none popped out at me as being the one i was looking for. Seamus On Thu, 3 Feb 2005, Innis Cunningham wrote: Hi Seamus Seamus Thomas Carroll writes Hi, I am trying to find the variable that contains the remaining fuel on a plane. I dont think there is a total fuel onboard or fuel remaining property. I asked about this a couple of weeks back and got no reply(I think). Also, is there a variable that contains the current km per litre? I would not think so.But you should be able to find a lbs/hour property in the engines property or the consumables property. Thankyou, Seamus Cheers Innis ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d ___ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d
[Flightgear-devel] Neither GL/glut.h nor GLUT/glut.h found. Cannot continue
Hi, I have installed plib and simgear and GL/glut.h is found in the configure but when i configure flight gear i get the following error: checking GL/glut.h usability... no checking GL/glut.h presence... no checking for GL/glut.h... no checking GLUT/glut.h usability... no checking GLUT/glut.h presence... no checking for GLUT/glut.h... no Neither GL/glut.h nor GLUT/glut.h found. Cannot continue Does anyone know what may be causing this problem? Seamus ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Neither GL/glut.h nor GLUT/glut.h found. Cannot continue
sorry, turns out there is no GL/glut.h. I apologize for wasting anyones time. Seamus On Fri, 28 May 2004, Seamus Thomas Carroll wrote: Hi, I have installed plib and simgear and GL/glut.h is found in the configure but when i configure flight gear i get the following error: checking GL/glut.h usability... no checking GL/glut.h presence... no checking for GL/glut.h... no checking GLUT/glut.h usability... no checking GLUT/glut.h presence... no checking for GLUT/glut.h... no Neither GL/glut.h nor GLUT/glut.h found. Cannot continue Does anyone know what may be causing this problem? Seamus ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] How to get cesna to follow a set of way points.
Hi Jim, I was the one who asked this question but when i tried to implement the solution it resulted in the same flight behaviour. I will detail the changes i implemented so you can see if i did anything incorrectly. 1) I changed, in file Aircraft/c172/c172-610x-null-set.xml, pathAircraft/c172/610x-autopilot.xml/path to pathAircraft/Generic/generic-autopilot.xml/path 2) I call the program passing in aircraft=c172. When a waypoint is added the plane still flys in circles and does not fly towards the waypoint, Seamus On Thu, 20 May 2004, Jim Wilson wrote: Just change the autopilot back to the generic version in the *-set.xml file. This was answered within the last couple of weeks but maybe it was someone else asking the same question. Best, Jim Seamus Thomas Carroll said: I went out of town for a coulple of weeks and looking through my list of emails i dont think a recieved a response to the question below. I would like the cesna to be able to follow a set of waypoints but due to the new autopilot this no longer seems to be a possiblity. Any thoughts on how i would be able to achieve this functionality? Seamus On Wed, 5 May 2004, Seamus Thomas Carroll wrote: Are there plans to add a route manager to the KAP140? If not what property do I change to use the generic autopilot? I have tried different changing values in different xml files but with no success. Seamus On Wed, 5 May 2004, Roy Vegard Ovesen wrote: On Wednesday 05 May 2004 06:17, Seamus Thomas Carroll wrote: To test if a problem resides with the cesna autopilot i tested using Add Waypoint and instead of the autopilot guiding the plane to the waypoint it just flys in cirlces until it spirals into the ground. This autopilot with the cesna did work correctly that last time I tried it a couple of weeks ago. Has someone changed cesna autopilot config file to cause this incorrect behaviour? The default Cessna (--aircraft=c172-3d and c172-2dpanel) have changed autopilot from the generic to a KAP140 autopilot. A new instrument has been added to the cockpit and this should be visible below the ADF radio. The KAP140 does not have a route manager so consequently you can not define a route for it to fly. For instructions on how to operate the KAP140 you should download the Pilot Guide from the Bendix/King website. Is it a problem with the set up on my end? You can of course edit your *set.xml file to change the autopilot back to the generic. -- Roy Vegard Ovesen ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel -- Jim Wilson - IT Manager Kelco Industries PO Box 160 58 Main Street Milbridge, ME 04658 207-546-7989 - FAX 207-546-2791 http://www.kelcomaine.com ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] How to get cesna to follow a set of way points.
Thanks Roy, I looked at the post and it is dated the day i left so i must have missed it. I would like the autopilot to adjust to new waypoints faster but I do not know how to make the plane turn quicker using the generic autopilot. Looking at the documentation i am guessing i need to modify the u_min and u_max but after modifying the heading bug hold i am not noticing and improvements. Does anyone have a hint? Seamus On Fri, 21 May 2004, Roy Vegard Ovesen wrote: On Thursday 20 May 2004 23:50, Seamus Thomas Carroll wrote: Hi Jim, I was the one who asked this question but when i tried to implement the solution it resulted in the same flight behaviour. I will detail the changes i implemented so you can see if i did anything incorrectly. 1) I changed, in file Aircraft/c172/c172-610x-null-set.xml, pathAircraft/c172/610x-autopilot.xml/path to pathAircraft/Generic/generic-autopilot.xml/path Did you see?: http://baron.flightgear.org/pipermail/flightgear-devel/2004-May/028021.html The *-set.xml file for --aircraft=c172 is actually Aircraft/c172p/ c172p-set.xml. This is the file that you have to modify. -- Roy Vegard Ovesen ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
[Flightgear-devel] How to get cesna to follow a set of way points.
I went out of town for a coulple of weeks and looking through my list of emails i dont think a recieved a response to the question below. I would like the cesna to be able to follow a set of waypoints but due to the new autopilot this no longer seems to be a possiblity. Any thoughts on how i would be able to achieve this functionality? Seamus On Wed, 5 May 2004, Seamus Thomas Carroll wrote: Are there plans to add a route manager to the KAP140? If not what property do I change to use the generic autopilot? I have tried different changing values in different xml files but with no success. Seamus On Wed, 5 May 2004, Roy Vegard Ovesen wrote: On Wednesday 05 May 2004 06:17, Seamus Thomas Carroll wrote: To test if a problem resides with the cesna autopilot i tested using Add Waypoint and instead of the autopilot guiding the plane to the waypoint it just flys in cirlces until it spirals into the ground. This autopilot with the cesna did work correctly that last time I tried it a couple of weeks ago. Has someone changed cesna autopilot config file to cause this incorrect behaviour? The default Cessna (--aircraft=c172-3d and c172-2dpanel) have changed autopilot from the generic to a KAP140 autopilot. A new instrument has been added to the cockpit and this should be visible below the ADF radio. The KAP140 does not have a route manager so consequently you can not define a route for it to fly. For instructions on how to operate the KAP140 you should download the Pilot Guide from the Bendix/King website. Is it a problem with the set up on my end? You can of course edit your *set.xml file to change the autopilot back to the generic. -- Roy Vegard Ovesen ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
[Flightgear-devel] how to determine when flightgear has fully initialized
Hi, Is there a simple way to test in the code to see if flightgear has initialized such as a boolean? Seamus ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] cesna autopilot seems messed up
Are there plans to add a route manager to the KAP140? If not what property do I change to use the generic autopilot? I have tried different changing values in different xml files but with no success. Seamus On Wed, 5 May 2004, Roy Vegard Ovesen wrote: On Wednesday 05 May 2004 06:17, Seamus Thomas Carroll wrote: To test if a problem resides with the cesna autopilot i tested using Add Waypoint and instead of the autopilot guiding the plane to the waypoint it just flys in cirlces until it spirals into the ground. This autopilot with the cesna did work correctly that last time I tried it a couple of weeks ago. Has someone changed cesna autopilot config file to cause this incorrect behaviour? The default Cessna (--aircraft=c172-3d and c172-2dpanel) have changed autopilot from the generic to a KAP140 autopilot. A new instrument has been added to the cockpit and this should be visible below the ADF radio. The KAP140 does not have a route manager so consequently you can not define a route for it to fly. For instructions on how to operate the KAP140 you should download the Pilot Guide from the Bendix/King website. Is it a problem with the set up on my end? You can of course edit your *set.xml file to change the autopilot back to the generic. -- Roy Vegard Ovesen ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
[Flightgear-devel] Has there been any changes to the use of FGRouteMgr
Hi, Last week (maybe two) i was able to create a path for the plane to fly using the following code: void AgentUAV::processWaypointsTable( string flightPathTable ) { double lon, lat; string query = select NumPoints(the_geom) from + flightPathTable + where id = 2;; cout query: query endl; PGresult *resultSet = dbInterface-dbQuery( query.c_str() ); int numPoints = atoi( PQgetvalue( resultSet, 0, 0 ) ); int alt = 2000; string id; cout numPoints: numPoints endl; FGRouteMgr *rm = (FGRouteMgr *)globals-get_subsystem(route-manager); SGWayPoint *wp = NULL; for( int point = 1; point = numPoints; point++ ) { char pointChar[256]; sprintf(pointChar, %d, point); string pointString(pointChar); query = select x(PointN(the_geom,+ pointString + )), y(PointN(the_geom,+ pointString + )) from +flightPathTable+;; cout query: query endl; resultSet = dbInterface-dbQuery( query.c_str() ); lon = atof( PQgetvalue( resultSet, 1, 0 ) ); lat = atof( PQgetvalue( resultSet, 1, 1 ) ); cout lon = lon , lat = lat endl; id = flightPathTable + _ + pointString; wp = new SGWayPoint( lon, lat, alt, SGWayPoint::WGS84, id ); rm-add_waypoint( *wp ); } fgSetString( /autopilot/locks/heading, true-heading-hold ); cout route size: rm-size() endl; } Lots of the code is not important to you. Essentially i pull the (lon, lat) points from the database and add them to the SGWayPoint. Upon running my code after a cvs update the planes no longer follow the path but instead fly in tight circles until the plane eventually crashes. I cant seem to find the change that has occured to cause this effect. Has there been any changes to the autopilot or the FGWaypoint that may have caused this problem? Any help is greatly appreciated, Seamus ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
[Flightgear-devel] cesna autopilot seems messed up
To test if a problem resides with the cesna autopilot i tested using Add Waypoint and instead of the autopilot guiding the plane to the waypoint it just flys in cirlces until it spirals into the ground. This autopilot with the cesna did work correctly that last time I tried it a couple of weeks ago. Has someone changed cesna autopilot config file to cause this incorrect behaviour? Is it a problem with the set up on my end? I have tried the pa28-161 and the autopilot works correctly. Seamus On Tue, 4 May 2004, Seamus Thomas Carroll wrote: Hi, Last week (maybe two) i was able to create a path for the plane to fly using the following code: void AgentUAV::processWaypointsTable( string flightPathTable ) { double lon, lat; string query = select NumPoints(the_geom) from + flightPathTable + where id = 2;; cout query: query endl; PGresult *resultSet = dbInterface-dbQuery( query.c_str() ); int numPoints = atoi( PQgetvalue( resultSet, 0, 0 ) ); int alt = 2000; string id; cout numPoints: numPoints endl; FGRouteMgr *rm = (FGRouteMgr *)globals-get_subsystem(route-manager); SGWayPoint *wp = NULL; for( int point = 1; point = numPoints; point++ ) { char pointChar[256]; sprintf(pointChar, %d, point); string pointString(pointChar); query = select x(PointN(the_geom,+ pointString + )), y(PointN(the_geom,+ pointString + )) from +flightPathTable+;; cout query: query endl; resultSet = dbInterface-dbQuery( query.c_str() ); lon = atof( PQgetvalue( resultSet, 1, 0 ) ); lat = atof( PQgetvalue( resultSet, 1, 1 ) ); cout lon = lon , lat = lat endl; id = flightPathTable + _ + pointString; wp = new SGWayPoint( lon, lat, alt, SGWayPoint::WGS84, id ); rm-add_waypoint( *wp ); } fgSetString( /autopilot/locks/heading, true-heading-hold ); cout route size: rm-size() endl; } Lots of the code is not important to you. Essentially i pull the (lon, lat) points from the database and add them to the SGWayPoint. Upon running my code after a cvs update the planes no longer follow the path but instead fly in tight circles until the plane eventually crashes. I cant seem to find the change that has occured to cause this effect. Has there been any changes to the autopilot or the FGWaypoint that may have caused this problem? Any help is greatly appreciated, Seamus ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] how to set a planes altitude?
Thanks Erik, With your suggestion things appear to be working. If anything strange occurs i will be sure to ask. I added fgSetBool(/sim/presets/onground, false); to my code taken from --in-air. I looked around the code trying to figure out how --in-air effects things but with no luck. For now I will just accept it as black magic. Seamus On Wed, 31 Mar 2004, Erik Hofman wrote: Seamus Thomas Carroll wrote: Hi, I am tried setting the planes altitude with the following code: fgSetDouble(/position/altitude-ft, Alt) This worked find when using the ufo but when i tried using the sesna it no longer worked. Does anyone know a foolproof way of setting the planes altitude? You have to make sure the aircraft is trimmed for --in-air conditions., otherwise the aircraft will always end up on the ground. Erik ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
[Flightgear-devel] how to set a planes altitude?
Hi, I am tried setting the planes altitude with the following code: fgSetDouble(/position/altitude-ft, Alt) This worked find when using the ufo but when i tried using the sesna it no longer worked. I then manually changed the property /fdm/jsbsim/position/h-sl-ft and again things worked. Problem is when I try to edit the altitude using: fgSetDouble(/fdm/jsbsim/position/h-sl-ft, Alt) The altitude is not changed. Does anyone know a foolproof way of setting the planes altitude? Thanks, Seamus ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
[Flightgear-devel] How to save glbuffer as jpeg
Hi, Does anyone know of a way to save the glbuffer as a jpeg? Currently the images are saved as a ppm but this requires a lot of space. A hint on what library to use might be enough for me to figure out the rest. Seamus ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Compile error with latest simgear cvs.
Hi, from g++ -v: Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs gcc version 2.96 2731 (Red Hat Linux 7.3 2.96-113) On Thu, 11 Mar 2004, Frederic Bouvier wrote: Seamus Thomas Carroll wrote: Hi, Just update my simgear cvs today and I now get the following error: In file included from sgstream.hxx:47, from sgstream.cxx:32: ../../simgear/misc/zfstream.hxx:144: `traits_type' is not a member of type `streambuf' ../../simgear/misc/zfstream.hxx:144: parse error before `::' ../../simgear/misc/zfstream.hxx:144: invalid type `{type error}' for default argument to `int' make[2]: *** [sgstream.o] Error 1 make[2]: Leaving directory `/scratch/simgear/SimGear/simgear/misc' make[1]: *** [install-recursive] Error 1 make[1]: Leaving directory `/scratch/simgear/SimGear/simgear' make: *** [install-recursive] Error 1 Just thought I would get the word out. Sorry if this has been mentioned already. Is there a solution to this problem? On which OS ? ( Cygwin or Linux ? ) What is your compiler version ? -Fred ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Compile error with latest simgear cvs.
Thanks, compiles now. On Fri, 12 Mar 2004, Frederic BOUVIER wrote: Seamus Thomas Carroll wrote: Hi, from g++ -v: Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs gcc version 2.96 2731 (Red Hat Linux 7.3 2.96-113) Ok, pre 3 compiler. Hopefully, a fix is in CVS since this morning. -Fred On Thu, 11 Mar 2004, Frederic Bouvier wrote: Seamus Thomas Carroll wrote: Hi, Just update my simgear cvs today and I now get the following error: In file included from sgstream.hxx:47, from sgstream.cxx:32: ../../simgear/misc/zfstream.hxx:144: `traits_type' is not a member of type `streambuf' ../../simgear/misc/zfstream.hxx:144: parse error before `::' ../../simgear/misc/zfstream.hxx:144: invalid type `{type error}' for default argument to `int' make[2]: *** [sgstream.o] Error 1 make[2]: Leaving directory `/scratch/simgear/SimGear/simgear/misc' make[1]: *** [install-recursive] Error 1 make[1]: Leaving directory `/scratch/simgear/SimGear/simgear' make: *** [install-recursive] Error 1 Just thought I would get the word out. Sorry if this has been mentioned already. Is there a solution to this problem? On which OS ? ( Cygwin or Linux ? ) What is your compiler version ? -Fred ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
[Flightgear-devel] Compile error with latest simgear cvs.
Hi, Just update my simgear cvs today and I now get the following error: In file included from sgstream.hxx:47, from sgstream.cxx:32: ../../simgear/misc/zfstream.hxx:144: `traits_type' is not a member of type `streambuf' ../../simgear/misc/zfstream.hxx:144: parse error before `::' ../../simgear/misc/zfstream.hxx:144: invalid type `{type error}' for default argument to `int' make[2]: *** [sgstream.o] Error 1 make[2]: Leaving directory `/scratch/simgear/SimGear/simgear/misc' make[1]: *** [install-recursive] Error 1 make[1]: Leaving directory `/scratch/simgear/SimGear/simgear' make: *** [install-recursive] Error 1 Just thought I would get the word out. Sorry if this has been mentioned already. Is there a solution to this problem? Seamus ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] fgDumpSnapShot(); producing blank screen and other corruptions
I am currently using the main thread and it is producing these incorrect images. I have not even multithreaded it yet. When I do I will only be threading the writting of the image. Seamus On Wed, 25 Feb 2004, Frederic Bouvier wrote: Seamus Thomas Carroll wrote: Hi, I am trying to save images from flightgear to a file or database without explicitly using the gui. For a test of current capability I am calling fgDumpSnapShot every second but I am finding it produces saved images that are completely white or contain corruption, yet other images are saved as expected. The only change I mode to fgDumpSnapShot is I commented out mkDialog (message.c_str());. I am trying to implement a threaded image saver so that it does not cause pauses in the simulator that continiously saves images over a specified interval. If you are doing snapshot in another thread, you must be sure that the buffer you are dumping is not being cleared, swapped or written at the same time by the main thread. Generally, people think it is not possible to call OpenGL API from multiple thread at the same time because of the state oriented nature of OpenGL. The arguments seem reasonable and I take them for true, so I never experiment myself. In theory, it should be possible to dump the front buffer while the back buffer is updated, but fgDumpSnapShot should be rewriten to avoid calling fgInitVisual, fgReshape or fgRenderFrame in two different threads. This imply also some sort of synchronization to avoid doing a SwapBuffer during the ReadPixels call. I think I understand how fgDumpSnapShot works and was going to use it as an example but it only seems to produce correct results when called through the gui. Yes, in the main thread. Should I be using another funtion as an example? I would look at sg_glDumpWindow and take the code portion that write to the file from fgDumpSnapShot. -Fred ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] fgDumpSnapShot();
I tried calling sg_glDumpWindow directly and so far I have not experienced the white out but I am noticing at times what looks like smearing and other corruption but the flightgear display does not show any of these problems. My knowledge of gl is limited but it confuses me that flightgear looks correct but the screen shot saved by sg_glDumpWindow does not. Are they not from the same buffer? You can find an example screen shot with corruption at http://pages.cpsc.ucalgary.ca/~carrolls/ppm/fgfs-screen---00075.jpeg Seamus On Wed, 25 Feb 2004, Martin Spott wrote: Seamus Thomas Carroll wrote: I am trying to save images from flightgear to a file or database without explicitly using the gui. For a test of current capability I am calling fgDumpSnapShot every second but I am finding it produces saved images that are completely white or contain corruption, yet other images are saved as expected. I usually use 'import' from the ImageMagick package to create snapshots and I experienced similar effects. That _might_ let us assume that taking a snapshot simply takes too much time and the respective buffer - the one where the snapshot is taken from - is already eptied before the snapshot is complete, Martin. -- Unix _IS_ user friendly - it's just selective about who its friends are ! -- ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
[Flightgear-devel] fgDumpSnapShot(); producing blank screen and other corruptions
Hi, I am trying to save images from flightgear to a file or database without explicitly using the gui. For a test of current capability I am calling fgDumpSnapShot every second but I am finding it produces saved images that are completely white or contain corruption, yet other images are saved as expected. The only change I mode to fgDumpSnapShot is I commented out mkDialog (message.c_str());. I am trying to implement a threaded image saver so that it does not cause pauses in the simulator that continiously saves images over a specified interval. I think I understand how fgDumpSnapShot works and was going to use it as an example but it only seems to produce correct results when called through the gui. Should I be using another funtion as an example? Seamus PS. I am viewing the images with xv -wait 1 *.ppm ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
[Flightgear-devel] Help with activating route
I am trying to update my autopilot route code to reflect the latest changes. I read a set of points from a table in a database. I used to use globals-get_route()-add_waypoint( *wp ); to add the waypoints and then I would activate the autopilot by calling, globals-get_autopilot()-set_HeadingEnabled( true ); globals-get_autopilot()-set_HeadingMode( FGAutopilot::FG_HEADING_WAYPOINT ); I am now adding waypoints using: FGRouteMgr *rm = (FGRouteMgr *)globals-get_subsystem(route-manager); SGWayPoint *wp = new SGWayPoint( lon, lat, alt, SGWayPoint::WGS84, id ); rm-add_waypoint( *wp ); The question now is how to activate the autopilot. I tried fgSetString( /autopilot/locks/heading, true-heading-hold ); but this does not result in a change of the flight path. I am guessing that I am missing one line of code and any help would be greatly appreciated, Thankyou, Seamus ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] truncf undeclared rearing its ugly head
The latest cvs compiled without a problem. Seamus On Fri, 20 Feb 2004, Erik Hofman wrote: Jim Wilson wrote: My apologies for not following up sooner. When I later did a make clean it became an issue for me as well. I cannot tell you why at this point, except that truncf is a) non-standard and b) in glibc (on redhat). There may be some header required that isn't there, other than math.h, which is probably also non-standard (correctly so). Below is a patch to fix the problem. Could someone commit this please? This is not a patch, just a workaround. A patch would go to the developers of autoconf because it detects a working function that isn't available at compile time. But just for the sake of sanity I've committed this. Erik ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
[Flightgear-devel] Help\Advice for cvs update
Hi, Every once and a while I update my cvs checkout. I have begun to notice that a cvs update -d -P does not merge my modified file with the checked out file. A conflict is not reported because the cvs update only presents an M. ie: cvs update: Updating . M fg_commands.cxx M fg_init.cxx M fg_props.cxx M fg_props.hxx M globals.cxx M globals.hxx M main.cxx M main.hxx M options.cxx An ls -al does not contain any hidden files but when I run cvs diff many differences are reported that do not occur in my version of the code. What is the proper method for merging the main branch with my changes? At one point I deleted some hidden files of the form .#* which must be the root of my problem. Is there any way to fix the mess i have created without getting a new cvs copy and manually adding all of my code back in? Thanks, Seamus ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
[Flightgear-devel] truncf undeclared rearing its ugly head
Hi, I have read the discussion about the truncf problem and with the latest cvs checkout i still recieve the error. The messages subject is: Re: [Flightgear-devel] Re: Fix for compilation error in panel.cxx: `truncf' undeclared I did not notice any real solution other than some red hat people had successful compiles and others didnt. Seamus -- Forwarded message -- Date: Wed, 18 Feb 2004 18:49:27 -0700 (MST) From: Seamus Thomas Carroll [EMAIL PROTECTED] To: FlightGear developers discussions [EMAIL PROTECTED] Subject: Re: [Flightgear-devel] Re: Latest CVS not compiling I downloaded the latest CVS seperate from my own modifications and tried to compile. I am still recieving the error: panel.cxx: In method `const char *FGTextLayer::Chunk::getValue () const': panel.cxx:1128: `truncf' undeclared (first use this function) panel.cxx:1128: (Each undeclared identifier is reported only once for each function it appears in.) make[3]: *** [panel.o] Error 1 make[3]: Leaving directory `/home/grads/carrolls/downloads/flightgear/FlightGear/src/Cockpit' Any suggestions would be appreciated, Seamus On Thu, 19 Feb 2004, Melchior FRANZ wrote: * Seamus Thomas Carroll -- Thursday 19 February 2004 01:16: C src/Main/Makefile.am M src/Main/bootstrap.cxx M src/Main/fg_commands.cxx M src/Main/fg_init.cxx M src/Main/globals.cxx M src/Main/globals.hxx C src/Main/main.cxx The 'C' means that cvs couldn't cleanly merge the version from the repository into yours. You have to open all the files marked with C and search for places like this: bar.cxx foo === bar 1.20 Then replace these lines with foo or bar. IOW: you have to decide if you prefer your version (foo) or the one from the repository (bar). Alternatively, you can call cvs up -C and let cvs overwrite all your changes. They aren't really lost, though, but saved in hidden files. m. ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] truncf undeclared rearing its ugly head
I just added #include math.h source/src/Cockpit/panel.cxx recompiled and still the same error. Seamus On Thu, 19 Feb 2004, Andy Ross wrote: Seamus Thomas Carroll wrote: I have read the discussion about the truncf problem and with the latest cvs checkout i still recieve the error. The messages subject is: Re: [Flightgear-devel] Re: Fix for compilation error in panel.cxx: `truncf' undeclared I did not notice any real solution other than some red hat people had successful compiles and others didnt. It works for me on Fedora Core 1. Try adding a: #include math.h At the top of panel.cxx and see if this fixes your problem; this is the header that the autoconf stuff uses to detect the truncf function. The panel.hxx header uses cmath, which might not export exactly the same symbol set in all cases (maybe...). If that works, we can either replace the C++ header with the C one, or re-write the autoconf test to use cmath instead. Andy ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
[Flightgear-devel] Latest CVS not compiling
Hi, I have just tried a cvs update and the compile of flightgear results in an error. I also did a cvs update and compile of plib and simgear without error. The error recieved is as follows: ++ -DHAVE_CONFIG_H -I. -I. -I../../src/Include -I../.. -I../../src -I/scratch/simgear//include -I/scratch/plib//include -I/usr/X11R6/include -g -O2 -c -o panel.o `test -f panel.cxx || echo './'`panel.cxx panel.cxx: In method `const char *FGTextLayer::Chunk::getValue () const': panel.cxx:1128: `truncf' undeclared (first use this function) panel.cxx:1128: (Each undeclared identifier is reported only once for each function it appears in.) make[3]: *** [panel.o] Error 1 make[3]: Leaving directory `/scratch/flightgear/source/src/Cockpit' Is this error just on my end? Its been over a month since I last updated so I might be missing something new that has to be compiled before flightgear. Thank-you, Seamus ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Latest CVS not compiling
I might have an idea to what is causing my error. A cvs update -d -P is not updating my files in /Main. I have modified them and it is not merging my version with the cvs. My globals.hxx is version $Id: globals.hxx,v 1.26 2003/11/25 21:08:37 curt Exp $ while the latest globals.hxx is $Id: globals.hxx,v 1.27 2004/01/31 19:47:46 curt Exp $. Does anyone know what causes this to occur? cvs update -d -P for me reports for /Main as follows: cvs update: Updating src/Main C src/Main/Makefile.am M src/Main/bootstrap.cxx M src/Main/fg_commands.cxx M src/Main/fg_init.cxx M src/Main/globals.cxx M src/Main/globals.hxx C src/Main/main.cxx M src/Main/main.hxx M src/Main/options.cxx I could grab a new cvs but it will require that I add my changes to Main. Seamus On Wed, 18 Feb 2004, Seamus Thomas Carroll wrote: Hi, I have just tried a cvs update and the compile of flightgear results in an error. I also did a cvs update and compile of plib and simgear without error. The error recieved is as follows: ++ -DHAVE_CONFIG_H -I. -I. -I../../src/Include -I../.. -I../../src -I/scratch/simgear//include -I/scratch/plib//include -I/usr/X11R6/include -g -O2 -c -o panel.o `test -f panel.cxx || echo './'`panel.cxx panel.cxx: In method `const char *FGTextLayer::Chunk::getValue () const': panel.cxx:1128: `truncf' undeclared (first use this function) panel.cxx:1128: (Each undeclared identifier is reported only once for each function it appears in.) make[3]: *** [panel.o] Error 1 make[3]: Leaving directory `/scratch/flightgear/source/src/Cockpit' Is this error just on my end? Its been over a month since I last updated so I might be missing something new that has to be compiled before flightgear. Thank-you, Seamus ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Re: Latest CVS not compiling
I downloaded the latest CVS seperate from my own modifications and tried to compile. I am still recieving the error: panel.cxx: In method `const char *FGTextLayer::Chunk::getValue () const': panel.cxx:1128: `truncf' undeclared (first use this function) panel.cxx:1128: (Each undeclared identifier is reported only once for each function it appears in.) make[3]: *** [panel.o] Error 1 make[3]: Leaving directory `/home/grads/carrolls/downloads/flightgear/FlightGear/src/Cockpit' Any suggestions would be appreciated, Seamus On Thu, 19 Feb 2004, Melchior FRANZ wrote: * Seamus Thomas Carroll -- Thursday 19 February 2004 01:16: C src/Main/Makefile.am M src/Main/bootstrap.cxx M src/Main/fg_commands.cxx M src/Main/fg_init.cxx M src/Main/globals.cxx M src/Main/globals.hxx C src/Main/main.cxx The 'C' means that cvs couldn't cleanly merge the version from the repository into yours. You have to open all the files marked with C and search for places like this: bar.cxx foo === bar 1.20 Then replace these lines with foo or bar. IOW: you have to decide if you prefer your version (foo) or the one from the repository (bar). Alternatively, you can call cvs up -C and let cvs overwrite all your changes. They aren't really lost, though, but saved in hidden files. m. ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
[Flightgear-devel] autopilot, maintaining elevation
Hi, I am playing with the autopilot and maintaining an altitidue above sea level works great. Is there a method for maintaining an elevation above the ground? Seamus ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
[Flightgear-devel] additional documentation on autopilot
Hi, I have read Altitude Hold Module and Heading Hold Module in the flightgear docs and I would like to learn more about the theory of autopilots. Does anyone have a recomendation on books, articles, etc in this area? Thanks, Seamus ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
[Flightgear-devel] What is the camera angle in flightgear?
Hi Flightgear Developers, The reasone I would like to know is given an altidude above the ground and a picture taken at that altitude I would like to know how much ground the picture covers. Seamus ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] What is the camera angle in flightgear?
What variable do I pull from the property tree to get this value? Can I set this value when I configure the views? I have a view that looks down from the bottom of the plane for taking pictures of the ground. Seamus On Fri, 5 Dec 2003, David Megginson wrote: Seamus Thomas Carroll wrote: The reasone I would like to know is given an altidude above the ground and a picture taken at that altitude I would like to know how much ground the picture covers. It's controlled by a property, but I find that usually 8-12 degrees down is realistic for most of our cockpits. All the best, David ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
[Flightgear-devel] running flightgear without display
Hi, Is there a way to run flightgear without outputting to the display? I would like to run flightgear from a remote computer and I dont want the display to show up on the local or calling computer. I would still like to be able to take screen shots so I would still require that the buffer have data. Has this been implemented? If not does anyone have pointers on how I could quickly hack this up? Seamus ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
[Flightgear-devel] Checking if there is a connection with netChannel
Hi, I have got the netChannel figured (thanks Bernie) out and the server is accepting multiple clients. The problem is if a client flightgear program is shut down the server still tries to send it information and the server crashes. I tried using netChannel::isConnected() but it returns true even if there is no client. On the client side I thought about using netChannel::close to inform the server that the socket is closed but the function is never called. netChannel::close is called in the clients destructor but the destructor is never called because FGGlobals *globals is never deleted (from what I can tell) which in turn would delete my client. Any thoughts on the matter? Would putting delete globals somewhere in the code which down the line would call netChannel::close() be the solution? Seamus ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
RE: [Flightgear-devel] Checking if there is a connection with netChannel
I put a cerr delete globals endl; where you have delete globals; in the code below and when I exit flightgear delete globals is not printed. Does the same happen for you? Seamus On Tue, 2 Dec 2003, Norman Vine wrote: Seamus Thomas Carroll writes: On the client side I thought about using netChannel::close to inform the server that the socket is closed but the function is never called. netChannel::close is called in the clients destructor but the destructor is never called because FGGlobals *globals is never deleted (from what I can tell) which in turn would delete my client. Any thoughts on the matter? Would putting delete globals somewhere in the code which down the line would call netChannel::close() be the solution? Easy enough to test try moving globals = new FGGlobals; out of main,cxx fgMainInit( int argc, char **argv ) { into bootstrap.cxx main(int argc, char **argv) { ... globals = new FGGlobals; // FIXME: add other, more specific // exceptions. try { fgMainInit(argc, argv); } catch (sg_throwable t) { // We must use cerr rather than // logging, since logging may be // disabled. cerr Fatal error: t.getFormattedMessage() \n (received from t.getOrigin() ')' endl; exit(1); } delete globals; } Norman ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Checking if there is a connection with netChannel
Found the solution. When the client is shutdown the server netChannel still thinks the connection is valid and has a handle != -1. This causes a SIGPIPE errors on a send or recieve making an assert to fail. To avoid this problem MSG_NOSIGNAL is passed into the send or recv with this description from man 2 send: MSG_NOSIGNAL: Requests not to send SIGPIPE on errors on stream oriented sockets when the other end breaks the connection. The EPIPE error is still returned. The handle is then set to -1 and connected to false in netChannel. No need to worry about FGGlobals *globals for now. Seamus On Wed, 3 Dec 2003, Bernie Bright wrote: On Tue, 02 Dec 2003 20:40:51 -0500 Norman Vine [EMAIL PROTECTED] wrote: Seamus Thomas Carroll writes: On the client side I thought about using netChannel::close to inform the server that the socket is closed but the function is never called. netChannel::close is called in the clients destructor but the destructor is never called because FGGlobals *globals is never deleted (from what I can tell) which in turn would delete my client. Any thoughts on the matter? Would putting delete globals somewhere in the code which down the line would call netChannel::close() be the solution? Easy enough to test try moving globals = new FGGlobals; out of main,cxx fgMainInit( int argc, char **argv ) { into bootstrap.cxx main(int argc, char **argv) { ... globals = new FGGlobals; // FIXME: add other, more specific // exceptions. try { fgMainInit(argc, argv); } catch (sg_throwable t) { // We must use cerr rather than // logging, since logging may be // disabled. cerr Fatal error: t.getFormattedMessage() \n (received from t.getOrigin() ')' endl; exit(1); } delete globals; } globals will not be deleted if an exception is caught. This is a good case for using std::auto_ptr. Alternatively if global,s was an object and not a pointer it would be destroyed automatically at exit. Bernie ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] read not excepting more than one client
@[EMAIL PROTECTED] (Swearing), Do you know of any websites that I can read the will improve my understaning of sockets? At my current level of understanding I am having trouble making sense of the pegasus network library and how it is being used in httpd.cxx and props.cxx due to the little documentation on the plib website. Can someone explain why SGSocket restricts the number of clients to one? Would it not make more sense to allow up to some maximum number of clients? Seamus On Sun, 30 Nov 2003, Bernie Bright wrote: On Fri, 28 Nov 2003 22:45:24 -0700 Seamus Thomas Carroll [EMAIL PROTECTED] wrote: Hi, I have created a server which has one SGSocket object listening for clients that want to connect. The problem I am having is when a second client sends its connect info to the server the server never gets the message. Note that the server is listening using readline and that the connection is tcp. I have tried two different clients and they both work if they are the first one to connect. Are there any restrictions on a SG_IO_IN socket that I should be aware of? Any other suggestions? This problem could be with my code but I want to ask the question before I spend a lot of time on looking for the problem. What you are seeing is normal behaviour for SGSocket. You might be better served by using plib.net. This is what FlightGear uses for the http and prop servers. See src/Network/httpd.cxx and src/Network/props.cxx for examples. Bernie ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
[Flightgear-devel] read not excepting more than one client
Hi, I have created a server which has one SGSocket object listening for clients that want to connect. The problem I am having is when a second client sends its connect info to the server the server never gets the message. Note that the server is listening using readline and that the connection is tcp. I have tried two different clients and they both work if they are the first one to connect. Are there any restrictions on a SG_IO_IN socket that I should be aware of? Any other suggestions? This problem could be with my code but I want to ask the question before I spend a lot of time on looking for the problem. Thanks-you, Seamus ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] simgear SGSocket returning -1
I have done some extensive testing with read() using tcp and it seems to be working great. Thanks, Seamus On Fri, 28 Nov 2003, Bernie Bright wrote: On Thu, 27 Nov 2003 07:23:30 -0600 Curtis L. Olson [EMAIL PROTECTED] wrote: Curtis L. Olson writes: Bernie Bright writes: SGSocket::readline() and SGSocket::read() do act differently. For a server, readline() correctly handles the accept and reads from the new socket. read() also handles the accept but reads from the master socket. I'm not sure if this is intentional or if its a bug. Someone else wrote in reporting a problem here. THey also said that reading from the new socket fixed the problem in read(). If it seems to make sense, maybe we should make read() read from the new socket? It looks like readline() uses sock.recv() for UDP style sockets and client-recv() for tcp style sockets. I will make read() work the same way and hope I don't break anything. Judging from style and lack of familiarity, I don't think it was me who wrote the code. I think I'm responsible for the current code. I remember rewriting it using plib.net a couple of years ago. I agree that read() should work the same as readline() but I don't remember why it wasn't so in the first place. Bernie ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
[Flightgear-devel] simgear SGSocket returning -1
Hi, I am trying to recieve a message using SGSocket::read. SGSocket::read returns zero bytes read until about the time I am expecting the first message to be recieved. From here on SGSocket::read returns that -1 bytes have been read from the socket. I have looked around (simgear docs, plib) and I cant find out what the -1 is supposed to indicate. Does anyone know? Seamus ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] simgear SGSocket returning -1
I output the error and I am getting: Transport endpoint is not connected The strange part is if I put '\n' at the end of the message and read with 'readline' the message is successfully recieved. Is this a problem with 'read'? Seamus On Thu, 27 Nov 2003, Bernie Bright wrote: On Wed, 26 Nov 2003 16:59:53 -0700 Seamus Thomas Carroll [EMAIL PROTECTED] wrote: Hi, I am trying to recieve a message using SGSocket::read. SGSocket::read returns zero bytes read until about the time I am expecting the first message to be recieved. From here on SGSocket::read returns that -1 bytes have been read from the socket. I have looked around (simgear docs, plib) and I cant find out what the -1 is supposed to indicate. Does anyone know? On unix -1 indicates an error. The actual error code is in the external variable errno. Call strerror(errno) to convert errno to a string. Bernie ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] easyxml
Good point. I now understand how to read xml from a file but I cant figure out how to read xml from a char *. When a client recieves an xml document from the server it will read it into a char *buffer. Is it possible to then parse buffer using the property-tree code? I am looking at void readProperties( istream input, SGPropertyNode *start_node, const string base ) but i dont understand what the base is for. Thanks, Seamus You would have the callbacks in your visitor take care of it, but it's a bit of work the first time. Why not just use the property-tree code instead? All the best, David ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] easyxml
I looked at the code for readxml and the path is simply a descriptor for the document being parsed (ie file name) and does not effect the parsing. The new question is how to cast? the char * to an istream? Seamus On Tue, 18 Nov 2003, Seamus Thomas Carroll wrote: Good point. I now understand how to read xml from a file but I cant figure out how to read xml from a char *. When a client recieves an xml document from the server it will read it into a char *buffer. Is it possible to then parse buffer using the property-tree code? I am looking at void readProperties( istream input, SGPropertyNode *start_node, const string base ) but i dont understand what the base is for. Thanks, Seamus You would have the callbacks in your visitor take care of it, but it's a bit of work the first time. Why not just use the property-tree code instead? All the best, David ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] FG AI with server
True. If I take advantage of \n in the passed message it should be very simple to pull out relevant data. Seamus On Wed, 19 Nov 2003, [EMAIL PROTECTED] wrote: Am Montag, 17. November 2003 23:25 schrieb Seamus Thomas Carroll: Hi, Starting today (monday) I will be working on a ground vehicle server that will manage the movement of ground vehicles over a road network. The server will be in charge of calculating the ground elevation and movement of each vehicle every second. Any connecting client (FG) will be passed this info in the form of an XML document. The client will then display the vehicles interpolating the the points inbetween those passed by the server. Why do you want use a XML document for a server to client data transfer problem? XML is nice for local tasks or world wide web, but overhead for network game things. If you want to use your server over the internet you will have a very limited bandwith and XML documents are bigger then an own solution so they are definatly not the best solution. Best Regards, Oliver C. ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
[Flightgear-devel] FG AI with server
Hi, Starting today (monday) I will be working on a ground vehicle server that will manage the movement of ground vehicles over a road network. The server will be in charge of calculating the ground elevation and movement of each vehicle every second. Any connecting client (FG) will be passed this info in the form of an XML document. The client will then display the vehicles interpolating the the points inbetween those passed by the server. The question to the group is there a c, c++ library available for easy tcp communication where a read returns the entire message (XML documents will be of differing sizes)? I have looked at SGSocket and will use it unless there is a better suggestion. The results of a server and interpolation results in synchroniztion between all clients and is not dependant on the processing power of the client. Based on an educated guess a 2.4G P4 with the client interpolating intermediate elevations will be able to serve about 500 vehicles. Seamus On Sun, 16 Nov 2003, David Culp wrote: Wowww, nice! ... Roger that, thanks Saratoga tower. I'll send you the code if you like. I've written a bare-bones AI system based on David Luff's. The AI manager just instantiates an AI object (airplane or ship) wherever you want it and tells it when to update. The AI objects are AIAircraft (yes, even the ship) which have a simple FDM that moves it along at any assigned speed, altitude, heading and bank angle. What I would like to see in FlightGear is: 1) A simple AI base class, like my FGAIBase, which is based on and very similar to the present FGAIEntity. 2) A simple AI object class, like my AIAircraft, that would provide dumb AI, which are minimalist AI objects that move along scripted flight plans. This would be for dumb aircraft and ships. 3) A semi-smart AI class for autos, which must be smart enough to know where the ground is at all times. Seamus is working on these now. 4) A smart class, which is the present AILocalTraffic. These know where the ground is, and have the ability to communicate. In the future they may become interactive. 5) An AI manager that instantiates new AI objects from the above three types for every occurance of entry ... /entry within the ai section of preferences.xml (just like the way environment layers are currently defined). You could create any number of AI objects at any place and time this way. 6) A scripting standard for the AI objects. The script will serve as the object's flight plan, specify when the object should be terminated, and contain communications instructions (for the smart AI). Is there any interest in uniting dumb and smart AI this way? I brought some KSFO arrival charts home from work, and am planning to have a dumb AI airplane appear at the beginning of each arrival every 2 minutes. The Big Sur arrival will feed runway 28L, and the Modesto arrival 28R. After landing the airplanes would turn off disappear. I'm curious what the frame rate hit will be. These might need to be very low-poly models. Dave -- David Culp davidculp2[at]comcast.net ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
[Flightgear-devel] easyxml
Hi, Is there a tutorial or can someone give or direct me to a simple example on how to use easyxml? I am trying to work my way through props_io.cxx but it is not an easy introduction. Seamus ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] easyxml
I figured out the what you mention. The part that confuses me is how to put the data from the xml file in a desired location. For example if I have the xml document: ... vehicle id1/id lon-128.553223/lon lat54.233123/lat /vehicle ... How does id, lon, lat initialize the variables int id, double lon, double lat? Seamus On Mon, 17 Nov 2003, David Megginson wrote: Seamus Thomas Carroll wrote: Is there a tutorial or can someone give or direct me to a simple example on how to use easyxml? I am trying to work my way through props_io.cxx but it is not an easy introduction. Do you want to work with properties or raw, low-level XML? Properties provide a higher level of abstraction that hides most of the messy XML details from you. If you do want to work with low-level XML, look at the documentation comments in simgear/xml/easyxml.hxx for details. Essentially, you create a class that extends XMLVisitor, then pass it to the readXML function as an argument, i.e. MyVisitor visitor; try { readXML(foo.xml, visitor); } catch (const sg_io_exception e) { // deal with the error } All the best, David ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] [Repost] Simulating ground activity (fwd)
I have the timings you asked for. The output from my GroundActivity class is as follows: 1) Total Time: 221.99 2) total calc of lon, lat: 0.52 3) total calc of elev: 116.74 4) total model placement time: 0.95 1 is the total time flightgear has been running. 2 is the total time it took to calculate a new lon, lat. 3 is the total time to caluclate the elevation for the new lon, lat. 4 is the time to place the model at the new lat lon and elevation and set it viewable. These timings were taken while 100 vehicles at 3 updates per second. As you can see the time to calculate the elevation at a particular lat lon is huge compared to the total run time. The method for calculating the elevation was taken from FGAILocalTraffic::DoGroundElev(). There must be a better way to calculate the elevation. Seamus On Fri, 7 Nov 2003, David Luff wrote: On 11/6/03 at 2:28 PM Seamus Thomas Carroll wrote: I now have cubes and cylinders of various colours moving around in the flightgear world. Currently I specify a starting lon, lat and the roaming distance in meters in either the lon, lat direction. I can have about 100 vehicles being updated 3 times a second each before my p4 1.4ghz really begins to slow down (20fps). Currently the vehicles move in a rondom direction at a randomly changing speed. The min and max speed limit is expressed in km/h so accurate movement is not dependant on the number of frames per second. I would like to say thanks to those that have helped me so far. The next step is to have the vehicles move down the real road networks (stored in postgres using the postgis module) at the proper speed limits. Before I do this I am trying to eek out better performance. Here is my question: Is it possible to determine if a vehicle is in the viewing area of the plane using the lon, lat of the vehicle? If this is so I will be able to eliminate large amounts of computation. You might want to make sure you know whether it's displaying the models or computing their position that's slowing the code down. Should be quite easy - just compare displaying them as statics, displaying them with computed movements, and just computing movements without displaying them. Sorry if I'm teaching my Grandmother to suck eggs!!! (But I would be interested in the results!) Cheers - Dave ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Compliation of CVS Source Error --ssgCullandDraw
I am thinking back as hard as I can and I cant pin point how things began working. I was having problems with CVS not updating files I had modified with cvs update -d -P. I downloaded a brand new cvs for flightgear and it began to compile (and maybe simgear). HTH, Seamus On Fri, 7 Nov 2003, Richard Hornby wrote: Seamus Carrol got the same problem - now I am getting it too! (src, simgear and plib all cvs versions). Did anybody manage to fix it? Melchior and Andy will appreciate that this is a HUGE advance in the build, thanks to their patient explanations of CVS and other mysteries. Thanks, R - Original Message - From: Will Howard [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, October 31, 2003 10:57 AM Subject: [Flightgear-devel] Compliation of CVS Source Error Hello: I cannot get the CVS source to compile. I updated at 5:30am GMT. Here is the final error in the ./scene/sky directory: /usr/local/src/flightSim/SimGear/simgear/scene/sky/cloud.cxx:453: undefined reference to `ssgCullAndDraw(ssgRoot*)' /usr/local/lib/libsgsky.a(sky.o)(.text+0x7fc): In function `SGSky::preDraw(float, float)': /usr/local/src/flightSim/SimGear/simgear/scene/sky/sky.cxx:175: undefined reference to `ssgCullAndDraw(ssgRoot*)' collect2: ld returned 1 exit status ++Peace, -- Will Howard ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] [Repost] Simulating ground activity (fwd)
I now have cubes and cylinders of various colours moving around in the flightgear world. Currently I specify a starting lon, lat and the roaming distance in meters in either the lon, lat direction. I can have about 100 vehicles being updated 3 times a second each before my p4 1.4ghz really begins to slow down (20fps). Currently the vehicles move in a rondom direction at a randomly changing speed. The min and max speed limit is expressed in km/h so accurate movement is not dependant on the number of frames per second. I would like to say thanks to those that have helped me so far. The next step is to have the vehicles move down the real road networks (stored in postgres using the postgis module) at the proper speed limits. Before I do this I am trying to eek out better performance. Here is my question: Is it possible to determine if a vehicle is in the viewing area of the plane using the lon, lat of the vehicle? If this is so I will be able to eliminate large amounts of computation. Seamus On Tue, 4 Nov 2003, Seamus Thomas Carroll wrote: Sorry, I modified transform a bit and forgot to * pos.elev by SG_METER_TO_FEET. I added that bit and models started viewing correctly. My comment was regards to flight gear using feet when meters (to me) should be the unit of choice internally. The international standard unit of length is meters so I was caught off gaurd when feet showed itself. Seamus On Tue, 4 Nov 2003, David Luff wrote: On 11/3/03 at 7:39 PM Seamus Thomas Carroll wrote: I just found the bug. DoGroundElev obtains a value in meters but the update in FGAIEntity expects a value in feet. I fixed the units and now the models are viewing correctly. Does anyone know why the code needs to feet and meters? Hi Seamus, I'm afraid I'm not at all sure what you mean! The AI system uses meters internally, and FGAIEntity expects pos.elev() to be in meters. It is converted to feet on the fly in FGAIEntity::Transform since that is what SGModelPlacement requires :-( but as far as I know is maintained consistently in meters internally: void FGAIEntity::Transform() { aip.setPosition(pos.lon(), pos.lat(), pos.elev() * SG_METER_TO_FEET); aip.setOrientation(roll, pitch, hdg); aip.update( globals-get_scenery()-get_center() ); } where aip is an instance of SGModelPlacement. If you could post the code that you think is wrong and your fix then I'll have a look at it. Cheers - Dave ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
RE: [Flightgear-devel] [Repost] Simulating ground activity (fwd)
Can you direct me to where i can find HitList::fgCurrentElevation()? i have run grep on simgear and flightgear plus searched in google and I still cant find mention of this function. Seamus On Thu, 6 Nov 2003, Norman Vine wrote: Seamus Thomas Carroll writes: Is it possible to determine if a vehicle is in the viewing area of the plane using the lon, lat of the vehicle? No FWIW Using a Lat Lon representation of your position is horribly inefficient So I recommend doing all your motion relative to a local plane then use a slightly modified HitList::fgCurrentElevation() to determine your actual contact point It's not really not that tough but there are a few wrinkles that you must internalize i.e. current tile center based world Note that the hitlist structure saves a pointer to the actual PLib Collection intersected and the index of the 'hit' triangle from which you can determine your new position. Cheers Norman ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] loading 3D objects
Ya it works correctly, As responded by Andy earlier if you open your *.ac file in a text editor and remove the line crease 45.00, save and load into flightgear everything should work. Be warned that I only created very simple models so I dont know if there are other problems that may occur. Seamus On Tue, 4 Nov 2003, Innis Cunningham wrote: Hi Seamus Am I reading you right that you have got AC3D 4.0 to create models without giving a fatal error in FG. If so how as I went back to my previous copy untill the problem is solved Seamus Thomas Carroll I am loading the objects correctly now, thanks. I am having difficulty determining size in ac3d. Is there way of approximating size in meters in ac3d that will translate correctly in flightgear? Seamus Cheers Innis The Mad Aussi _ Hot chart ringtones and polyphonics. Go to http://ninemsn.com.au/mobilemania/default.asp ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] loading 3D objects
OK, I will try it out. I did not notice that this was heavily talked about last week. I searched google but it does not know about these pages yet. Seamus On Mon, 3 Nov 2003, Andy Ross wrote: Seamus Thomas Carroll wrote (on flightgear-devel): I am trying to load a 3D object using sgLoad3DModel. I have created a simple cube and when I try to load it I get the following error: FATAL: ac_to_gl: Unrecognised token 'crease 45.00 The new version of AC3D emits a new token, crease, that plib doesn't recognize. Blame the program for changing its file format. For now, I believe you can simply edit the resulting .ac file and manually remove the offending line. Plib support for parsing the new token would be easy to implement. Code to actually *interpret* the thing correctly is turning out to be a nightmare. I thought I had it done about a week back, but it turned out that I need to handle cases (duplicated vertices and degenerate triangles) that complicate things a bit. I've been through about six iterations now of writing code that I thought would work, only to discover during debugging that I'd misunderstood the problem completely. I swear, the YASim solver was a cake walk compared to this. :) But I'm still working on it. I finished another iteration this morning before work, which I'm maybe 95% sure is correct. It's still mismapping the newly split normals, but I think that's just a bug and not another algorithm goof. Andy ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] [Repost] Simulating ground activity (fwd)
Hi, I am following the code in FGAILocalTraffic::DoGroundElev() to get the elevation of an object in space at a particular lon, lat. When I display the model it is placed under the ground and is not visible. If i add elevation to the value returned from DoGroundElev the model becomes visible. Is there any advice on this topic? Seamus On Thu, 23 Oct 2003, Seamus Thomas Carroll wrote: This is great, thanks for the reply. I have now started and will be asking questions as needed. What is the best way to create a simple vehicle taking into account I have no experience with graphics? Seamus On Thu, 23 Oct 2003, David Luff wrote: On 10/22/03 at 12:41 PM Seamus Thomas Carroll wrote: Hi, Judging by the reponse from the users group I am guessing this has not been done so I am now posting to the devel group because it looks like this is something that needs to be done. Besides the fact that his is something that I need for my thesis I also think it will add a level of realism to the simulation. I want to start off small with simple shapes moving on the ground but if successful vehicles (cars, ships, etc) could be represented that follow road networks based on GIS data. Here is my current idea on how to do this. In the main loop call an object that keeps track of the moving vehicles. Each moving vehicle will have a current lat, long so that it can be updated into the simulation. As the current lat, long changes movement will be observed. Hi Seamus, I suggest you call a manager from the main loop that calls all the individual objects in order to keep clutter in the main loop down. So, in fg_init.cxx, something like globals-get_ground_activity_mgr()-init(); and in main.cxx, something like globals-get_ground_activity_mgr()-update(); and add it to globals as well. What i have described so for is the easy part. What confuses me is how to display these vehicles in flightgear. Something similiar has been done with the AI planes so some hints on how this was accomplished might point me in the right direction. I'm the guilty party there. Have a look in the ATC directory. FGAIEntity (in AIEntity.[ch]xx) is a simple base class for my AI traffic - by updating its position and orientation and then calling Transform() the 3D model is moved to the correct position. I derive or intend to derive various more useful classes from it. You can as well if you are so inclined. As an aside - the difficulty in rendering a 3D model in FG from its lat,lon position and roll, pitch, heading orientation is because both the position and orientation must be transformed to FG's coordinate system, and of course the transformation of the orientation is dependent on the position. This is done by the SGModelPlacement class, which each FGAIEntity contains an instance of. If you look at FGAIMgr, that contains a list of all the AI entities and updates them all each frame. Since the FGAIEntity update function is virtual the correct update for the actual entity gets called. At the moment it traverses all the entities each time step, but could be modified to spread the load as long as dt was calculated properly each time. See FGATCmgr's update for an example of this - it only updates one ATC station each time step. The AI manager is also responsible for creating, initialising and deleting AI entities. To get going you could just hack the AIMgr to add and update your ground entities. I believe that it might also be possible to have a 3D model rendered by placing a pointer to the model, and it position and orientation, in the correct place in the property tree where the FG model manager looks, and just updating the position/orientation properties when you want it to move. I've never managed it though - someone who understands it (Jim W?, David M?) would have to answer that one. I have read in other posts that finding the ground level of an arbitary point is difficult. Is this still so? I would use this value to keep the vehilces just above ground level. I've managed it (with Jim Wilsons help - thanks Jim!), but it's non-trivial. See FGAILocalTraffic::DoGroundElev() (near the end of the file) and note the checks to ensure a valid ground elev has been determined before using it in the update/fly/taxi sections. It's probably an expensive operation - you might want to not do it every frame for every object. HTH, have fun, I won't be picking up much email in the next week or so unfortunately, Oh yes, and don't use FGGround as a class name - that's already used for ground ATC control :-) Cheers - Dave ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] [Repost] Simulating ground activity (fwd)
I just found the bug. DoGroundElev obtains a value in meters but the update in FGAIEntity expects a value in feet. I fixed the units and now the models are viewing correctly. Does anyone know why the code needs to feet and meters? Seamus On Mon, 3 Nov 2003, David Culp wrote: I am following the code in FGAILocalTraffic::DoGroundElev() to get the elevation of an object in space at a particular lon, lat. When I display the model it is placed under the ground and is not visible. If i add elevation to the value returned from DoGroundElev the model becomes visible. It looks like you need to add an offset to account for the vehicle's height: DoGroundElev(); if(aip.getSGLocation()-get_cur_elev_m() -9990.0) { pos.setelev(aip.getSGLocation()-get_cur_elev_m() + wheelOffset); But I'm certainly no expert on this. Dave -- David Culp davidculp2[at]comcast.net ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] [Repost] Simulating ground activity (fwd)
This is great, thanks for the reply. I have now started and will be asking questions as needed. What is the best way to create a simple vehicle taking into account I have no experience with graphics? Seamus On Thu, 23 Oct 2003, David Luff wrote: On 10/22/03 at 12:41 PM Seamus Thomas Carroll wrote: Hi, Judging by the reponse from the users group I am guessing this has not been done so I am now posting to the devel group because it looks like this is something that needs to be done. Besides the fact that his is something that I need for my thesis I also think it will add a level of realism to the simulation. I want to start off small with simple shapes moving on the ground but if successful vehicles (cars, ships, etc) could be represented that follow road networks based on GIS data. Here is my current idea on how to do this. In the main loop call an object that keeps track of the moving vehicles. Each moving vehicle will have a current lat, long so that it can be updated into the simulation. As the current lat, long changes movement will be observed. Hi Seamus, I suggest you call a manager from the main loop that calls all the individual objects in order to keep clutter in the main loop down. So, in fg_init.cxx, something like globals-get_ground_activity_mgr()-init(); and in main.cxx, something like globals-get_ground_activity_mgr()-update(); and add it to globals as well. What i have described so for is the easy part. What confuses me is how to display these vehicles in flightgear. Something similiar has been done with the AI planes so some hints on how this was accomplished might point me in the right direction. I'm the guilty party there. Have a look in the ATC directory. FGAIEntity (in AIEntity.[ch]xx) is a simple base class for my AI traffic - by updating its position and orientation and then calling Transform() the 3D model is moved to the correct position. I derive or intend to derive various more useful classes from it. You can as well if you are so inclined. As an aside - the difficulty in rendering a 3D model in FG from its lat,lon position and roll, pitch, heading orientation is because both the position and orientation must be transformed to FG's coordinate system, and of course the transformation of the orientation is dependent on the position. This is done by the SGModelPlacement class, which each FGAIEntity contains an instance of. If you look at FGAIMgr, that contains a list of all the AI entities and updates them all each frame. Since the FGAIEntity update function is virtual the correct update for the actual entity gets called. At the moment it traverses all the entities each time step, but could be modified to spread the load as long as dt was calculated properly each time. See FGATCmgr's update for an example of this - it only updates one ATC station each time step. The AI manager is also responsible for creating, initialising and deleting AI entities. To get going you could just hack the AIMgr to add and update your ground entities. I believe that it might also be possible to have a 3D model rendered by placing a pointer to the model, and it position and orientation, in the correct place in the property tree where the FG model manager looks, and just updating the position/orientation properties when you want it to move. I've never managed it though - someone who understands it (Jim W?, David M?) would have to answer that one. I have read in other posts that finding the ground level of an arbitary point is difficult. Is this still so? I would use this value to keep the vehilces just above ground level. I've managed it (with Jim Wilsons help - thanks Jim!), but it's non-trivial. See FGAILocalTraffic::DoGroundElev() (near the end of the file) and note the checks to ensure a valid ground elev has been determined before using it in the update/fly/taxi sections. It's probably an expensive operation - you might want to not do it every frame for every object. HTH, have fun, I won't be picking up much email in the next week or so unfortunately, Oh yes, and don't use FGGround as a class name - that's already used for ground ATC control :-) Cheers - Dave ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
[Flightgear-devel] [Repost] Simulating ground activity (fwd)
Hi, Judging by the reponse from the users group I am guessing this has not been done so I am now posting to the devel group because it looks like this is something that needs to be done. Besides the fact that his is something that I need for my thesis I also think it will add a level of realism to the simulation. I want to start off small with simple shapes moving on the ground but if successful vehicles (cars, ships, etc) could be represented that follow road networks based on GIS data. Here is my current idea on how to do this. In the main loop call an object that keeps track of the moving vehicles. Each moving vehicle will have a current lat, long so that it can be updated into the simulation. As the current lat, long changes movement will be observed. What i have described so for is the easy part. What confuses me is how to display these vehicles in flightgear. Something similiar has been done with the AI planes so some hints on how this was accomplished might point me in the right direction. I have read in other posts that finding the ground level of an arbitary point is difficult. Is this still so? I would use this value to keep the vehilces just above ground level. Thanks for reading this far, Seamus -- Forwarded message -- Date: Mon, 20 Oct 2003 11:59:30 -0600 (MDT) From: Seamus Thomas Carroll [EMAIL PROTECTED] Reply-To: FlightGear user discussions [EMAIL PROTECTED] To: FlightGear user discussions [EMAIL PROTECTED] Subject: [Flightgear-users] Simulating ground activity Hi, Has anyone tried simulating ground activity? This could be as simple as shapes moving around on the ground. If not, do you have any suggestions on how this might be achieved? What I am looking for is activity on the ground that is observable from several mulitplayer flightgear simulations running at the same time. Seamus ___ Flightgear-users mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-users ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
RE: [Flightgear-devel] Understanding Autopilot and other topicsinflightgear
Thanks for the help. The autopilot now works. Two things to note is that i have the lat and lon backwards below when declaring SGWayPoint and after calling set_HeadingMode i needed to call globals-get_autopilot()-set_HeadingEnabled( true ); Hope this helps others, Seamus On Fri, 17 Oct 2003, Norman Vine wrote: Seamus Thomas Carroll writesL Hi, I am trying to add a waypoint using the following code: SGWayPoint *wp = new SGWayPoint( 49.390545, -121.438942, 4000, SGWayPoint::WGS84, HOPE ); globals-get_route()-add_waypoint( *wp ); This looks OK. The waypoint is a location north of Vancouver, BC. The lat and long is in decimal degrees. When this code executes nothing happens. You probably didn't turn the AP on :-) see below Is there a flag I need to set to get the autopilot to work? I have traced through the code and have added cout statements and have observed that void FGAutopilot::update (double dt) is being called. Any suggestions? There is a way to do this with the fgCommand Interface also but the *raw* 'C' command is void FGAutopilot::set_HeadingMode( fgAutoHeadingMode mode ) { You want to use FG_HEADING_WAYPOINT for 'mode' HTH Norman ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
[Flightgear-devel] Understanding Autopilot and other topics in flightgear
Hi, I now have flightgear running with the latest CVS and have a good understanding on how to use the program. I am now into coding in Flightgear. I have added to menubar.xml and have bound the commands to some functions I have created. I am now working on creating the autonomous flying aircraft. I want to start off with the aircraft getting its jobs from a postgres database. I am thinking of using postgres because of its support for gis data using the postgis module. These job could be in the form of an airport id or (lat, long) to fly too. To begin a prototyping I was thinking of copying the behaviour of autopilot when add to waypoint is called. I have traced the code to void AddWayPoint(puObject *cb) in auto_gui.cxx but that is when the code gets confusing because the old method of displaying a dialog box is used. Is anyone who understands this code willing to step me through the process of obtaining waypoints and using these waypoints to decide the heading of the plane and overriding other inputs while in autopilot? I may have missed some documentation that describes this so please point it out if I have. Seamus ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
[Flightgear-devel] Flightgear CVS undefinded reference error
Hi, I have just installed the latest CVS of Simgear and am now trying to install flightgear from the CVS tarball. I am recieving the error: /scratch/simgear//lib/libsgsky.a(cloud.o): In function `SGCloudLayer::draw(void)': /scratch/simgear/SimGear/simgear/scene/sky/cloud.cxx:453: undefined reference to `ssgCullAndDraw(ssgRoot *)' /scratch/simgear//lib/libsgsky.a(sky.o): In function `SGSky::preDraw(float, float)': /scratch/simgear/SimGear/simgear/scene/sky/sky.cxx:175: undefined reference to `ssgCullAndDraw(ssgRoot *)' collect2: ld returned 1 exit status make[2]: *** [fgfs] Error 1 make[2]: Leaving directory `/scratch/flightgear/FlightGear-CVS/FlightGear/src/Main' make[1]: *** [install-recursive] Error 1 make[1]: Leaving directory `/scratch/flightgear/FlightGear-CVS/FlightGear/src' make: *** [install-recursive] Error 1 plib is also from CVS. Any suggestions? Seamus ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
[Flightgear-devel] Flightgear and Simgear CVS compile problems
When trying to compile the CVS of flightgear or simgear I recieve a missing seperator error. I think I have installed the latest CVS of plib correctly but it does not seem to make a difference in the error. Simgear error: Making all in src-libs make[1]: Entering directory `/scratch/simgear/SimGear-01-10-03/src-libs' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/scratch/simgear/SimGear-01-10-03/src-libs' Making all in simgear make[1]: Entering directory `/scratch/simgear/SimGear-01-10-03/simgear' make all-recursive make[2]: Entering directory `/scratch/simgear/SimGear-01-10-03/simgear' Making all in xml make[3]: Entering directory `/scratch/simgear/SimGear-01-10-03/simgear/xml' Makefile:188: *** missing separator. Stop. make[3]: Leaving directory `/scratch/simgear/SimGear-01-10-03/simgear/xml' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/scratch/simgear/SimGear-01-10-03/simgear' make[1]: *** [all] Error 2 make[1]: Leaving directory `/scratch/simgear/SimGear-01-10-03/simgear' make: *** [all-recursive] Error 1 Flightgear error: Making all in tests make[1]: Entering directory `/scratch/flightgear/FlightGear-CVS/FlightGear-30-09-03/tests' Makefile:236: *** missing separator. Stop. make[1]: Leaving directory `/scratch/flightgear/FlightGear-CVS/FlightGear-30-09-03/tests' make: *** [all-recursive] Error 1 Does anyone know what is causing these errors? Seamus ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel