certi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [certi-dev] RTI Internal error


From: Reema Choudhary
Subject: Re: [certi-dev] RTI Internal error
Date: Thu, 31 Jan 2013 15:29:18 +0500

I am using CERTI3.4.0 on windows... Following is the fedmanager code

// Sync1.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"


int main(int argc, char *argv[])
{
char *federateName="Sync1";
RTI::RTIambassador rtiamb;
Simul8ManagerFederateAmbassador fedamb;
fedamb.federateName =federateName;

rtiamb.createFederationExecution("WitnessRTI", "WitnessRTI.fed");
cout << "Simul8RTI." << federateName << ": federation created successfully" << endl;

rtiamb.joinFederationExecution(federateName, "WitnessRTI", &fedamb);
cout << "Simul8RTI." << federateName << ": federation joined successfully" << endl;

Simul8ManagerFederateAmbassador::hFederate = rtiamb.getObjectClassHandle("ObjectRoot.Manager.Federate");
Simul8ManagerFederateAmbassador::hFederateHandle = rtiamb.getAttributeHandle("FederateHandle", Simul8ManagerFederateAmbassador::hFederate);
// .. create an attribute-handle set
RTI::AttributeHandleSet *ahset = NULL;
ahset=RTI::AttributeHandleSetFactory::create(1);
// .. populate the set with the attributes we publish/subscribe
ahset->add(Simul8ManagerFederateAmbassador::hFederateHandle);
// .. perform the appropriate DM calls
rtiamb.subscribeObjectClassAttributes(Simul8ManagerFederateAmbassador::hFederate, *ahset);
cout << "Simul8RTI." << federateName << ": subscribed object class Federate" << endl;

// enable time constraint
rtiamb.enableTimeConstrained();
while (!fedamb.mConstraintEnabled) 
{
rtiamb.tick(0.01, 0.5);
}
cout << "Simul8RTI." << federateName << ": time constraint enabled @ " << fedamb.mCurrentTime << endl;

// enble time regulation at the current time and lookahead
RTIfedTime mTime;
rtiamb.queryLookahead(mTime);
rtiamb.enableTimeRegulation((RTIfedTime)fedamb.mCurrentTime, mTime);
while (!fedamb.mRegulationEnabled) 
{
rtiamb.tick(0.01, 0.5);
}
cout << "Simul8RTI." << federateName << ": time regulation enabled @ " << fedamb.mCurrentTime << endl;
// enable asynchronous delivery of receive-ordered events
rtiamb.enableAsynchronousDelivery();
cout << "Simul8RTI." << federateName << ": asynchronous delivery enabled" << endl;
rtiamb.registerFederationSynchronizationPoint("Ready", "");
while (!fedamb.isAnnounced) 
{
rtiamb.tick(0.01, 0.5);
}
fedamb.isAnnounced = false;
rtiamb.registerFederationSynchronizationPoint("End", "");
while (!fedamb.isAnnounced) 
{
rtiamb.tick(0.01, 0.5);
}

    // inform RTI that synchronization point has been achieved
    rtiamb.synchronizationPointAchieved("Ready");
fedamb.isAnnounced = false;
while (!fedamb.isAnnounced) 
{
rtiamb.tick(0.01, 0.5);
}

cout << "Joined Federates : " << fedamb.totalFederatesJoined << endl;
getch();
cout << "Joined Federates : " << fedamb.totalFederatesJoined << endl;
getch();




    rtiamb.resignFederationExecution(RTI::DELETE_OBJECTS_AND_RELEASE_ATTRIBUTES);
    cout << "Simul8RTI." << federateName << ": resigned from federation" << endl;

    rtiamb.destroyFederationExecution("WitnessRTI");
    cout << "Simul8RTI." << federateName << ": destroyed federation execution" << endl;

getch();
return 0;
}

and the federate code is below

// Sync2.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"


int main(int argc, char *argv[])
{
char *federateName="Sync2";
RTI::ObjectClassHandle hFederate;
RTI::AttributeHandle hFederateHandle;

RTI::RTIambassador rtiamb;
Simul8FederateAmbassador fedamb;

rtiamb.joinFederationExecution(federateName, "WitnessRTI", &fedamb);
cout << "Simul8RTI." << federateName << ": federation joined successfully" << endl;

// hFederate = rtiamb.getObjectClassHandle("ObjectRoot.Manager.Federate");
// hFederateHandle = rtiamb.getAttributeHandle("FederateHandle", hFederate);
// .. create an attribute-handle set
// RTI::AttributeHandleSet *ahset = NULL;
// ahset=RTI::AttributeHandleSetFactory::create(1);
// .. populate the set with the attributes we publish/subscribe
// ahset->add(hFederateHandle);
// .. perform the appropriate DM calls
// rtiamb.publishObjectClass(hFederate, *ahset);
// cout << "Simul8RTI." << federateName << ": published object class Federate" << endl;

    // enable time constraint
    rtiamb.enableTimeConstrained();
    while (!fedamb.mConstraintEnabled) 
{
        rtiamb.tick(0.01, 0.5);
    }
    cout << "Simul8RTI." << federateName << ": time constraint enabled @ " << fedamb.mCurrentTime << endl;

    // enble time regulation at the current time and lookahead
RTIfedTime mTime;
rtiamb.queryLookahead(mTime);
    rtiamb.enableTimeRegulation((RTIfedTime)fedamb.mCurrentTime, mTime);
    while (!fedamb.mRegulationEnabled) 
{
        rtiamb.tick(0.01, 0.5);
    }
    cout << "Simul8RTI." << federateName << ": time regulation enabled @ " << fedamb.mCurrentTime << endl;

// enable asynchronous delivery of receive-ordered events
    rtiamb.enableAsynchronousDelivery();
    cout << "Simul8RTI." << federateName << ": asynchronous delivery enabled" << endl;

    // inform RTI that synchronization point has been achieved HERE I GOT INTERNAL ERROR
    rtiamb.synchronizationPointAchieved("Ready"); 

    cout << "Simul8RTI." << federateName << ": waiting for FEDERATION SYNCHRONIZATION @  synchronizationPointLabel --> Ready" << endl;
    while (!fedamb.mFederationSynchronizationReadyAchieved) 
{
        rtiamb.tick(0.01, 0.5);
    }

getch();

    rtiamb.resignFederationExecution(RTI::DELETE_OBJECTS_AND_RELEASE_ATTRIBUTES);
    cout << "Simul8RTI." << federateName << ": resigned from federation" << endl;

    rtiamb.destroyFederationExecution("WitnessRTI");
    cout << "Simul8RTI." << federateName << ": destroyed federation execution" << endl;

getch();
return 0;
}


On Thu, Jan 31, 2013 at 1:35 PM, Eric Noulard <address@hidden> wrote:
2013/1/31 Reema Choudhary <address@hidden>:
> Respected CERTI team,
>
> I have created a manager federate and in this federate I have successfully
> registered the sync points... But when the first federates reach the
> syncpointachieved my federate crashes with exception RTI Internal Error at
> memory location 0x0...

Which version of CERTI?
On which platform (Windows, Linux, ...) are running each federate?
How many federate, does this occurs with 2 federates?

This would be difficult unless you show us some code.

May be you can compare your code with this one
http://cvs.savannah.gnu.org/viewvc/applications/HLA_TestsSuite/test_Sync.cc?root=certi&view=markup

from CERTI  HLA_TestsSuite which is know to work.



--
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org

--
CERTI-Devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/certi-devel


reply via email to

[Prev in Thread] Current Thread [Next in Thread]