WorldViz User Forum

WorldViz User Forum (
-   Vizard (
-   -   Conveyor Belt demo (

zorgblaubaer 01-09-2014 06:47 AM

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:


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)
                if grab != False:
                        grab = False

zorgblaubaer 01-14-2014 04:18 AM

I managed to solve both problems.

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


    if grab != False:
        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)

All times are GMT -7. The time now is 07:19 PM.

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