WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rating: Thread Rating: 14 votes, 5.00 average. Display Modes
  #1  
Old 10-04-2011, 02:12 PM
Darkmax Darkmax is offline
Member
 
Join Date: Feb 2010
Posts: 108
Question kinect + avatars

How can i link my kinect skeleton with an avatar, i tried with animating the bones tutorial, but the problem is that i have more bones than sensors values from the kinect skeleton so when i link the values of the kinect skeleton the other parts that i didn't link will remain static, so how can i resolve this?

Last edited by Darkmax; 10-04-2011 at 02:21 PM.
Reply With Quote
  #2  
Old 10-04-2011, 03:26 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,446
Our supported workflow for animating a character with tracking data is through Motionbuilder and Live Characters. Motionbuilder does all the calculations and determines where the bones should be using inverse kinematics.
Reply With Quote
  #3  
Old 10-12-2011, 12:17 PM
jkelly jkelly is offline
Member
 
Join Date: Jun 2003
Posts: 7
I, too, was hoping to use the Kinect to animate an avatar, but am dealing with the same problem of having more bones than sensors. I am using FAAST to acquire the sensor data, as described here: http://kb.worldviz.com/articles/1584.

The Kinect presents a potentially low cost option for motion tracking, and using Motionbuilder and Live Characters greatly increases the cost. Is there were a low cost way to animate an avatar using the Kinect? Thanks.
Reply With Quote
  #4  
Old 10-26-2011, 03:04 PM
Deltcho Deltcho is offline
Member
 
