Motion Capture
Joints, Bowel
Kinematics motion of the body with respect to time
- Position
- velocity
- acceleration
skeleton=tree like data structures representing a hierarchy of joints
joint hierarchy
Joints: local rotating frame of reference
Fji=[Fji0dji1]
where
- i=joint index
- i=Parent of joint j
- dji=bone(link) between joint j and joint i
Each joint node contains data
- Angle/quaternions
- bone length
- Pointers(links) to parent joint
- Pointers(links) to child joints
- Local transform
- global transform
- other data
- moment of in
- Joint limits
- presents (bind pose)
Each joint a Frame of ref
Fji⇒ local frame of ref
j is the parent of joint j
Fj0⇒ global transform, now joint j is positioned and oriented w.s.t. world
To find the position and orientation of any joint in the skeleton wal the kinematic chain from woot to that joint
F30=F10F21F32F43
position of joint 4 w.r.t world
p0=F40p4, p4=[0,0,0,1]T
x is an (m x 1) vector of end joint positions
Θ is an (n x 1) body joint vector of the form,
Θ Combines positions and orientations of all the joints
θj=xyzθxθyθz
most general case for joint j
Θ=[θ1 θ2 ... θN]T
6 dofs
x1x2x3=a1+b1=a2+b2=a3+b3⎭⎬⎫⇒x=a+b
want to know position of joint 3 in the world
p30=F300001=HT(d10)HR(θ1)HT(d21)HR(θ2)HT(d21)HR(θ3)0001
F30=F10F21F32
p30=[l1cosθ+l2cos(θ1+θ2)l1sinθ+l2sin(θ1+θ2)]+p10
x=f(Θ)= position of joints
v=x˙= velocity
v=dtdx=x˙x=f(Θ)dtdx=dΘf
x˙=JΘ˙
J= jacobian matrix
Θ˙=J−1x˙
Leg example
quiz:给一个chain,让求一个p的坐标
下次课讲如何计算任意一个chain的J
v=w×r
Shape animation
x=f(Θ)
p40=F40p44
where Θ a set of homo trans
position: x=f(Θ)
velocity: v=x˙=dtdx=\partΘ\partfdtΘ=JΘ˙
Angular velocity: ω=a^ϕ˙
v=ω×r
where a^=axis, ϕ˙=spin rate
Euler Angle rate: θ˙=θ˙xθ˙yθ˙z
where θ
θ˙=ω
only if axis is one of the x-y-z axis, they are the same
Euler Angle rates to angular velocity conversion
ω=ϕ˙α^
ωj=Lj(θx,θy,θz)θ˙
R1=RzRyRx
R01=R1T=RxTRyTRzT
Lj(θx,θy,θz)=1000cosθx−sinθx−sinθysinθxcosθycosθxcosθy
Θ=f−1(x)
almost impossible to compute amony
Very difficult to compute, analytically
Ideally, Θ˙=J−1x˙
Integrate things
v=ω×r+r˙
if joint 2, 3 is fixed, joint 1 spin at ω10, then:
v14=ω10×r41
where r41=p40−p10
if joint 3 is fixed, joint 1 spin at ω10, then:
v4=ω10×r41
where r41=p40−p10
total:
v40=v140+v240+v340+v10
rewrite:
v140=ω10×r140=−r140×ω10=−r140×R10ω11=−r140×[a^xa^ya^z]ω11=B1ω11
where R10=[a^xa^ya^z]
v40=[B1B2…Bn]ω11ω22ω33=[B1L1B2L2…BnLn]Θ˙
Euler Angle rates to angular velocity conversion
N is the number of joint
J=[J1J2…JN]=[B1L1B2L2…BNLN]
where
Bi=
IK want to compute J−1, can only normally do this if J is square
given x, desired velocity of the end joint
2 types of "pseudo" inverse
left => more DOF in x
right => more DOF in y
让方阵是比较小的那个纬度
x=JΘ
dimx=m×1
dimΘ=n×1
dimJ=m×n
When: m>n
xd˙=JΘ˙
JTxd˙=JTJΘ˙
Θ˙=(JTJ)−1JTxd˙
J†=(JTJ)−1JT
most likely
When: m<n
xd˙=JΘ˙
choose Θ˙=JTa
xd˙=JJTa(JJT)−1xd˙=aΘ˙=JT(JJT)−1xd˙
JTxd˙=JTJΘ˙
Θ˙=JT(JJT)−1xd˙
choose b=xd˙=vd
x˙=JJT(JJT)−1b
J†=JT(JJT)−1
Discrete time, k = frame#
xd˙(tk)=Δtxd(tk)−x(tk−1)
Θ˙(tk)=ΔtΘ(tk)−Θ(tk−1)
Backward differences
ΔtΘ(tk)−Θ(tk−1)=J−1Δtxd(tk)−x(tk−1)Θ(tk)=Θ(tk−1)+J−1(xd(tk)−x(tk−1))
Leg example:
Know p50(t0)
Want p50⇒pd0
What is xd(t)
xd(t)=Lerp(p50(u),pd0(u),u)
Θ˙ Joint velocity spance, dim n
x˙ end Joint velocity spance, dim m
x˙=JΘ˙
often interested in values of Θ˙ that produce x˙=0
trivial case: Θ˙=0
When n>m, it is possible that 0=JΘ When Θ˙=0
IK solver
Θnull=JT(JJT)−1b−c
x=JΘ=JJT(JJT)−1b−Jc=0
choose b=Jc, null space
Θ˙null=[JT(JJT)−1Jc−c]=[JT(JJT)−1J−I]c=[J−1J−I]c
c is arbitrary vector at dim n×1 same dim as θ
spring-like behavior for joints
Θd=desired joint angles
Θ= actual joint angles
Θ˙=k(Θd−Θ)
IK solver
Θ˙=J−1x˙d+Θ˙null
x=JΘ˙=J(J−1x˙d+Θ˙null)
Choose Θ˙c=k(td−t)
Θ˙=J−1x˙d+[J−1J−I]k(Θd−Θ)
primary constraint, secondary constraint
some times there are problems with inversion of J, when loss of 2 degree of freedom
†
In this case use a "damped pseudo inverse"
Normally J†=JT(JJT)−1
Damped J†=JT(JJT+λI)−1
with λ<<1, I is identity matrix
Main idea
law of Cosine
dot product
cross product
Joint 3 orientation
xd˙=Δtxd(tk)−x(tk)
Compute only θ2 to get distance between joint 1 and joint 3 equal to ∥rd∥
ϕ=arccos2∥l1∥∥l2∥(l1)2+(l2)2−(rd)2
θ2=π−ϕ
Compute quaternion q1 at joint 1 to rotate rd so it points at pd
Δθ1=arccos∥d∥∥rd∥d⋅rd
Joint 3 Orientation (optional)
if indicate
Main Concept: If rotate joint 1 by angle get end joint 2 as close as possible to pd
motion capture
Create a kinematic chain of joints of length n ( j = 1 to n )
- Start with the second to last joint in the chain (i.e. j = n-1)
- Compute error between end joint ( pn ) and goal ( pd )
- Compute rjn and rdj for joint j
- Compute Δθj and a^jj for joint j
- Scale joint rotation Δθj=cΔθj
- Compute qj=qj⋅Δqj
- Update pn after setting joint j rotation to qj
- Update j=j−1