Board index FlightGear Support osgEarth

Initial FlightGear / OsgEarth integration

osgEarth renders the terrain scene by building the textured geometry at runtime from raw source imagery and elevation data. An experimental FlightGear integration is currently available.

Re: Initial FlightGear / OsgEarth integration

Postby pommesschranke » Tue Nov 26, 2013 12:44 pm

I applied the patch and flightgear starts, including the new menu entry & dialog.
but when I enable osgEarth it segfaults.

on my linux Mint 13 (x86_64) I had to do a few things to make fgfs run (before the segfault)

apt-get install libplib-dev
apt-get install libgdal1-dev libgdal1-1.7.0 gdal-bin
apt-get install libosgearth1 (2.0+dfsg-4build1)
apt-get install libopenthreads-dev libopenthreads14
ln -s ./libOpenThreads.so.2.6.0 libOpenThreads.so.12 (I only have libOpenThreads.so.14)

fgdata/OsgEarthCache must be writable for the user.
before my flight it was empty. after my flight it is almost 1GB ;-)

at runtime OsgEarthCache/GeneratedHeightFields is created but without rw rights for anyone (d------)
I fixed that: chmod 777 GeneratedHeightFields


It's running stable now for more than 30 minutes without a crash :D
it looks similar to your screenshots - very nice!

issues:
* I was unable to use the right mouse button to change modes & view direction ?
* after a segfault I have to remove ~/.fgfs to make Flightgear runnable again.



It's awesome, fantastic, great!
It's like flying in google earth :-)
Is it here to stay, or will those "arc-gis" servers close down when too many people are using it ?

Thank You!
pommesschranke
 
Posts: 1104
Joined: Sat Apr 27, 2013 7:58 pm
Location: EDLM & LJCE
Callsign: d-laser
IRC name: laserman
Version: git
OS: Linux Lubuntu 18.04

Re: Initial FlightGear / OsgEarth integration

Postby ludomotico » Tue Nov 26, 2013 1:23 pm

poweroftwo, your 2.99 repositories compile and run perfectly so I'll remove my repositories to prevent misunderstandings.

I downloaded and uncompressed some kmz files in the Scenery/Terrain/OsgEarth/Models directory, but I couldn't see them in the scenery. Not sure if I understand how these files work, though. Where is the information about their position in the world: latitude, longitude, elevation?

Is there any easy way to add current objects in terrasync to the scenery? This would be an amazing enhancement. I checked the source code, but I'm not even sure if the scenery objects are managed by flightgear or simgear.

It is amazing how easy you can add a new wms server for local coverage :)
User avatar
ludomotico
 
Posts: 1055
Joined: Tue Apr 24, 2012 1:01 pm
Version: git
OS: Debian GNU/Linux

Re: Initial FlightGear / OsgEarth integration

Postby poweroftwo » Tue Nov 26, 2013 1:25 pm

I applied the patch and flightgear starts, including the new menu entry & dialog.
but when I enable osgEarth it segfaults.

on my linux Mint 13 (x86_64) I had to do a few things to make fgfs run (before the segfault)

apt-get install libplib-dev
apt-get install libgdal1-dev libgdal1-1.7.0 gdal-bin
apt-get install libosgearth1 (2.0+dfsg-4build1)
apt-get install libopenthreads-dev libopenthreads14
ln -s ./libOpenThreads.so.2.6.0 libOpenThreads.so.12 (I only have libOpenThreads.so.14)


pommesschranke,

Thanks for doing further testing. Both Hooray and ludomotico had to do similar work arounds to install osgEarth for Linux.

We need a consistent method of installing osgEarth. Probably worth discussing on osgEarth forum: http://forum.osgearth.org/


fgdata/OsgEarthCache must be writable for the user.
before my flight it was empty. after my flight it is almost 1GB ;-)

at runtime OsgEarthCache/GeneratedHeightFields is created but without rw rights for anyone (d------)
I fixed that: chmod 777 GeneratedHeightFields


Once I move the OsgEarthCache directory to $FG_HOME by default, I believe the permissions issue will be resolved.

