View Single Post
  #1  
Old 01-09-2014, 06:47 AM
zorgblaubaer zorgblaubaer is offline
Member
 
Join Date: Oct 2013
Posts: 3
Conveyor Belt demo

Hey everyone,

I am trying to get the Conveyor Belt demo to work with our system. I can grab the objects from the belt and let go of them again. But I can't seem to figure out how to get them counted towards the score. They are not getting recognized in the DropBin.update method.
Also, they are falling with a very high velocity and bounce of the ground or whatever they hit like a bouncy ball.
What am I doing wrong?

The only part of my code where I am interacting with the objects is this:

Code:
def updateGrabs():
	global grab
	if gripTracker.getButtonState() >= 2:
		if grab == False:
			# check to see if the hand/thermometer intersects with an object in the scene
			handPos = rightHandTracker.getPosition(viz.ABS_GLOBAL)
			# go through each item the list and find out if any are in range
			selectedItem = None
			selectedItemDistance = 0.2# set min distance 
			for item in GrabObjects.grabObjects:
				# find the closest inside of that distance
				d = vizmat.Distance(handPos, item.getPosition(viz.ABS_GLOBAL))
				if selectedItemDistance > d:
					selectedItem = item
					selectedItemDistance = d
			if selectedItem:
				grab = viz.grab(rightHandTracker,selectedItem)
	else:
		if grab != False:
			grab.remove()
			grab = False
	
vizact.onupdate(0,updateGrabs)
Reply With Quote