In the newer versions of MITK (2013-06, 2013-09) and maybe earlier, the input/output mechanism of a mitk::TrackingDeviceSource changed to a cached primary output. Here 2 error occure in
mitk::TrackingDeviceSource->SetTrackingDevice() or mitk::TrackingDeviceSource->Connect() which both call mitk::TrackingDeviceSource::CreateOutputs().
mitkTrackingDeviceSource.cpp
- Line 114 "for (unsigned int numOP = this->GetNumberOfOutputs(); numOP>0; numOP--)" will try to fetch the non existing "last" output, because ->GetNumberOfOutputs() is always one larger than the actual amount of outputs, which starts from "0...i"
- Lines 123 and 124.
this->SetNumberOfIndexedOutputs(m_TrackingDevice->GetToolCount());
unsigned int numberOfOutputs = this->GetNumberOfIndexedOutputs();
Line 123 determines how many tools have to be additionally added to the primary output. In an example case with 1 tools, the SetNumberOfIndexedOutputs() will utilize the primary output, which still is NULL. Therefore we don't have an IndexedOutput. As a result, the next line 124 will return numberOfOutputs = 0, which leads to no connected outputs in the following lines 127-136. The data pipeline of NavigationDataSource will never hold any SensorData.