PDA

View Full Version : Link PhaseSpace and InertialLabs


teklab
05-17-2013, 07:38 AM
Hello all,

I am running Vizard with a Sony HMZ-T1 with an attached Inertial Labs OS3D sensor and a Phase Space motion capture setup. I have the MainView orientation linked to the Inertial Labs sensor with the following method:

#InertialLabs Sensor Setup
InertialLabs = viz.add('InertialLabs.dle')
sensors =InertialLabs.addSensorBus(workset=0,port=6)

# Get handle to first sensor
sensor1 = sensors[0]

def updateView():
euler = sensor1.getEuler()


viz.MainView.setEuler(euler[0], euler[2], euler[1]*(-1))

vizact.ontimer(0,updateView)


I have PhaseSpace functioning as well.

I would like to link the MainView position to a Phase Space marker, and have seen forum references to both <viz>.preMultLinkable and <viz>.mergeLinkable as possible routes. Unfortunately, I'm having a bit of a hard time understanding exactly how to implement the commands.



Any help or advice would be much appreciated.

Jeff
05-17-2013, 03:15 PM
You can use the viz.mergeLinkable command for this:
#InertialLabs Sensor Setup
InertialLabs = viz.add('InertialLabs.dle')
sensors =InertialLabs.addSensorBus(workset=0,port=6)
# Get handle to first sensor
oriTracker = sensors[0]

#Connect to phasespace server at specified IP address
phasespace = viz.add('phasespace.dle',0,'192.168.0.114')
#Add first marker
posTracker = phasespace.addMarker()

#create 6DOF tracker from two trackers
headTracker = viz.mergeLinkable(posTracker,oriTracker)
#link the viewpoint to the headtracker
viz.link(headTracker,viz.MainView)

teklab
05-20-2013, 11:12 AM
Jeff, you rock. Thanks.