Jump to content

Can't load DISConnector


photo

Recommended Posts

Hello,

Pretty sure I'm doing something wrong here, but I can't find what: Engine::get()->findPlugin("DISConnector") returns -1.

What I've done:

- created a new IG project with 2.9.0.2

- added DISConnector after CIGIConnector in extern_plugin command line

- changed IP in ig_config.xml to our local ip 192.168.1.255

- added this code in AppWorldLogic::init

int index = Engine::get()->findPlugin("DISConnector");
if (index < 0) {
	Log::error("NO DIS\n");
	return 1;
}

The Cigi connector works (I can see my simulated cigi entities), but not the DIS connector. Of course, my DIS entities are not visible on screen.

What can I do/test?

Link to comment

More likely DISConnector plugin is not loaded due to missing KDIS 2.9.0 library dependency. You can get latest KDIS sources here: https://sourceforge.net/projects/kdis/files/kdis/Releases/KDIS_v2_9_0.zip/download or download prebuilt binaries from the attachment.

So, basically you need to do the following steps to get DIS working for newly created project:

  1. Replace DISConnector_double_x64*.dll libraries in bin directory to the libraries from DIS_Connector_2.9.0.2_patched_windows_linux.zip
  2. Add kdis.dll and kdisd.dll (if required) to the bin directory from KDIS_2.9.0.2_prebuilt_windows.zip

These issues will be fixed in the upcoming 2.10 SDK update.

Thanks!

KDIS_2.9.0.2_prebuilt_linux.zip KDIS_2.9.0.2_prebuilt_windows.zip

DIS_Connector_2.9.0.2_patched_windows_linux.zip

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

Hi Silent,

With the patched connector and the given lib put in the bin folder, now the DISConnector is correctly loaded. Thanks.

But I must miss something, as I can't see my DIS entities. As a test, I simply broadcast an entity with type  1:2:71:1:1:0:0, site=1, app=3001, entityid=3, excercise=1 (DIS version 7).

In ig_configs.xml, I added this:

<entity id="100" name="mirage" dis_id="1:2:71:1:1:0:0">
	<path>ig/entities/aircrafts/mirage/mirage.node</path>
</entity>

In ig_configs.xml, I kept the default site=1, exercise=1, app=2.

If I add the cigi entity 100, I can see the plane. But not with DIS. I confirmed with Wireshark that I do receive all DIS packet correctly, on the correct interface.

I tried to add a callback to see if the message are received but nothing is printed:


void AppSystemLogic::func(KDIS::PDU::Header* packet)
{
	Log::message("pdu received"); // never called
}

void AppSystemLogic::init_dis()
{
	int index = Engine::get()->findPlugin("DISConnector");
	if (index < 0) {
		Log::error("NO DIS\n");
		return;
	}
	dis = (IG::DIS::ConnectorInterface*)Engine::get()->getPluginData(index);
    // I think PDU type=1 for Entity_State. Can you confirm?
	dis->setCallbackOnRecvPacket(1, MakeCallback(this, &AppSystemLogic::func)); /// callback`s signature: void func(KDIS::PDU::Header *packet);
}

What am I missing?

Link to comment

Hello!

Quote

In ig_configs.xml, I kept the default site=1, exercise=1, app=2.

note that in the patch was fixed a typo in ig_config.xml. "exercide" now spelled "exercise". 

it should be like this:

	<dis_connector>
		<broadcast_address>127.255.255.255</broadcast_address>
		<site>1</site>
		<exercise>1</exercise>
		<app>2</app>
		<view_id>0</view_id>
	</dis_connector>

=========================
 

Quote

<entity id="100" name="mirage" dis_id="1:2:71:1:1:0:0">

scince 2.9 you can write "dis_id" directly in the "id" field

<entity id="1.2.71.1.1.0.0" name="mirage">


========================

Quote

I think PDU type=1 for Entity_State. Can you confirm?

yes, KDIS::DATA_TYPE::ENUMS::Entity_State_PDU_Type = 1;

=======================

I also wanted to note that we have not tested IG work simultaneously with multiple connectors. 

Link to comment

Stephane, sorry, forget to add updated DISConnectorInterface.h.

Just copy it to <project>/source/include/plugins and overwrite existing file.

Btw, could you please specify for which tasks you are plan to use DIS (as far as I know CIGI was working just fine in your case)?

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

Still doesn't work. What I have done:

- replaced DISConnectorInterface.h with the fixed one and recompiled all

- replaced exercide by exercise in ig_config.xml

- removed CIGIConnector from extern_plugin so only IG and DISConnector remains

Still no visible DIS entity and no callback called.

Is it possible to add a callback just for any PDU received (in case the pb is in some filtering of some sort)

To give some context, we use Cigi to control the environment, ownship, and a few other entities we can interact with.

We use MÄK VR-Forces and also a custom KDIS-based program to populate the flight zone with external entities we don't interact with (commercial aircrafts, simple boats or car for example). Our ownship simulators also broadcast their position through DIS so they appears on the VR-Force radar. A future question will probably be how to prevent it from spawning a DIS entity on top of the CIGI entity in Unigine (in our legacy systems, we use the natural filtering that the IG ignores all DIS entities with the same AppID as itself)

For info: I really liked the fact that en entity could be specified with both a Cigi ID and a DIS entity type. Hope this was not removed.

EDIT: maybe the problem lies in the communication port used? I send all PDU on port 3000 (the usual port for DIS), but couldn't find where to specify the receive port for the DISConnector in ig_config.xml

Edited by Amerio.Stephane
Link to comment
On 9/27/2019 at 8:10 PM, Amerio.Stephane said:

EDIT: maybe the problem lies in the communication port used? I send all PDU on port 3000 (the usual port for DIS), but couldn't find where to specify the receive port for the DISConnector in ig_config.xml

we use port 3000 too. 

-------------------

On 9/27/2019 at 8:10 PM, Amerio.Stephane said:

For info: I really liked the fact that en entity could be specified with both a Cigi ID and a DIS entity type. Hope this was not removed.

Usually cigi and dis require different settings for articulated parts/components. Now two types cannot be specified. You have to duplicate the settings in ig_config.xml
We are thinking about a hierarchy of inherited Entity types in ig_config.

----------------
What host are you using now? We did not test with VR-Forces. 

At DISConnector, we use the KDIS::Connection::GetNextPDU() method which uses the KDIS::UTILS::PDU_Factory class factory. It does not pass unknown packets.(KDIS_v2_9_0/KDIS/Extras/PDU_Factory.cpp:439). You can try add a subscriber, inherited from ConnectionSubscriber with overloaded ConnectionSubscriber::OnDataReceived() method, which allows reading raw data. (example KDIS_v2_9_0/Examples/PDU/PDU_Factory2/KDIS.cpp). 

Also, please send your full ig_config.xml - we will do some tests too.

Link to comment

Tested on another PC with no firewall: indeed now the callback is called (I see the trace in the console) so the app is receiving the PDU. But I still don't see the entity. I'm definitevely doing something wrong here but can't find what.

Do you have a working sample where the testKdis I sent shows an entity in the IG?

Is it possible to dump a list of nodes present in the scene, in case the entity is here but just out of screen?

Can it work alongside Cigi?

 

Link to comment

Hello,

These patched lib do the trick! Now I see my entity. Thanks!

Quick follow up question: is there a list of supported PDU? I tried to remove the entity with Remove_Entity_PDU but it wasn't removed.

Link to comment
×
×
  • Create New...