View Single Post
  #1  
Old 09-24-2009, 04:01 PM
Vkathrynr Vkathrynr is offline
Member
 
Join Date: Sep 2005
Posts: 12
marker id plug-in

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:

Code:
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:

Code:
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:
Code:
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:

Code:
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)
Reply With Quote