WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #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
  #2  
Old 01-14-2014, 04:18 AM
zorgblaubaer zorgblaubaer is offline
Member
 
Join Date: Oct 2013
Posts: 3
I managed to solve both problems.

I got rid of the bouncyness by reseting the objects when the grab is removed:

Code:
else:
    if grab != False:
	grab.getDst().reset()
	grab.remove()
	grab = False
I got the objects being recognized by not removing the DropBin bounding boxes but rather make them invisible (and I also remove the objects from the scene as soon as they are inside of a bin)
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Apartment demo/texture demo pwsnow Vizard 10 10-05-2012 10:10 AM
PPT Demo mikestatic Precision Position Tracker (PPT) 1 09-23-2007 10:31 AM
demo of new hand.getFingerTip() halley Vizard 9 12-14-2006 12:40 AM
Glenn Kawesch, looking for demo GlennKawesch Vizard 2 10-19-2006 09:17 AM
using demo with intersense G-Chan Vizard 1 02-06-2006 02:05 PM


All times are GMT -7. The time now is 12:57 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC