PDA

View Full Version : marker id plug-in


Vkathrynr
09-24-2009, 05:01 PM
We are trying to track 2 lights, one on the head and one on the hand. The head light should move the view. And the hand light should not be linked to anything, we just get data from it. We have code working without the markerID plug-in, where we just use one light on the head (and when we add it we don't specify ID).

For example:

headMarker = vrpn.addTracker('PPT0@' + PPT_HOSTNAME)

Then we tried specifying an id for the head marker. We used light 6. So we changed our code to:

headMarker = vrpn.addTracker('PPT0@' + PPT_HOSTNAME, 5)

We loaded the marker ID plug-in and set marker 6 as active (mapped to virtual ID 6), and the world did not track. We then tried specifying the idea as 6 in our code, just in case. But it still did not track. Data was being printed out on the console though.

How can we get the tracker to update the view when specifying an marker ID?

Working code:

PPT_HOSTNAME = '171.64.32.54'
#
# # Add the VRPN7 module to Vizard
vrpn = viz.add('vrpn7.dle')


# We need to create a VRPN connection for each marker in PPT
trackers = []

# Make the request for the particular id via VRPN from the hostname
headMarker = vrpn.addTracker('PPT0@' + PPT_HOSTNAME)

filter = viz.add("filter.dle")
headMarker = filter.average(headMarker, samples = 5)
trackers.append (headMarker)

view = viz.MainView
link = viz.link(headMarker, view)
link.reset(viz.RESET_X|viz.RESET_Y|viz.RESET_Z)

Broken code:


PPT_HOSTNAME = '171.64.32.54'
#
# # Add the VRPN7 module to Vizard
vrpn = viz.add('vrpn7.dle')


# We need to create a VRPN connection for each marker in PPT
trackers = []

# Make the request for the particular id via VRPN from the hostname
headMarker = vrpn.addTracker('PPT0@' + PPT_HOSTNAME, 5)

filter = viz.add("filter.dle")
headMarker = filter.average(headMarker, samples = 5)
trackers.append (headMarker)

view = viz.MainView
link = viz.link(headMarker, view)
link.reset(viz.RESET_X|viz.RESET_Y|viz.RESET_Z)

Vkathrynr
09-25-2009, 04:31 PM
The previous inquiry has been solved.