Board index FlightGear Development New features

DIS (Distributed Interactive Simulation)

Discussion and requests for new features. Please note that FlightGear developers are volunteers and may or may not be able to consider these requests.

Re: DIS (Distributed Interactive Simulation)

Postby Chet » Wed Mar 25, 2009 1:26 pm

karljj1 wrote:Hello,

I wrote KDIS(http://sourceforge.net/projects/kdis), if you guys are still looking for a DIS interface for flightgear i would be happy to take a look at doing it.

Karl


I think that wouold be great.
Chet
 
Posts: 8
Joined: Wed May 09, 2007 7:54 pm

Re: DIS (Distributed Interactive Simulation)

Postby karljj1 » Sat Mar 28, 2009 1:43 am

Ok cool, ill start looking at the best way to do it.

Can anyone point me to a good guide for setting up the project, im using http://wiki.flightgear.org/index.php/Bu ... _-_Windows but it doesnt seem to be working for me, says im missing some files.

Ill try it again from scratch, i probably did a step wrong :(
karljj1
 
Posts: 13
Joined: Sat Mar 21, 2009 4:50 pm
Location: UK

Re: DIS (Distributed Interactive Simulation)

Postby Hooray » Sun Mar 29, 2009 1:22 am

Welcome to the forum & FlightGear community, and thanks for your offer to get involved and contribute to FlightGear!

However, I'd be careful with starting to implement this right away without coordination, let me clarify:

So far, it seems you have mostly gotten feedback from fellow FlightGear users, few if any coders or core developers have actually contributed anything to this discussion here (which is probably also due to this being the users forum).

Basically, the only feedback you got so far seems to come from users who apparently don't even know what you are talking about or what your project is about, sorry but that's how I see it ;-)

So, before implementing this you are certainly well advised to talk to the FlightGear developers, or at least to the developers behind fgms, which is the FlightGear multiplayer
server. (it might in fact be easier to base an DIS/HLA interface on top of fgms instead of fgfs).

According to this thread and my understanding of this issue, it seems that the DIS approach could possibly be depreciated by the HLA project that's been discussed here?

I am really not all that familiar with DIS or HLA, but it would be a pity to see yet another effort, project or patch which ends up being in vain.

I am just saying this because I have seen other -useful and good- code not being committed to FlightGear.
And in this case it would seem possibly redundant to implement something that might be depreciated pretty soon.

Maybe you can provide some info on the relationship between DIS and HLA?
What's your opinion on the previously mentioned HLA-based project?
Would you be interested in contributing to the HLA project?
How would these two projects relate to eachother?

Like I said, I am really not all that familiar with the technologies involved, but it would surely be a good idea to coordinate such an effort.
Also, some of the goals for such a project should be clearly defined.

In general, it would be better to discuss this with other core developers-this forum is mostly used by users.

It's also important to keep in mind that the previously posted wiki page is not really to be considered "official", while many ideas and features look useful, none of these were originally contributed by the developers behind fgms or the multiplayer component in FlightGear.

so I would advise to carefully read this thread from the beginning - while there seems to be lots of interest in this thread (according to the view numbers, which are impressive for such a technical thread on a user's forum), it really isn't clear how DIS or HLA relate to one another and how fgms is fitting into the whole picture
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: 11493
Joined: Tue Mar 25, 2008 8:40 am

Re: DIS (Distributed Interactive Simulation)

Postby karljj1 » Sun Mar 29, 2009 12:52 pm

Hi Hooray,

Thanks for your response.

As for the relationship to HLA/DIS i can say that DIS is by no means depreciated. DIS and HLA very different beasts. DIS is very much plug and play, if an application supports DIS it should work straight away however HLA requires the USE of a RTI, basically a server that runs the simulation however there are several different RTI on the market with various services they support, they all work differently so it is very difficult to use more than one together. So an application may say it is HLA but in fact it will only support a single RTI limiting the applications that will work with it. I work in simulation and we use both HLA and DIS, if an application supports both we see that as a plus. If you wanted flightgear to be used in simulation then a DIS/HLA support would be a major selling point. I dont know very much about how flightgears multiplayer works but all DIS needs is the ability to send multicast packets on port 3000, is this currently supported?

Where would be the best place to find the developers, is it the mailing list?

Kind Regards

Karl
karljj1
 
Posts: 13
Joined: Sat Mar 21, 2009 4:50 pm
Location: UK

Re: DIS (Distributed Interactive Simulation)

Postby AndersG » Sun Mar 29, 2009 1:05 pm

karljj1 wrote:I dont know very much about how flightgears multiplayer works but all DIS needs is the ability to send multicast packets on port 3000, is this currently supported?


Of course FlightGear can send UDP packets from/to port 3000! But they most likely don't contain the data (or the data in the form) DIS expects :)
Hmm, but multicast could be an issue, or is it enough to be able to set the right destination address? (I.e. the address of the multicast group?).

Actually, if DIS basic packets have a simple form you might even be able to configure FlightGear's generic protocol to output DIS packets (I have not checked protocol specs (or anything else) for DIS, though).

See $FG_ROOT/Docs/README.protocol , and perhaps the additional capabilities added by this small patch:
http://www.gidenstam.org/FlightGear/Hea ... l.new.diff

If would turn out that are only minor things missing to be able to output DIS packets with a generic protocol I think I can invest a bit of time to implement what's missing.

Cheers,

Anders
Callsign: SE-AG
Aircraft (uhm...): Submarine Scout, Zeppelin NT, ZF Navy free balloon, Nordstern, Hindenburg, Short Empire flying-boat, ZNP-K, North Sea class, MTB T21 class, U.S.S. Monitor, MFI-9B, Type UB I submarine, Gokstad ship, Renault FT.
AndersG
 
Posts: 2454
Joined: Wed Nov 29, 2006 9:20 am
Location: Göteborg, Sweden
Callsign: SE-AG
OS: Debian GNU Linux

Re: DIS (Distributed Interactive Simulation)

Postby karljj1 » Sun Mar 29, 2009 3:15 pm

Hi AndersG,

DIS would need to use Mulicast, this would be a problem if you want to do a DIS simulation over the internet as its not supported. DIS proxies tend to be used for this, an advantge of HLA is it works fine over WAN. For multicast to work it needs to be sent on a multicast address, E.G 192.165.3.255 and the socket need to subscribe to mulicast packets. If you were able to get the multicast issue working then the DIS would be quite simple. Take a look at the Send example in my KDIS library, a Entity State PDU is all you need to send an aircrafts details.

Compared to HLA it would be quite simple to implement as the pakcets are all pre defined, HLA uses a xml scema to define all packets called a FOM, this makes things very difficult as you need a way to map your data to the FOM and support custom FOMs. In comparison a DIS implementation is much simplier and easier to do. There are 67~ DIS PDU but you only need to support 1 to start with. If you wanted to allow other applications to interact with you, such as shoot you down or be shot from you then a further 2 would be needed(Fire PDU and Detonation PDU). Then many more exist for sensors, radio communications etc.


An Entity state PDU is about 144 bytes at min size.

You would probably send one at least every 5 seconds per entity if they had made no changes to course.

This is taken from my example to send a entity state PDU:


// First create the PDU we are going to send, for this example i will use a
// Entity_State_PDU, When this PDU is sent most DIS applications should then show a new entity
EntityIdentifier EntID( 1, 3001, 3 );
ForceID EntForceID( Friendly );
EntityType EntType( 3, 1, 225, 3, 0, 1, 0 ); // A Civilian male
Vector EntityLinearVelocity( 0, 0, 0 );
WorldCoordinates EntityLocation( -2812731.18, -4331994.09, 3729541.03 ); // West coast of USA
EulerAngles EntityOrientation( 0, 0 , 0 );
EntityAppearance EntEA( GeneralAppearance( 0 ), SpecificAppearance( 0 ) ); // Use default values
DeadReckoningParameter DRP( Static, Vector( 0, 0, 0 ), EulerAngles( 0, 0, 0 ) );
EntityMarking EntMarking( ASCII, "KARL", 5 );
EntityCapabilities EntEC( false, false, false, false );

// Create the PDU
Entity_State_PDU Entity( EntID, EntForceID, EntType, EntType, EntityLinearVelocity, EntityLocation,
EntityOrientation, EntEA, DRP, EntMarking, EntEC );

// Set the PDU Header values
Entity.SetProtocolVersion( IEEE_1278_1_1995 );
Entity.SetExerciseID( 1 );
Entity.SetTimeStamp( TimeStamp( RelativeTime, time( NULL ) ) );


char cBuffer[BUFFER_SZ]

// copy the serialised data into the buffer
KDataStream stream;
Entity.Encode( stream );
stream.CopyIntoBuffer( cBuffer, BUFFER_SZ );

// Now send it over your socket
karljj1
 
Posts: 13
Joined: Sat Mar 21, 2009 4:50 pm
Location: UK

Re: DIS (Distributed Interactive Simulation)

Postby AndersG » Sun Mar 29, 2009 3:40 pm

karljj1 wrote:Hi AndersG,

DIS would need to use Mulicast, this would be a problem if you want to do a DIS simulation over the internet as its not supported. DIS proxies tend to be used for this, an advantge of HLA is it works fine over WAN. For multicast to work it needs to be sent on a multicast address, E.G 192.165.3.255 and the socket need to subscribe to mulicast packets. If you were able to get the multicast issue working then the DIS would be quite simple. Take a look at the Send example in my KDIS library, a Entity State PDU is all you need to send an aircrafts details.


I see, I think that means we would have to get changes into plib to add multicast support, as FlightGear uses plib's cross-platform socket abstraction classes to create and use sockets.

Btw, my suggestion was to make a FG XML protocol for creating DIS packets, which (if possible) would make it possible to send DIS packets without recompiling. Whether that is possible or not depend on how DIS data is encoded/serialized into bytes for transmission.

To add an external dependency it needs to be supported on all current FG platforms (I suppose that means all platforms where OSG works, these days :). If you want to experiment with that you could start looking at how the current I/O protocols are implemented/integrated in FG - I think DIS would go in as yet another one of those.

Cheers,

Anders
Callsign: SE-AG
Aircraft (uhm...): Submarine Scout, Zeppelin NT, ZF Navy free balloon, Nordstern, Hindenburg, Short Empire flying-boat, ZNP-K, North Sea class, MTB T21 class, U.S.S. Monitor, MFI-9B, Type UB I submarine, Gokstad ship, Renault FT.
AndersG
 
Posts: 2454
Joined: Wed Nov 29, 2006 9:20 am
Location: Göteborg, Sweden
Callsign: SE-AG
OS: Debian GNU Linux

Re: DIS (Distributed Interactive Simulation)

Postby karljj1 » Sun Mar 29, 2009 5:04 pm

Hi Anders,

It might be possible to use your XML method however the PDUs can get very long and complex, parameters vary in them from entity type so to do it all in XML would be very hard, to do just an entity state might be possible, i wouldnt recomend it.

I noticed PLib supports broadcast, this might work with some DIS applications.

I see DIS being an other option in the Input/Output part of the launcher. How easy is it to add some fields when a person selects DIS?
You would need a Site ID, Application ID, Exercise ID and a link to maybe a text file with entity mappings. My DIS library is cross platform so that should be no problem. I will have a go and see if i can get something working, i have access to several DIS applications to test the output with.
karljj1
 
Posts: 13
Joined: Sat Mar 21, 2009 4:50 pm
Location: UK

Re: DIS (Distributed Interactive Simulation)

Postby Chet » Sun Mar 29, 2009 6:28 pm

Karl,

I'm glad to hear you are going to continue your effort. I also work on a simulation that supports DIS and HLA. I would love to have a flightgear that broadcasts EntityState PDUs. It could also be really interesting to map external entities into flightgear. (Add simulated traffic to fly around in)

I would appreciate it if you would let me know if you get something working (even if it doesn't make the flightgear baseline).

I'd also be glad to help you with some testing.

-Chet
Chet
 
Posts: 8
Joined: Wed May 09, 2007 7:54 pm

Re: DIS (Distributed Interactive Simulation)

Postby karljj1 » Sun Mar 29, 2009 8:12 pm

Hi Chet,

Thanks for your support, i do plan to support external entities. I have written a application that generates air traffic from a live SBS(http://www.kinetic-avionics.co.uk/sbs-1.php) feed and sends out DIS so it would be nice to see it working with this. im afraid this application isnt open source though, its a work thing.

Ill let you know when i have something working.

Regards

Karl

Edit: Can anyone help me with setting up flightgear?
I am following http://wiki.flightgear.org/index.php/Bu ... _-_Windows
I have simgear compliing but not flightgear, i downloaded both via CVS, i notcied that 2 files were missing from simgear. location.hxx and location.cxx. I got the contents of the files from the simgear docs on the simgear site and got it to compile but now flightgear is giving me problems. latest error:

fg_timer.cxx(113) : error C2440: '=' : cannot convert from 'SGTimeStamp' to 'int'

Any help would be super :)

Karl
karljj1
 
Posts: 13
Joined: Sat Mar 21, 2009 4:50 pm
Location: UK

Re: DIS (Distributed Interactive Simulation)

Postby Hooray » Mon Mar 30, 2009 1:49 am

I am not on Windows, but in general you might find it easier to use the mailing list or IRC channel to get in touch with fellow FlightGear users who regularly build FG, this would ensure more direct support, too.
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: 11493
Joined: Tue Mar 25, 2008 8:40 am

Re: DIS (Distributed Interactive Simulation)

Postby NicQ » Mon Mar 30, 2009 2:34 pm

Try this site for step by step instructions to build on windows : http://geoffmclane.com/fg/index.htm
I didn't use the site, and simply used the VC7 project files and converted them automagically to VC9 (and some manual work ;))
Hope that helps,
Cheers !
Nic
If it ain't broke, break it. How else are you going to figure out how it works ?
Callsign: C-NICQ, amateur FGFS military and aerobatic test pilot, pushing the envelope since 2009 (sic)

FGFS Gallery
Birds Of Gear, a blog
NicQ's Workshop
NicQ
 
Posts: 429
Joined: Wed Jan 21, 2009 9:30 pm
Location: Montreal, Qc, Canada

Re: DIS (Distributed Interactive Simulation)

Postby Hooray » Mon Mar 30, 2009 3:35 pm

I have simgear compliing but not flightgear, i downloaded both via CVS, i notcied that 2 files were missing from simgear. location.hxx and location.cxx. I got the contents of the files from the simgear docs on the simgear site and got it to compile


Are you sure that you are trying to compile the latest versions from CVS?

Because those files (location.*xx) really got recently removed from CVS.
So, either your simgear version or version of fg are wrongly referring to it.

Manually adding, modifying or removing files trying to make CVS compile is rarely a good idea, because normally CVS is supposed to just compile.
(If something were really missing in CVS, other people/developers would have noticed that already and fixed it)

So, I think you might be trying to to compile some mismatching versions of SG/FG.
You are unlikely to solve this issue by "manually merging" in differences between mismatching versions ;-)
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: 11493
Joined: Tue Mar 25, 2008 8:40 am

Re: DIS (Distributed Interactive Simulation)

Postby karljj1 » Mon Mar 30, 2009 4:55 pm

I have been following this guide:

http://wiki.flightgear.org/index.php/Bu ... _-_Windows

I will take a look at that FlightGear Build website.

Thanks

Karl
karljj1
 
Posts: 13
Joined: Sat Mar 21, 2009 4:50 pm
Location: UK

Re: DIS (Distributed Interactive Simulation)

Postby karljj1 » Tue Mar 31, 2009 7:13 pm

On the topic of simulation protocols has anyone looked at CIGI?

http://cigi.sourceforge.net/index.php
karljj1
 
Posts: 13
Joined: Sat Mar 21, 2009 4:50 pm
Location: UK

PreviousNext

Return to New features

Who is online

Users browsing this forum: No registered users and 1 guest