Join Date: Sep 2007
Posts: 18
I recommend using the official microsoft SDK for the Kinect (it's free). The Kinect tracks very specific points on the body and you need to interpolate the position of the body from those points. The "Skeletal Tracker" demo that comes with the SDK should be all you need to get going. Just integrate a vrpn server into the code (and remove the visualization stuff to improve performance) and you're ready to go.

Or, you can calculate the position of each limb in euler coordinates within vizard using FAAST, but python is significantly slower than c#/c++ so I'd recommend doing it within the SDK framework and just sending the limb position over VRPN to Vizard.

When you've got the coordinates for the appropriate avatar limbs, you just link them within Vizard. It's a shame that Vizard can't work with the Kinect out of the box using official drivers.
Reply With Quote
  #5  
Old 11-01-2011, 11:59 AM
tobin tobin is offline
WorldViz Team Member
 
Join Date: Feb 2003
Posts: 251
Thanks for the comments about the MS Research SDK. The lead developer of the FAAST project, Evan Suma, offers the summary below of the pros and cons of the MS Research SDK and the OpenNI SDK (note that FAAST currently uses OpenNI but will soon add support for MS Research SDK thus giving users the ability to choose):
"OpenNI advantages:
- More accurate and robust for arm/leg pose.
- Better depth map resolution (always 640x480). When the skeleton tracker is activated with Microsoft, the depth map drops to 320x240.
- More permissive license that allows corporate use. The Microsoft SDK can only be used for research and noncommercial purposes.
- More stable. The Microsoft SDK is a little more buggy and unstable, and crashes for me every now and then.

Microsoft advantages:
- No calibration required. However, the word from PrimeSense is that they are very close to solving the calibration issue, and hopefully soon OpenNI will no longer require the calibration pose at all.
- More skeleton joints. With Microsoft you get an articulated neck joint, which is rigid with OpenNI. You also get the wrist and ankle joints, but in my experience these don't work very well.
- More sophisticated built-in filtering (to reduce noise and jitter).
"
Reply With Quote
  #6  
Old 04-03-2012, 06:22 AM
rlh001 rlh001 is offline
Member
 
Join Date: Mar 2011
Posts: 18
I tried this web page http://kb.worldviz.com/articles/1584 but it says The page you are looking for no longer exists. Where can i look now? Thanks
Reply With Quote
  #7  
Old 04-03-2012, 12:06 PM
tobin tobin is offline
WorldViz Team Member
 
Join Date: Feb 2003
Posts: 251
We are sorry about the inconvenience--we are in the process of streamlining the installation process and installation package. The link is alive again but we encourage you to wait until April 5 and take advantage of our update that will be posted then.
Reply With Quote
  #8  
Old 04-19-2013, 05:08 PM
Gladsomebeast Gladsomebeast is offline
Member
 
Join Date: Mar 2005
Location: Isla Vizta, CA
Posts: 397
Have some rough code here that moves the limbs and root/pelvis of the original Complete Character samples in Vizard with the kinect.


Code:
import viz
import vizact
import vizshape
import math

viz.go(viz.FULLSCREEN)

#viz.clearcolor(viz.SKYBLUE)
ground = viz.add('gallery.osgb')

#Kinect Tracker object ID's
#myHead = vrpn.addTracker( 'Tracker0@localhost', HEAD).
HEAD = 0
NECK = 1
TORSO = 2
WAIST = 3
LEFTCOLLAR = 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
LEFTANKLE = 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')

#set the camera facing the avatar
viz.MainView.setPosition(0,0,0)

rootRaw = viz.addGroup(euler=[0, 0, 0])
lastX = 0
lastZ = 3
#now add all trackers and link a shape to it
for i in range(0,24):
	t = vrpn.addTracker( 'Tracker0@localhost',i )
	
	s = viz.add('wheelbarrow.ive', scale=[.3]*3, parent=rootRaw)
	if i == TORSO:
		s.color(viz.RED)
		#display an arrow pointing away from the avatar		
	elif i in [LEFTSHOULDER,RIGHTSHOULDER,LEFTHIP,RIGHTHIP]:
		s.color(viz.BLUE)

	l = viz.link(t,s)
	trackers.append(t)
	links.append(l)
	shapes.append(s)

#Debug 3d models with orientaton affordances
rootWheelbarrow = viz.add('wheelbarrow.ive', scale=[.3]*3)
rootWheelbarrow.color(viz.YELLOW)
target = viz.add('wheelbarrow.ive', scale=[.3]*3, pos=[.5, 0, 0])
target.color(viz.GREEN)

#girl = viz.add('vcc_female.cfg', pos=[0, -1, 0], euler=[180, 0, 0])
girl = viz.add('vcc_male.cfg', pos=[0, 0, 0], euler=[0, 0, 0])

RF = vrpn.addTracker('Tracker0@localhost', RIGHTFOOT)
LF = vrpn.addTracker('Tracker0@localhost', LEFTFOOT)
RK = vrpn.addTracker('Tracker0@localhost', RIGHTKNEE)
LK = vrpn.addTracker('Tracker0@localhost', LEFTKNEE)
Torso = vrpn.addTracker('Tracker0@localhost', TORSO)
head = vrpn.addTracker('Tracker0@localhost', HEAD)
neck = vrpn.addTracker('Tracker0@localhost', NECK)
rightShoulder = vrpn.addTracker('Tracker0@localhost', RIGHTSHOULDER)
rightElbow = vrpn.addTracker('Tracker0@localhost', RIGHTELBOW)
leftShoulder = vrpn.addTracker('Tracker0@localhost', LEFTSHOULDER)
leftElbow = vrpn.addTracker('Tracker0@localhost',LEFTELBOW)
rightHip = vrpn.addTracker('Tracker0@localhost',RIGHTHIP)
rightKnee = vrpn.addTracker('Tracker0@localhost',RIGHTKNEE)
leftHip = vrpn.addTracker('Tracker0@localhost',LEFTHIP)
leftKnee = vrpn.addTracker('Tracker0@localhost',LEFTKNEE)

waist = vrpn.addTracker('Tracker0@localhost', WAIST)
rootWaist = girl.getBone('Bip01')
rootWaist.lock()

headBone = girl.getBone('Bip01 Head')
headBone.lock()

kinectToCharacter = {	'Bip01 L UpperArm':(rightShoulder, [0, 90, 0]), \
						'Bip01 L Forearm':(rightElbow, [0, 90, 0]), \
						'Bip01 R UpperArm':(leftShoulder, [0, -90, 180]), \
						'Bip01 R Forearm':(leftElbow, [0, -90, 180]), \
						'Bip01 L Thigh':(rightHip, [90, 0, -90]), \
						'Bip01 L Calf':(rightKnee, [90, 0, -90]), \
						'Bip01 R Thigh':(leftHip, [90, 0, -90]), \
						'Bip01 R Calf':(leftKnee, [90, 0, -90]), \
						'Bip01':(waist, [0, 90, -90]) \
					}
bones = {}
for boneName in kinectToCharacter:
	b = girl.getBone(boneName)
	b.lock()
	bones[b] = kinectToCharacter[boneName]

boneToTest = girl.getBone('Bip01 L Thigh')
boneToTest.lock()
boneToTest.setEuler([180, 0, 0])
import vizmat
def animate():
	#debug code
	m = vizmat.Transform()
	euler = rightHip.getEuler()
	m.setEuler(euler)
	m.preEuler([90, 0, -90])
	
	target.setEuler(m.getEuler())
	rootWheelbarrow.setEuler( boneToTest.getEuler(viz.ABS_GLOBAL) )
#	rootWaist.setEuler(m.getEuler(), viz.ABS_GLOBAL)
	
	#position of root
	pos = waist.getPosition()
	rootWaist.setPosition(pos, viz.ABS_GLOBAL)
#	rootWaist.setPosition([2.64658, 0.53107, 3.37627], viz.ABS_GLOBAL) #if you want to fix the avatar to point in room.
	
	for bone in bones:
		kinectTracker = bones[bone][0]
		euler = kinectTracker.getEuler()
		m = vizmat.Transform()
		m.setEuler(euler)
		m.preEuler(bones[bone][1])
		bone.setEuler(m.getEuler(), viz.ABS_GLOBAL)
	
vizact.ontimer(0, animate)

viz.MainView.setPosition([0, 0, 5])
viz.MainView.setEuler([180, 0, 0])

import vizcam
viz.cam.setHandler(vizcam.PivotNavigate(distance=5))

def viewInHead():
	m = vizmat.Transform()
	m.setEuler(headBone.getEuler(viz.ABS_GLOBAL))
	m.preEuler([-90, -90, 0])
	viz.MainView.setEuler( m.getEuler() )
	viz.MainView.setPosition( headBone.getPosition(viz.ABS_GLOBAL) )

#vizact.ontimer(0, viewInHead)
__________________
Paul Elliott
WorldViz LLC
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
Randomly and Continuously Change Avatar's Face Texture Karla Vizard 4 08-22-2008 01:14 PM
avatars dig Vizard 4 09-20-2007 04:29 PM
Collision with avatars and scene not working JvdBosch Vizard 12 09-14-2006 07:01 PM
Avatars in an array and link/unlink betancourtb82 Vizard 7 09-05-2006 05:06 PM
Weird lagging/choppiness when avatars perform actions vjonshih Vizard 8 11-30-2004 05:08 PM


All times are GMT -7. The time now is 04:53 AM.


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