WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Need help with bone mapping (https://forum.worldviz.com/showthread.php?t=4938)

Reatus 02-03-2014 02:44 AM

Need help with bone mapping
 
Hi Vizard community,

I am new to python and especially Vizard and created a bone mapping script for research in a student project at university.
However I have a problem:
My arms move up, when I move them down and vice versa.

The following snippet is what I think causes the problem, but I cannot figure out the correct Eulers:

Code:

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


def animate():       
        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_PARENT)

Oh and I am using FAAST and thus VRPN to get data from a Microsoft Kinect for Windows.

Interesting fact that might help solving my problem:
If I exchange the arms they move correctly up and down, but are obviously on the wrong side of the avatar.

To any mods/admins:
I did not know where to put this, so if this thread is in the wrong place please contact me to clarify any issues.

Jeff 02-03-2014 09:03 AM

Moving an avatar with tracking data is usually done with inverse kinematics. The next version of the Vizard 5 Beta will include a basic avatar IK library. Vizconnect, also included in the next Beta, will have a visual interface for using this IK and mapping trackers to avatar points. Currently the library works with up to 6 points; head, waist, hands, and feet. The result will be sufficient for many users needs.

Reatus 02-04-2014 08:04 AM

Hi Jeff,

Thanks for the fast reply! Can you tell me when the next Beta will be made available or point me to the information? I am really keen on getting more information about the IK library!

Please tell your team that you are doing an amazing job :)

Best regards


All times are GMT -7. The time now is 07:34 AM.

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