[IGSTK-Users] OpenIGTLinkTrackerBroadcastingUI StopTrackingDataMessage

j.nijkamp at nki.nl j.nijkamp at nki.nl
Wed Sep 5 04:05:50 EDT 2012


Dear all,

I am using the OpenIGTLinkTrackerBroadcastingUI.exe example program to connect my Aurora tracking system to in-house developed tracking software which uses the OpenIGTLink.dll.
In order to improve the communication between the programs I added a ToolTrackingStoppedEvent to the updateObserver.
When I hit the StopTracking button the updateObserver ToolTrackingStoppedEvent is nicely called.
When I call StopTrackingMsg = igtl::StopTrackingDataMessage::New(); I get an access violation because the m_DefaultBodyType of the StopTrackingDataMessage can not be set.

Within OpenIGTLinkTrackingBroadcaster.h:
if( m_Sockets.empty() )
{ return;
}
//do something only for the correct tool
if( this->m_Tool.GetPointer() == caller )
{               //the tool transform has been updated, get it
  if( dynamic_cast<const igstk::TrackerToolTransformUpdateEvent  *>( &event) )
  { //send the transform
  }
  else if( dynamic_cast<const igstk::ToolTrackingStoppedEvent  *>( &event) )
  { igtl::StopTrackingDataMessage::Pointer StopTrackingMsg;
    StopTrackingMsg = igtl::StopTrackingDataMessage::New();
    std::vector< igtl::ClientSocket::Pointer >::iterator it;
    for (it = this->m_Sockets.begin(); it != this->m_Sockets.end(); ++it)
    { StopTrackingMsg->Pack();
      (*it)->Send(StopTrackingMsg->GetPackPointer(), StopTrackingMsg->GetPackSize());
    }
  }
}

Any help to fix this problem is greatly appreciated.

Jasper

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/igstk-users/attachments/20120905/3c193078/attachment.html>


More information about the IGSTK-Users mailing list