PDA

View Full Version : Importing Vicon Tracker Data


ChrisMa
09-19-2013, 07:18 AM
Hello,

I found the same issue for Version 3.0. I'm using Vizard 4.0 in the 90days Trial Version.

I want to get the data of segments and markers tracked with Vicon Tracker 2.0 (32Bit). I had some warnings and errors. They were solved by opening the port 800 in the Windows Firewall at the Vizard PC.

If I run the following code, a new window opens, and Shows the World Viz logo on a black Background. The Interactive window stops at loading the Basketball.osgb.



import viz

viz.go()

# Add a world
scene = viz.addChild('dojo.osgb')
ball = viz.addChild('basketball.osgb')
ball.setPosition([1,1,1])

vicon = viz.add('vicon.dle',0,'192.168.10.1')
body = vicon.getBody(0)
marker = vicon.getMarker(0)

print body.getName()
print marker.getName()

************************************************** ****************************
** Loading Übung_Vizard_1.py
************************************************** ****************************
Loading File: dojo.osgb
Loading File: basketball.osgb

On the Nexus PC I allowed Tracker to send and recieve data through the Firewall. In an other post somebody said to allow "kinematic data" as an Output. I don't know where to find that.

Thank you for your help!

ChriMa

Jeff
09-19-2013, 09:49 AM
The vicon plug-in works with a protocol used by earlier versions of Tracker. You should be able to use vrpn to read body data from tracker in Vizard once you specify the correct VRPN source.

import viz
import vizact
import vizshape

viz.go()

VRPN_SOURCE = 'Tracker0@localhost'

viz.move([0,-1,-5])

axes = vizshape.addAxes(length=0.5)

vrpn = viz.add('vrpn7.dle')
headtracker = vrpn.addTracker(VRPN_SOURCE)
headtracker.swapPos([-1,3,-2])

viz.link(headtracker,axes)

def showData():
print headtracker.getPosition()
print headtracker.getEuler()

vizact.ontimer(1,showData)

ChrisMa
09-20-2013, 07:27 AM
Hello Jeff,

thank your for your reply. First I used your code with 'Tracker0@192.168.10.1'. I thought Tracer0 referes to Vicon Tracker. Finally I tried to Import one Object I'm tracking with Tracker called Flasche (=bottle) instead of Tracker0. Now it works well.

So I have to Import every object I want to use, separately?

Code:

import viz
import vizact
import vizshape

viz.go()


VRPN_SOURCE = 'Flasche@192.168.10.1'
scene = viz.addChild('dojo.osgb')
viz.move([0,-1,-5])

axes = vizshape.addAxes(length=0.5)

vrpn = viz.add('vrpn7.dle')
flasche = vrpn.addTracker(VRPN_SOURCE)
flasche.swapPos([-1,3,-2])

viz.link(flasche,axes)

def showData():
print flasche.getPosition()
print flasche.getEuler()

vizact.ontimer(1,showData)



Thank you very much!

ChrisMa

Jeff
09-23-2013, 10:46 AM
Yes, you must connect to each rigid body separately.