PDA

View Full Version : Problem of hand model(using sensors).


atamasan
08-18-2009, 10:33 PM
Hello.
I'm trying to move hand model using 16 patriots(for my right hand).
So I made codes and run the codes. But the result was not good.

Fingers bends to the strange direction.
I tried to solve the problems, and I think there are problems in my initialization part. But I couldn't find them.

Could you please tell me hint?
This is the flow of my codes.

import viz
import math
viz.go()
right_h=viz.add('hand.cfg')

#get 16 sensors
pat01=viz.addSensor('patriot')
.
.
pat16=viz.addSensor('patriot')

#get hand bones
rbt_00=right_h.getBone('bone thumb 0-0')
.
.
rb=right_h.getBone('bone ~ROOT')

#calculate inverse matrix from sensors's data, manually(if framenumber=1)
inv01~inv16

#make rotation matrix from each sensor's data
Rrot01~Rrot16

#Multiplication
R_01=inv01*Rrot01
.
.
R=16=inv16*Rrot16

#get Euler angles for each sensor from the Matrix(R_01~R_16)
#and link Euler angles to each sensor
l_r_01=viz.link(pat01,rbt_01)
.
.
l_r=viz.link(pat16,rb)

#finally, use the MASK command(Because I need only ORIENTATION DATA)
l_r_01.setMask(viz.LINK_ORI)
.
.
l_r.setMask(viz.LINK_ORI)
[FIN]

I think I should do that more easily, but I'm confused now...

Thank you for reading my message.