コード例 #1
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
コード例 #2
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
コード例 #3
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)
コード例 #4
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)