[vtkusers] SynchroGrab4D, vtk Polaris tracking

luta sharmaatul11 at gmail.com
Thu Jul 16 02:58:00 EDT 2015


Hi David,
Hope you must be doing great. 
I am working on an augmented reality project for medical application which
involves surgical instruments tracking in 3D.
For that we recently bought NDI polaris spectra and trying to use this with
VTK.
I downloaded your code for using NDI polaris from
https://github.com/dgobbi/AIGS.
I compiled it in visual studio 2010.
Then I made a simple VTK project with CMake and included the headers and
libraries from the compiled AIGS to the VTK project. The program is able to
show me the version of NDI, however, I am not able to initialize and start
tracking. I am sending you the code and the error what I get. Your help will
be highly appreciated.

#include <vtkConeSource.h>
#include <vtkPolyData.h>
#include <vtkSmartPointer.h>
#include <vtkPolyDataMapper.h>
#include <vtkActor.h>
#include <vtkRenderWindow.h>
#include <vtkRenderer.h>
#include <vtkRenderWindowInteractor.h>
#include "vtkNDITracker.h"
#include <string>
#include "ndicapi.h"
using namespace std;


class Starttracker_aks:public  vtkNDITracker {

vtkNDITracker* newtracker;
int x;
int tool;
const char *filename;

int tool1;
const char *filename1;

int tool2;
const char *filename2;

int beepn;

public:
	void asignvalues(){
	newtracker
=  vtkNDITracker::New();
tool=1;tool1=2;tool2=3;
filename=
"C:\\ATUL_WORKS\\SOFTWARES\\vtkptog\\Cone\\Cone_Aks\\ToolKit\\8700338.rom";
filename1=
"C:\\ATUL_WORKS\\SOFTWARES\\vtkptog\\Cone\\Cone_Aks\\ToolKit\\8700339.rom";
filename2=
"C:\\ATUL_WORKS\\SOFTWARES\\vtkptog\\Cone\\Cone_Aks\\ToolKit\\8700449.rom";
string versionname;
int serialname;
newtracker->SetSerialDevice("COM5:");
newtracker->LoadVirtualSROM(tool,filename);
newtracker->LoadVirtualSROM(tool1,filename1);
newtracker->LoadVirtualSROM(tool2,filename2);
newtracker->Probe(); 
Command("INIT:");
versionname=newtracker->GetVersion();

cout << newtracker->GetVersion();

 int t1= GetToolFromHandle(tool);
 int t2= GetToolFromHandle(tool1);
 int t3= GetToolFromHandle(tool2);
 cout << "\n Tools active:\t" << t1 << "\t" << t2 << "\t" << t3 <<"\n"; 

}
};
int main(int, char *[])
{ 
	Starttracker_aks statr;
	statr.asignvalues();
	return EXIT_SUCCESS; 
}

<http://vtk.1045678.n5.nabble.com/file/n5732927/Console.jpg> 
<http://vtk.1045678.n5.nabble.com/file/n5732927/Error.jpg> 



--
View this message in context: http://vtk.1045678.n5.nabble.com/SynchroGrab4D-vtk-Polaris-tracking-tp4600704p5732927.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list