Amerio.Stephane Posted September 26, 2019 Share Posted September 26, 2019 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
silent Posted September 27, 2019 Share Posted September 27, 2019 Hi Stephane, Could you please send us engine log file after launching the application (bin/log.html)? Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
silent Posted September 27, 2019 Share Posted September 27, 2019 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: Replace DISConnector_double_x64*.dll libraries in bin directory to the libraries from DIS_Connector_2.9.0.2_patched_windows_linux.zip 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: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Amerio.Stephane Posted September 27, 2019 Author Share Posted September 27, 2019 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
cash-metall Posted September 27, 2019 Share Posted September 27, 2019 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
silent Posted September 27, 2019 Share Posted September 27, 2019 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: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Amerio.Stephane Posted September 27, 2019 Author Share Posted September 27, 2019 (edited) 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 September 28, 2019 by Amerio.Stephane Link to comment
cash-metall Posted September 30, 2019 Share Posted September 30, 2019 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
Amerio.Stephane Posted September 30, 2019 Author Share Posted September 30, 2019 Here are attached the relevant files. For testing, I used a small cpp based on KDIS example (Entity state PDU emitter). I tested on another local network here. Thanks for your help. TestKdis.7z ig_config.xml log.html launch_release.bat Link to comment
silent Posted October 2, 2019 Share Posted October 2, 2019 Hi Stephane, Your latest test is working fine on our side. Also there is nothing special found in the log files that can give us a clue. Maybe your network configuration is blocking broadcast packets? How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Amerio.Stephane Posted October 3, 2019 Author Share Posted October 3, 2019 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
silent Posted October 4, 2019 Share Posted October 4, 2019 Hi Stephane, There is no errors in your logic. Please, try to use these patched IG libraries (from attachment). Copy and replace files in bin directory of your project. Thanks! IG_double_x64_windows_2.9.0.2.zip How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Amerio.Stephane Posted October 6, 2019 Author Share Posted October 6, 2019 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
morbid Posted October 7, 2019 Share Posted October 7, 2019 Hi Stephane, IG doesn't have delete entity command. You can set type=0 via Entity_State_PDU. This will make turn entity off. Thanks. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Recommended Posts