It's running stable now for more than 30 minutes without a crash :D
it looks similar to your screenshots - very nice!

issues:
* I was unable to use the right mouse button to change modes & view direction ?
* after a segfault I have to remove ~/.fgfs to make Flightgear runnable again.


I don't know what would cause the mouse issue or cause the exception.

It's awesome, fantastic, great!
It's like flying in google earth :-)
Is it here to stay, or will those "arc-gis" servers close down when too many people are using it ?

Thank You!


thanks again for the feedback!

jeff
poweroftwo
 
Posts: 100
Joined: Tue Mar 05, 2013 3:35 am
Location: USA - Alabama

Re: Initial FlightGear / OsgEarth integration

Postby poweroftwo » Tue Nov 26, 2013 1:35 pm

Is it here to stay, or will those "arc-gis" servers close down when too many people are using it ?


I hope they stick around. As ludomotico mentioned, other servers can be easily added as they become available.

I am pretty confident that ArcGis can handle a pretty good load as they are heavily used by commercial industry. Here is the ArcGis Explorer that is quite useful: http://www.esri.com/software/arcgis/explorer/download
poweroftwo
 
Posts: 100
Joined: Tue Mar 05, 2013 3:35 am
Location: USA - Alabama

Re: Initial FlightGear / OsgEarth integration

Postby poweroftwo » Tue Nov 26, 2013 1:42 pm

ludomotico wrote in Tue Nov 26, 2013 1:23 pm:poweroftwo, your 2.99 repositories compile and run perfectly so I'll remove my repositories to prevent misunderstandings.

I downloaded and uncompressed some kmz files in the Scenery/Terrain/OsgEarth/Models directory, but I couldn't see them in the scenery. Not sure if I understand how these files work, though. Where is the information about their position in the world: latitude, longitude, elevation?

Is there any easy way to add current objects in terrasync to the scenery? This would be an amazing enhancement. I checked the source code, but I'm not even sure if the scenery objects are managed by flightgear or simgear.

It is amazing how easy you can add a new wms server for local coverage :)


ludomotico,

Currently only KML are loaded. I believe that OSG does not currently support loading models from a compressed stream yet. Uncompress you KMZ and try again.

The geolocation information is found in the KML (XML) file.

• KML 3D models (cultural features such as geo-located buildings and structures)
    Geographically located features such as building and structures will be automatically positioned and clamped to the terrain surface.
    Sample KML files are available from the Sketchup 3DWarehouse. http://sketchup.google.com/3dwarehouse
    It is advisable to be selective when choosing models to download from the 3D warehouse as quality varies. Also note that the 3D warehouse contains redundant models of the same feature.
    Place uncompressed KML folders in fgdata\Scenery\Terrain\OsgEarth\KMLFiles.
    Loading of models from KMZ archives is not currently supported. The KMZ must be uncompressed in place, in order for FlightGear to digest.
    Important Performance Note: loading of KML models is currently a technical demonstration and is not a functional replacement of the current FlightGear implementation. The addition of a high number of KML models to the input folder will substantially slow down the initial runtime loading. Unnecessarily complex models will also slow runtime rendering performance.
    The KML referenced Collada (DAE) files are optimized (i.e. LOD node added, textures compressed and embedded etc.) into fast loadable OSG “ive” files stored in the disk cache folder.

The KML loading is handled in simgear here:

from simgear\scene\tgdb\ReaderWriterSTG.cxx
OsgEarthLoadKML::Instance()->LoadModels

KML processing is here:
simgear\scene\util\OsgEarthLoadKML.cxx
poweroftwo
 
Posts: 100
Joined: Tue Mar 05, 2013 3:35 am
Location: USA - Alabama

Re: Initial FlightGear / OsgEarth integration

Postby Hooray » Tue Nov 26, 2013 2:55 pm

poweroftwo wrote in Tue Nov 26, 2013 2:45 am:I was not able to upload the full 2.99 fg data. So you can use the following to overwrite these few files in fg data.

