Background:Coordinate System Transformations
i
j
Derivation of the 2D Rotation Matrix(basis vectors)
ฮธ
๐ฦธโฒ
i
j
Coordinate Transformations (2D)
ฮธ
๐ฦธโฒ = cos๐๐ฦธ+ sin๐๐ฦธ Find in global space:
i
j
Coordinate Transformations (2D)
ฮธ
๐ฦธโฒ = cos๐๐ฦธ+ sin๐๐ฦธ ๐ฦธโฒ = โsin๐๐ฦธ+ cos๐๐ฦธ ๐ฦธโฒ
Find in global space:
Coordinate Transformations
๐ฦธโฒ = cos๐๐ฦธ+ sin๐๐ฦธ ๐ฦธโฒ = โsin ๐๐ฦธ+ cos๐๐ฦธ ๐ฦธโฒ๐ฦธโฒเตจ= แcos๐ sin๐โsin๐ cos๐แ๐ฦธ๐ฦธเตจ
Note: The rows of the 2x2 rotation matrix from global to local space are composedof the unit vectors of the local coordinate system axis (in global space).
i
j
Derivation of the 3D Rotation Matrix(basis vectors)
ฮธ
kKโ
Z Rotation from Global to Local
๐ฦธโฒ๐ฦธโฒ๐โฒเตฉ= เธญcos๐ sin๐ 0โsin๐ cos๐ 00 0 1เธญ๐ฦธ๐ฦธ๐เตฉ
๐ฦธโฒ = cos๐๐ฦธ+ sin๐๐ฦธ ๐ฦธโฒ = โsin๐๐ฦธ+ cos๐๐ฦธ ๐ โฒ = ๐
Note: The rows of the 3x3 rotation matrix from global to local space are composedof the unit vectors of the local coordinate system axis (in global space).
Translations of Bodies in 3D
Y
XZ
๐= ๐๐ฅ๐ขฦธ+ ๐๐ฆ๐ฦธ+ ๐๐ง๐
๐
Y
XZ
๐
๐โฒ = ๐ (๐เดคโ ๐)
Xโ
zโyโ
P
PโPโ
Coordinate System Transformations(Global to Local example)
Translations and Rotation(Example: Global to Local)
Y
XZ
X
Y
Z
For:
andOx=8, Oy=8, Oz=0
Find P in Local Space (Pโ)?
O
P ๐ = เธญ1 0 00 .707 .7070 โ.707 .707เธญ
๐เดค= 10๐ขฦธ + 9.41๐ฦธ + 1.41๐ Pโ
Coordinate System Transformations(Example: Global to Local)
Y
XZ
X
Y
Z
Transform global to local:
แฎ
๐๐ฅโฒ๐๐ฆโฒ๐๐งโฒแฎ= เธญ1 0 00 .707 .7070 โ.707 .707เธญ เธญ
109.411.41เธญโ เธญ880เธญ เตฉ
๐เดคโฒ = ๐ (๐เดคเดคเดคโ ๐)
= เธญ220เธญ แฎ
๐๐ฅโฒ๐๐ฆโฒ๐๐งโฒแฎ= เธญ1 0 00 .707 .7070 โ.707 .707เธญเธญ
21.411.41เธญ เตฉ
๐เดค= 10๐ขฦธ + 9.41๐ฦธ + 1.41๐ Pโ
Rotation Matrices are orthonormal
โข The rotation from Global to Local Spaceis the inverse of the rotation from Local to Global Space
โข Rotation Matrices are orthonormal and thusthe inverse is equal to the transpose
๐ ๐ โฒ = ๐ผ
Coordinate System Transformations(Local to Global)
Y
XZ
๐
๐= ๐ โฒ๐โฒ + ๐
Xโ
zโyโ
P
PโPโ
Rโ is the rotational transformation from local to global space
Y
XZ
X
Y
Z
For:
andOx=8, Oy=8, Oz=0
Find P in Global Space
๐เดคโฒ = 2๐ขฦธโฒ + 2๐ฦธโฒ + 0๐ โฒ
O
P ๐ = เธญ1 0 00 .707 .7070 โ.707 .707เธญ
Pโ
Coordinate System Transformations(Example: Local to Global)
Y
XZ
X
Y
ZTransform local to global:
แฐ
๐๐ฅ๐๐ฆ๐๐งแฐ= เธญ
1 0 00 .707 โ.7070 .707 .707 เธญเธญ220เธญ + เธญ
880เธญ
= เธญ109.411.41เธญ
๐= ๐ โฒ๐โฒ + ๐
๐เดคโฒ = 2๐ขฦธโฒ + 2๐ฦธโฒ + 0๐ โฒ
แฐ
๐๐ฅ๐๐ฆ๐๐งแฐ= เธญ
21.411.41เธญ + เธญ880เธญ
Coordinate System Transformations(Example: Local to Global)
Coordinate System Transformations
Global to Local:
Local to Global:
๐เดคโฒ = ๐ (๐เดคโ ๐)
๐= ๐ โฒ๐โฒ + ๐
Where the rows of the rotation matrix from global to local space (R) are composed of the unit vectors of the local coordinate system axis (in global space).
Non-Optimal Pose Estimation
Pelvis
Anatomical Coordinate Systems (pelvis)How to calculate the anatomical coordinate systems
3) Create M/L Unit Vector i from step 2unit vector = (ix, iy, iz)
4) Find the vector from the Sacrum toOrigin
1) Find midpt between LASIS & RASIS = Origin
5) Create Unit Vector v from step 4unit vector = (vx, v, vz)
6) Use i X v to get Inferior/Superior Unit Vectorunit vector = (kx, ky, kz)
7) Use k X i to get Anterior/Posterior Unit Vectorunit vector = (jx, jy, jz)
๐ ๐๐๐๐ฃ๐๐ = แฎ
๐๐ฅ ๐๐ฆ ๐๐ง๐๐ฅ ๐๐ฆ ๐๐ง๐๐ฅ ๐๐ฆ ๐๐งแฎ
X
Z
Y2) Find the vector from Origin to right ASIS
Finding the Hip Center(in Pelvic Coordinate System)
X
Z
Y
Right Hip (Bell, Brand and Pederson):
X = 0.36 * ASIS DistanceY = -0.19 * ASIS DistanceZ = -0.30 * ASIS Distance
Pelvis Non-Optimal Calibration:
โข Finding the local coordinates of the hip center (which are needed to calibrate the other segments)
โข Anthropometrics, Graphics Scaling and Graphing the Calibration Trial
Pelvis: code is already partof GaitProject
Thigh
Anatomical Coordinate Systems (thigh)How to calculate the anatomical coordinate systems
2) Find the Knee center (Midpt of knee targets)
3) Find the vector from Knee to Hip
7) Find the the A/P axis, j, from k X v unit vector = (jx, jy, jz)
8) Find the M/L axis, i, via j X k unit vector = (ix, iy, iz)
๐ ๐กโ๐๐โ = แฎ
๐๐ฅ ๐๐ฆ ๐๐ง๐๐ฅ ๐๐ฆ ๐๐ง๐๐ฅ ๐๐ฆ ๐๐งแฎ
1) Find the Hip center in Lab from Pelvis (tricky)
4) Find the Inferior/Superior Axis, k, from Unit vector of step 3
unit vector = (kx, ky, kz)
5) Find the vector from medial to lateral Knee
6) Find the vector v which is unit vector of step 5unit vector = (vx, vy, vz)
v
Z
X
Y
Problem: Calculating the anatomical coordinate system requires a target (medial knee) not used during the
walking trial
Solution: Create a virtual medial knee target which can be located during
the motion trials
Step 1: Creating the temporary local coordinate system
1) Select one Point (Lateral Knee) as Origin
2) Find the unit vector from origin to the Hip unit vector = (kt
x, kty, kt
z)
3) Use the lateral knee and 3rd target to find a second vector v
6) Find the third axis via j X k unit vector = (it
x, ity, it
z) ๐ ๐ก๐๐๐ = แฐ
๐๐ก๐ฅ ๐๐ก๐ฆ ๐๐ก๐ง๐๐ก๐ฅ ๐๐ก๐ฆ ๐๐ก๐ง๐๐ก๐ฅ ๐๐ก๐ฆ ๐๐ก๐งแฐ
5) Use the results of step 4 to find โA/Pโ unit vector j unit vector = (jt
x, jty, jt
z)
4) Find the the โA/Pโ axis from k X v
Step 2: Storing the virtual lateral knee target
1) Start with the tracking based local coordinate system (Rtemp)
P
2) Transform P into the tracking coordinatesystem (Pโ) using
โ
๐โฒ = ๐น๐๐๐๐ (๐เดคโ ๐เดค)
Where P are the global coordinates of lat knee and O are the global coordinates of the medial knee
Thigh Non-Optimal Calibration:
โข Finding the local coordinates of the medial knee target in the calibration trial
โข Anthropometrics, Graphics Scaling and Graphing the Calibration Trial
1) Create the tracking based local coordinate system (Rtemp)
2) Recall the stored vector (Pโ) fromorigin to the calibration target (in tracking coordinate system)
P
3) Transform Pโ into the global coordinatesystem (P) using:
โ๐= ๐น๐๐๐๐โฒ๐โฒ + ๐ถ
4) Use the tracking targets (including virtual) to find anatomically basedcoordinate system
Step 3: Find the anatomical system during movement
Thigh: code is already partof GaitProject
Shank
Anatomical Coordinate Systems (shank)How to calculate the anatomical coordinate systems
2) Find the Ankle center
3) Find the vector from Ankle to Knee
6) Find the the โA/P axis from k X v
8) Find the M/L axis via j X k unit vector = (ix, iy, iz)
๐ ๐ โ๐๐๐ = แฎ
๐๐ฅ ๐๐ฆ ๐๐ง๐๐ฅ ๐๐ฆ ๐๐ง๐๐ฅ ๐๐ฆ ๐๐งแฎ
1) Find the Knee center in Lab from Thigh (tricky)
4) Find the Inferior/Superior Axis from Unit vector of step 3
unit vector = (kx, ky, kz)
5) Find the vector v from medial to lateral Ankle
7) Find the Unit A/P vector junit vector = (jx, jy, jz)
v
Problem: Calculating the anatomical coordinate system requires a target (medial ankle) not used during the
walking trial
Solution: Create a virtual medial ankle target which can be located
during the motion trials
Step 1: Creating the temporary local coordinate system
1) Select one Point (Lateral Ankle) as Origin
2) Find the unit vector from origin to the Knee unit vector = (kt
x, kty, kt
z)
3) Use the lateral ankle and 3rd target to find a second vector v
6) Find the third axis, i, via j X k unit vector = (it
x, ity, it
z) ๐ ๐ก๐๐๐ = แฐ
๐๐ก๐ฅ ๐๐ก๐ฆ ๐๐ก๐ง๐๐ก๐ฅ ๐๐ก๐ฆ ๐๐ก๐ง๐๐ก๐ฅ ๐๐ก๐ฆ ๐๐ก๐งแฐ
4) Use the results of step 3 to find a second unit vector unit vector = (vx, vy, vz)
5) Find the the โA/Pโ axis from k X v unit vector = (jt
x, jty, jt
z)
Step 2: Storing the virtual lateral ankle target
1) Start with the tracking based local coordinate system (Rtemp)
P
2) Transform P into the tracking coordinatesystem (Pโ) using
โ
๐โฒ = ๐น๐๐๐๐ (๐เดคโ ๐เดค)
Where P are the global coordinates of lat ankle and O are the global coordinates of the medial ankle
Shank Non-Optimal Calibration:
โข Finding the local coordinates of the medial ankle target in the calibration trial
โข Anthropometrics, Graphics Scaling and Graphing the Calibration Trial
1) Create the tracking based local coordinate system (Rtemp)
2) Recall the stored vector (Pโ) fromorigin to the calibration target (in tracking coordinate system)
P
3) Transform Pโ into the global coordinatesystem (P) using:
โ๐= ๐น๐๐๐๐โฒ๐โฒ + ๐ถ
4) Use the tracking targets (including virtual) to find anatomically basedcoordinate system
Step 3: Find the anatomical system during movement
Foot
Anatomical Coordinate Systems (foot)How to calculate the anatomical coordinate systems
3) Find Z Axis from Unit vector of step 1unit vector = (kx, ky, kz)
4) Find the vector from Origin to Heel v
7) Find the the Y axis, j, from k X i unit vector = (kx, ky, kz)
6) Find the unit vector from step 2 unit vector = (ix, iy, iz)
๐ ๐๐๐๐ก = แฎ
๐๐ฅ ๐๐ฆ ๐๐ง๐๐ฅ ๐๐ฆ ๐๐ง๐๐ฅ ๐๐ฆ ๐๐งแฎ
2) Find the Vector from Toe to Origin
5) Find the M/L axis via k X v
Y
Z
X
1) Find midpoint of ankle targets = Origin (from Shank - tricky)
Foot Non-Optimal Calibration:
Anthropometrics, Graphics Scaling and Graphing the Calibration Trial
Assignment #5 โ Build Non Optimal Model in Gait Project for the right thigh, right shank and
right foot
Letโs Look at the Pelvis and Thigh Code right now