Reactivision crashing problem.. 
Posted: 10 February 2010 02:44 AM   [ Ignore ]
Rank
Joined  2010-02-09
Total Posts:  4
New Member

Hi. 

We are developing a Reactivision based game using the fiducials using C# Visual Studio 2008 Professional.
When we move a fiducial around quickly on the glass top, the program crashes/stops responding.
When we have a look at the debug screen area, there are 2 messages that keep getting repeated. The first message comes up any thing from 3 to 8 times then the second message a few times. This repeats itself till it stops working.

“A first chance exception of type ‘System.ArgumentException’ occurred in mscorlib.dll”

“An item of the same key has already been added”

Sample of the code used below.

public void addTuioObject(TuioObject o)
{
    lock 
(oSync)
        
{
            objectList
.Add(o.getSessionID(), new reactible(o));
        

}

public void updateTuioObject(TuioObject o)
{
    lock 
(oSync)
    
{
        objectList[o
.getSessionID()].update(o);
        foreach (
reactible r in objectList.Values)
        
{
            r
.updateRoLocation();
        
}
    }            
}

public void removeTuioObject(TuioObject o)
{
    lock 
(oSync)
    
{
        objectList
.Remove(o.getSessionID());
    
}           
}

Any ideas?

Thanks
Trev.

Profile
 
 
Posted: 10 February 2010 03:42 AM   [ Ignore ]   [ # 1 ]
Rank
Joined  2009-06-24
Total Posts:  15
New Member

I had a system crash problem when I used the add, update, and remove TUIO event functions.

Now I access to the cursor and fiducials list to know what objects are in the table, and the problem disapears (sorry, it C++, but I thinh you can translate). This is the way I use Reactivision:

//****************** INIT TUIO CLIENTE

TuioDump dump;
TuioClient client(port);
client.addTuioListener(&dump);
client.connect();

//********* MAIN LOOP
while( !(mesa->fin) )
{


// draw the cursors

std::list cursorList = client.getTuioCursors();
client.lockCursorList();
for (std::list::iterator iter = cursorList.begin(); iter!=cursorList.end(); iter++) {
TuioCursor *tuioCursor = (*iter);
mesa->mover_roncho(tuioCursor->getX(), tuioCursor->getY(),tuioCursor->getCursorID()); // DO SOMETHING WITH THIS TOKEN
}

client.unlockCursorList();

// draw the fiducials
// draw the objects
std::list objectList = client.getTuioObjects();
client.lockObjectList();
for (std::list::iterator iter = objectList.begin(); iter!=objectList.end(); iter++) {
TuioObject* tuioObject = (*iter);
mesa->mover_fiducial(tuioObject->getX(), tuioObject->getY(), tuioObject->getAngle(), tuioObject->getSymbolID()); //DO SOMETHING WITH THIS FIDUCIAL
}

client.unlockObjectList();



// GRAPHIC STUFF

} //*********************

hope this will help

Profile
 
 
Posted: 10 February 2010 03:55 AM   [ Ignore ]   [ # 2 ]
Rank
Joined  2010-02-09
Total Posts:  4
New Member

Hi, thank you for the reply and information. When I get back to work tomorrow, we will try your way. Will keep you posted on the outcome.

Trev.

Profile
 
 
Posted: 16 February 2010 03:13 AM   [ Ignore ]   [ # 3 ]
Rank
Joined  2010-02-09
Total Posts:  4
New Member

Hi, we tried the way shown above and still the same problem. We have surrounded the add, remove and update methods with try catch statements and that seems to have helped alot. Not the best solution but it will do for the time being.

Any othersuggestions welcome.

Thanks
Trev.

Profile