WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-31-2015, 10:54 AM
JamesCakes JamesCakes is offline
Member
 
Join Date: Mar 2015
Posts: 2
Proximity Sensing Using Kinect

Hello,

I am using a Kinect with the FAAST program in order to create a 3d spherical representation of a person. My goal is to create a way for that person's hand to interact with an object that has been created. I want to be able to move that object from point A to point B. Below is the code that I have written so far. I am having trouble getting the sensors to connect with the hand spheres, and I also don't know how to create a movable object in Vizard. I am new to this and am using this as part of an experiment:

import viz
import vizshape
import math
import random
import time
import vizact
import vizproximity

viz.go()
grid = vizshape.addGrid()

"""
Kinect Tracker object ID's
These are not actually being used in the script but are to
help anyone who wants to get access to a specific bodypart.
For example to just get a handle to tracking data for the head use:
myHead = vrpn.addTracker( 'Tracker0@localhost', HEAD).
"""
HEAD = 0
NECK = 1
TORSO = 2
WAIST = 3
LEFTCOLLOR = 4
LEFTSHOULDER = 5
LEFTELBOW = 6
LEFTWRIST = 7
LEFTHAND = 8
LEFTFINGERTIP = 9
RIGHTCOLLAR = 10
RIGHTSHOULDER = 11
RIGHTELBOW = 12
RIGHTWRIST = 13
RIGHTHAND = 14
RIGHTFINGERTIP = 15
LEFTHIP = 16
LEFTKNEE = 17
LEFTANGLE = 18
LEFTFOOT = 19
RIGHTHIP = 20
RIGHTKNEE = 21
RIGHTANKLE = 22
RIGHTFOOT = 23

#store trackers, links, and vizshape objects
trackers = []
links = []
shapes = []

#start vrpn
vrpn = viz.addExtension('vrpn7.dle')

#now add all trackers and link a shape to it
for i in range(0, 24):
t = vrpn.addTracker( 'Tracker0@localhost',i )
s = vizshape.addSphere(radius=.1)
l = viz.link(t,s)
trackers.append(t)
links.append(l)
shapes.append(s)

################################################## ################################################## ##########################
### Proximity Section ###

viz.phys.enable()

manager = vizproximity.Manager()
manager.setDebug(viz.ON)

#Add main viewpoint as proximity target
target = vizproximity.Target(viz.MainView)
manager.addTarget(target)

#Creating Right Hand Sensor
rightHandSphere = vizshape.addSphere(radius = 0.08)
rightHandSphere.color( viz.BLUE )
rightHandLink = viz.link( shapes[14] , rightHandSphere ) #links the proximity with the sphere

#Creating Left Hand Sensor
leftHandSphere = vizshape.addSphere(radius = 0.08)
leftHandSphere.color( viz.BLUE )
rightHandLink = viz.link( shapes[14] , rightHandSphere ) #links the proximity with the sphere
Reply With Quote
 

Tags
kinect, proximity sensor

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
Orientation selective (Viewing Vector) Proximity Sensor lmGehrke Vizard 2 03-17-2015 12:31 PM
Problems with using WIRKS without the Kinect in a mirror setting Jennifer Vizard 0 06-03-2013 03:17 PM
kinect + avatars Darkmax Vizard 7 04-19-2013 04:08 PM
Phase Space and Proximity Sensors snovob93 Vizard 3 06-13-2012 12:32 PM
Kinect auto selection of skeleton victorqx Vizard 0 05-29-2012 08:30 AM


All times are GMT -7. The time now is 09:31 PM.


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