but here is the minimal 2.99 fgData Patch:
https://drive.google.com/file/d/0B_-l3k ... sp=sharing


I applied your patch onto 2.99 fgdata and pushed everything to a gitorious branch, you may want to merge this with your own 2.99 osgIntegration branch, so that everything is in one place. Afterwards, I will delete my branch to avoid any confusion.

See: https://gitorious.org/fg/hoorays-fgdata ... f63c57217e
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11606
Joined: Tue Mar 25, 2008 8:40 am

Re: Initial FlightGear / OsgEarth integration

Postby ludomotico » Tue Nov 26, 2013 4:07 pm

poweroftwo wrote in Tue Nov 26, 2013 1:25 pm:We need a consistent method of installing osgEarth. Probably worth discussing on osgEarth forum: http://forum.osgearth.org/


Actually, the problem seems to be osgEarth is not included in the rpath. This is probably a Linux-only issue, and must be addressed with some configuration in the CMake file. As I said, this can be manually fixed by overriding the paths CMake provides by default:

cmake -DCMAKE_INSTALL_RPATH="/usr/local/lib64" ..

(this line will only work on my system, a Debian system with osgEarth libraries built from source code)

So, we "only" have to identify where cmake creates the variable CMAKE_INSTALL_RPATH and add the path to the osgEarth library.

Once I move the OsgEarthCache directory to $FG_HOME by default, I believe the permissions issue will be resolved.


No, they won't :)

simgear/simgear/scene/util/OsgEarthReadFileCallback.cxx#323 uses sgPath.create_dir(0); This creates a directory without any permission (0000) A more correct line is:

sgPath.create_dir( 0755 );

That is: the user has all permissions on the directories (7), user in the same group can enter and list directories (the first 5), the same for the rest of users (the second 5) 0700 can also be a valid value: all permissions to the user, no permissions to anyone else. warning: notice the leading 0 (zero)!

This also happens in flightgear/src/Viewer/OsgEarthHeightField.cxx#464: sgPath.create_dir(0); must be sgPath.create_dir( 0755 );

BTW, there are some other places in flightgear and simgear where this line reads sgPath.create_dir( 0777 ); This is most probably wrong, too permissive directories for everyone, but it is not your code.

Regarding the KML files, I did uncompressed the KMZ file, but still couldn't see the object on the scenery. Can you provide a link to some KMZ objects I can test?
Last edited by ludomotico on Tue Nov 26, 2013 4:32 pm, edited 3 times in total.
User avatar
ludomotico
 
Posts: 1055
Joined: Tue Apr 24, 2012 1:01 pm
Version: git
OS: Debian GNU/Linux

Re: Initial FlightGear / OsgEarth integration

Postby poweroftwo » Tue Nov 26, 2013 4:27 pm

ludomotico,

thanks for the clarification on the permissions. I will update the code a bit later.


Not sure if you have the Collada loader built. You might check that.

here is a pretty good model at KSFO:

http://sketchup.google.com/3dwarehouse/download?mid=48e13b129ae0ce2b50063f87cdddfcb&rtyp=zs&fn=KSFO%5B1%5D&ctyp=other&prevstart=0&ts=1221758887000
poweroftwo
 
Posts: 100
Joined: Tue Mar 05, 2013 3:35 am
Location: USA - Alabama

Re: Initial FlightGear / OsgEarth integration

Postby ludomotico » Tue Nov 26, 2013 4:38 pm

Oh, I didn't build nor install any collada related library so this must be the issue :) I'll check.
User avatar
ludomotico
 
Posts: 1055
Joined: Tue Apr 24, 2012 1:01 pm
Version: git
OS: Debian GNU/Linux

Re: Initial FlightGear / OsgEarth integration

Postby poweroftwo » Tue Nov 26, 2013 6:11 pm

looks like you will need Collada DOM built:
https://collada.org/mediawiki/index.php/DOM_guide:_Setting_up

Also the OSG dae plugin needs to be built.
poweroftwo
 
Posts: 100
Joined: Tue Mar 05, 2013 3:35 am
Location: USA - Alabama

