コード例 #1
0
ファイル: tracking.py プロジェクト: zdeschaux/boardLab
 def __init__(self, serialPort):
     self.fastrak = Fastrak(logFile='rawlog.raw',
                            serialPort=fastrakPort,
                            fixedPoints=[probeTipOffset],
                            sensor=fastrakSensor)
     self.fastrak.setup(reset=False)
     self.fastrak.setContinuous()
コード例 #2
0
ファイル: tracking.py プロジェクト: pragun/boardLab
class tracking(object):
    def __init__(self,serialPort):
        self.fastrak = Fastrak(logFile='rawlog.raw',serialPort=fastrakPort,fixedPoints=[probeTipOffset], sensor=fastrakSensor)
        self.fastrak.setup(reset=False)
        self.fastrak.setContinuous()

    def getFrame(self):
        a = self.fastrak.readData()
        return a
コード例 #3
0
ファイル: tracking.py プロジェクト: zdeschaux/boardLab
class tracking(object):
    def __init__(self, serialPort):
        self.fastrak = Fastrak(logFile='rawlog.raw',
                               serialPort=fastrakPort,
                               fixedPoints=[probeTipOffset],
                               sensor=fastrakSensor)
        self.fastrak.setup(reset=False)
        self.fastrak.setContinuous()

    def getFrame(self):
        a = self.fastrak.readData()
        return a
コード例 #4
0
class tracking(object):
    def __init__(self,serialPort):
        self.fastrak = Fastrak(logFile='rawlog.raw',serialPort=fastrakPort,fixedPoints=[printHeadOffsets,printHeadOffsets2],vectors=[])
        self.fastrak.setup(reset=True)
        self.fastrak.startContinuous()

    def getFrame(self):
        a = self.fastrak.readData()
        return a

    def getPosition(self):
        #This will just take the position x,y co-ordinates of the tracker, ignore the z and estimate the heading of the projection
        a = self.getFrame()
        if a is None:
            return None
        
        headPosition2 = a[3]
        headPosition = a[2]
        orientation = a[1]
        retVal = [(headPosition[1]*(-3)+xBias,headPosition[2]*3+yBias,),(headPosition2[1]*(-3)+xBias,headPosition2[2]*3+yBias,)]
        #print retVal
        return retVal
コード例 #5
0
ファイル: testQuaternion.py プロジェクト: pragun/boardLab
# This file will load hemishpere.raw and process it using the radius and output testQuat.raw, plot it in matlab to see if it makes sense.

from polhemus import Quaternion, Fastrak
import numpy as np

b = open('quatOut.raw','w')

tip = np.array(( (-45.5676,),(-0.15494,),(-13.736,), ))

#a = Fastrak(logFile='hemishpere.raw',serialPort=None,fixedPoints=[tip])
a = Fastrak(logFile='rawlog.raw',serialPort='/dev/ttyUSB0',fixedPoints=[tip])
a.setup(reset=False)
a.setContinuous()

while True:
    p = a.readData()
    # This guy prints the sensor xyz and quaternion
    #to = ' '.join(j.__str__() for j in p[0])+' '+' '.join(j.__str__() for j in p[1])+'\n'

    # This guy prints the quaterion calculated position of the tip
    to = ' '.join(j.__str__() for j in p[2])+'\n'

    print to
    #b.write(to)
コード例 #6
0
ファイル: tracking.py プロジェクト: pragun/boardLab
 def __init__(self,serialPort):
     self.fastrak = Fastrak(logFile='rawlog.raw',serialPort=fastrakPort,fixedPoints=[probeTipOffset], sensor=fastrakSensor)
     self.fastrak.setup(reset=False)
     self.fastrak.setContinuous()
コード例 #7
0
 def __init__(self,serialPort):
     self.fastrak = Fastrak(logFile='rawlog.raw',serialPort=fastrakPort,fixedPoints=[printHeadOffsets,printHeadOffsets2],vectors=[])
     self.fastrak.setup(reset=True)
     self.fastrak.startContinuous()
コード例 #8
0
ファイル: testQuaternion.py プロジェクト: zdeschaux/boardLab
# This file will load hemishpere.raw and process it using the radius and output testQuat.raw, plot it in matlab to see if it makes sense.

from polhemus import Quaternion, Fastrak
import numpy as np

b = open('quatOut.raw', 'w')

tip = np.array((
    (-45.5676, ),
    (-0.15494, ),
    (-13.736, ),
))

#a = Fastrak(logFile='hemishpere.raw',serialPort=None,fixedPoints=[tip])
a = Fastrak(logFile='rawlog.raw', serialPort='/dev/ttyUSB0', fixedPoints=[tip])
a.setup(reset=False)
a.setContinuous()

while True:
    p = a.readData()
    # This guy prints the sensor xyz and quaternion
    #to = ' '.join(j.__str__() for j in p[0])+' '+' '.join(j.__str__() for j in p[1])+'\n'

    # This guy prints the quaterion calculated position of the tip
    to = ' '.join(j.__str__() for j in p[2]) + '\n'

    print to
    #b.write(to)
コード例 #9
0
ファイル: testQuaternion.py プロジェクト: pragun/polhemus
# This file will load hemishpere.raw and process it using the radius and output testQuat.raw, plot it in matlab to see if it makes sense.

from polhemus import Quaternion, Fastrak
import numpy as np

b = open("testQuaternionOutput.raw", "w")

tip = np.array(((-1.7940,), (-0.0061,), (-0.5408,)))

# a = Fastrak(logFile='hemishpere.raw',serialPort=None,fixedPoints=[tip])
a = Fastrak(logFile="plane.raw", serialPort="/dev/ttyUSB0", fixedPoints=[tip])
a.setup(reset=True)
a.setContinuous()

while True:
    p = a.readData()
    to = " ".join(j.__str__() for j in p[2]) + "\n"
    # print to
    b.write(to)