Re: Initial FlightGear / OsgEarth integration

Postby ludomotico » Tue Nov 26, 2013 7:25 pm

Funny thing building the last version of OpenSceneGraph:

The build system is configured to install libraries to /usr/local/lib64
Your applications may not be able to find your installed libraries unless you:
set your LD_LIBRARY_PATH (user specific) or
update your ld.so configuration (system wide)
You have an ld.so.conf.d directory on your system, so if you wish to ensure that
applications find the installed osg libraries, system wide, you could install an
OpenSceneGraph specific ld.so configuration with:
sudo make install_ld_conf


This is exactly our issue with the LD_LIBRARY_PATH! Some more research need to be done, it may be the Debian gurus decided the system was meant to be like this!
User avatar
ludomotico
 
Posts: 1055
Joined: Tue Apr 24, 2012 1:01 pm
Version: git
OS: Debian GNU/Linux

Re: Initial FlightGear / OsgEarth integration

Postby Hooray » Tue Nov 26, 2013 8:07 pm

poweroftwo wrote in Tue Nov 26, 2013 4:27 pm:Not sure if you have the Collada loader built. You might check that.


BTW: any such build-related information (osgEarth version, supported loaders etc) would ideally be written to the property tree for runtime troubleshooting, see $FG_SRC/Main/options.cxx
https://gitorious.org/fg/flightgear/sou ... s.cxx#L225

We could then also extend the help/about dialog to show the corresponding osgEarth info:
Image
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11606
Joined: Tue Mar 25, 2008 8:40 am

Re: Initial FlightGear / OsgEarth integration

Postby saiarcot895 » Mon Dec 23, 2013 4:47 pm

ludomotico wrote in Tue Nov 26, 2013 7:25 pm:Funny thing building the last version of OpenSceneGraph:

The build system is configured to install libraries to /usr/local/lib64
Your applications may not be able to find your installed libraries unless you:
set your LD_LIBRARY_PATH (user specific) or
update your ld.so configuration (system wide)
You have an ld.so.conf.d directory on your system, so if you wish to ensure that
applications find the installed osg libraries, system wide, you could install an
OpenSceneGraph specific ld.so configuration with:
sudo make install_ld_conf


This is exactly our issue with the LD_LIBRARY_PATH! Some more research need to be done, it may be the Debian gurus decided the system was meant to be like this!


On Ubuntu, at least, when using CMake to install, by default, it places applications/libraries in /usr/local/bin and /usr/local/lib, since these are considered "local" versions of the applications (not from a repo or anything). That being said, I was under the impression that /usr/local/lib (and possible /usr/local/lib64) is automatically included in the library search path for installation and runtime.
Saikrishna Arcot

My FlightGear PPAs: FlightGear Stable, FlightGear Development (Edge)
saiarcot895
 
Posts: 310
Joined: Sat Feb 02, 2013 4:26 pm
Callsign: flyhigh
Version: 2019.2.0
OS: Ubuntu 19.04

Re: Initial FlightGear / OsgEarth integration

Postby Hooray » Mon Dec 23, 2013 4:52 pm

I think the real issue is that we're NOT installing anything here - the RPATH should be properly set to point to the corresponding libs, which doesn't seem to be the case until things are indeed installed system-wide - there's a discussion in the cmake archives about this (also see the wiki) - most developers will typically have multiple build directories with different versions of OSG/SG/FG - having to install things is a bit awkward obviously.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 11606
Joined: Tue Mar 25, 2008 8:40 am

Re: Initial FlightGear / OsgEarth integration

Postby mike4 » Wed Jan 01, 2014 10:39 am

A short video for the developer that will be removed soon.
http://www.youtube.com/watch?v=zLRyRHvvKSY
Swiss (non GPL) airports:
http://fgfs.sgier.com/
mike4
 
Posts: 80
Joined: Mon May 28, 2012 5:03 am
Version: GIT
OS: Ubuntu etc.

PreviousNext

Return to osgEarth

Who is online

Users browsing this forum: No registered users and 1 guest