KAAP686 Homework 2 (33 points) 1 (3 points): Which way do the unit vectors i, j, and k point, as they are described in part C below? Possible answers are left, right, anterior, posterior, superior, inferior. 2 (15 points): Submit a hard copy of a Matlab script as described below. 3 (15 points): Submit hardcopy of at least two views of 3D plots of the five tracks: 3 markers and 2 hip joint centers. Use different colors and symbols for each track, and supply a legend to indicate which track is which. Plot symbols at each time point, connected by lines. Write a Matlab script to: A. Read in the data from one of the following marker data files. 1. File …\kaap686\reserve\pelvis_tracking\pelvis_markers_noheaders.txt has 10 columns of data. The columns are: Frame number, left ASIS X, left ASIS Y, left ASIS Z, right ASIS X, right ASIS Y, right ASIS Z, sacrum X, sacrum Y, sacrum Z. Frame rate= 100 Hz, units=mm, data is in the global reference system, i.e. laboratory coordinates. 2. File …\kaap686\reserve\walk_data\gait_raw.txt has 39 columns of data. The columns are x,y,z for: sacrum, left ASIS, thigh, knee, tibia, ankle, toe, right ASIS, thigh, knee, tibia, ankle, toe. Frame rate= 50 Hz, units=mm, data is in the global reference system, i.e. laboratory coordinates. B. Put the x,y,z data from L ASIS into one 3-column array called LASIS, and the x,y,z data from R ASIS and sacrum into 3-column arrays RASIS and Sac. C. Compute the right and left hip joint center locations, in global coordinates, at each instant of time (i.e. at each frame) by using the following equations: O=origin = midpoint of ASIS markers=(LASIS+RASIS)/2 Breadth = ASIS breadth=distance between RASIS and LASIS (always positive) k=(RASIS-LASIS) / ||( RASIS-LASIS)|| = unit vector pointing from LASIS to RASIS a=LASIS-Sac = vector pointing from sacrum to LASIS b=RASIS-Sac = vector pointing from sacrum to RASIS i= (a ο΄ b) / ||(a ο΄ b)|| j = (k ο΄ i) / ||(k ο΄ i)|| You can do the problem without using a rotation matrix, by using the following equations to locate the hip joint centers. The equations are the same, whether you use row vectors or column vectors (as long as you are consistent): HCR = O + i*(0.24*Breadth) – j*(0.21*Breadth) + k*(.32*Breadth) HCL = O + i*(0.24*Breadth) – j*(0.21*Breadth) – k*(.32*Breadth) You can do the problem using a rotation matrix if you prefer. The correct equations depend on whether you use row vectors or column vectors for marker and joint positions. If you use column vectors, then i, j, and k are column vectors, and i’=transpose of i=row vector. Likewise for j and j’ and k and k’. Then the equations are: ππ₯ π»πΆπ₯ ππ₯ [π»πΆπ¦ ] = [ππ¦ ] + [ ππ₯ ππ₯ π»πΆπ§ ππ§ Document1 ππ¦ ππ¦ ππ¦ ππ§ +.24π΅πππππ‘β ππ§ ] [−.21π΅πππππ‘β] ππ§ ±.32π΅πππππ‘β where + is for right and – is for left in the breadth vector. This can also be written as R=[i’; j’; k’] (in Matlab, prime indicates transpose and semicolon separates rows in an array) HCR = O + R*[+.24*ASISbreadth; -0.21*ASISBreadth; +.32*ASISBreadth)] HCL = O + R*[+.24*ASISbreadth; -0.21*ASISBreadth; -.32*ASISBreadth)] HCR, HCL, O, and the items in [ ] are column vectors. R is 3x3. If you use row vectors, then i, j, and k are row vectors, and i’=transpose of i=column vector. for j and j’ and k and k’. Then the equations are: ππ₯ π»πΆ π»πΆ π»πΆ π π π π [ π₯ π¦ π§] = [ π₯ π¦ π§ ] + [+.24π΅πππππ‘β −.21π΅πππππ‘β ±.32π΅πππππ‘β] [ π¦ ππ§ where + is for right and – is for left in the breadth vector. This can also be written as Likewise ππ₯ ππ¦ ππ§ ππ₯ ππ¦ ] ππ§ R=[i’, j’, k’] (in Matlab, prime indicate transpose and comma separates columns in an array) Rhc = O + [+.24*ASISbreadth, -0.21*ASISBreadth, +.32*ASISBreadth)]*R Lhc = O + [+.24*ASISbreadth, -0.21*ASISBreadth, -.32*ASISBreadth)]*R HCR, HCL, O, and the items in [ ] are row vectors. R is 3x3. D. Write a 7 column text file to disk. Columns should be t (in seconds, computed using correct frame rate for the data set), X, Y, Z for R hip center ; X, Y, Z for L hip center. It should have as many rows as the initial file has. Thanks to Tom Kepple for the hip model and for the file pelvis_markers_noheaders.txt. Two possible data sets were offered for the above assignment. Data set B (file pelvis_markers_noheaders.txt) was collected on treadmill (approximate velocity 1.8 m/s), so there is no forward progression of pelvis during the trial. Two data sets are now described. Data set A could be used for spherical fitting homework problem. Data set B is one of the options for the homework problem above. A. BRPstand_full_data.txt and BRPwalk_data.txt Stroke patient, 120 fps, units=mm. +X=anterior, +Y=left, +Z=superior. X=0 just behind heels, Y=0 between feet, Z=0 on floor. Markers use LPSIS & RPSIS instead of sacrum. Surprisingly, the medial knee and ankle markers ( LKNM, LMAM, RKNM, RMAM) are present in the walking trial as well as the standing calibration trial, according to the header info in the c3d file. This data set could be useful as an example of spherical fitting to find hip joint center. The walking trial would have to be used. There is no sacral marker, so this set cannot be used as a direct substitute for the homework problem above. BRPstand_full_data: 1.9 seconds Markers 1-10 EARR C7SP 11-20 RELB RWRI 21-30 LTH2 LTH3 31-40 LFTL LFTM 41-50 RSH3 RSH4 51-54 LMAM RKNL TRK1 LASI LTH4 LFTT RMAL RKNM TRK2 RASI LSH1 RGTR RHLT RMAM Document1 TRK3 LPSI LSH2 RTH1 RHLB TRK4 RPSI LSH3 RTH2 RFTL LSHO LILC LSH4 RTH3 RFTM LELB RILC LMAL RTH4 RFTT LWRI LGTR LHLT RSH1 LKNL RSHO LTH1 LHLB RSH2 LKNM Columns: 162: x, y, z for each marker above. 37-48: LASIx,y,z, RASIx,y,z, LPSIx,y,z, RPSIx,y,z 145-150: LKNLx,y,z, LKNMx,y,z 154-159: RKNLx,y,z, RKNMx,y,z BRPwalk_data: 2.5 seconds; same markers as above minus EARR. Markers 1-10 C7SP TRK1 TRK2 TRK3 TRK4 LSHO LELB 11-20 RWRI LASI RASI LPSI RPSI LILC RILC 21-30 LTH3 LTH4 LSH1 LSH2 LSH3 LSH4 LMAL 31-40 LFTM LFTT RGTR RTH1 RTH2 RTH3 RTH4 41-50 RSH4 RMAL RHLT RHLB RFTL RFTM RFTT 51-53 RKNL RKNM RMAM Columns: 159: x, y, z for each marker above. 34-45: LASIx,y,z, RASIx,y,z, LPSIx,y,z, RPSIx,y,z 142-147: LKNLx,y,z, LKNMx,y,z 151-156: RKNLx,y,z, RKNMx,y,z LWRI LGTR LHLT RSH1 LKNL RSHO LTH1 LHLB RSH2 LKNM RELB LTH2 LFTL RSH3 LMAM B. gait-raw.txt Normal adult, 50 fps, units=mm, 142 frames=2.84 seconds of data. This data could be used as a direct substitute for the data from Tom Kepple, since there are ASIS and sacral marker data. Sacrum=columns 1-3, LASIS=columns 4-6, RASIS=columns 22-24. Columns 1-9: 10-18: 19-27: 28-36: 37-39: SACRx LKNEx LTOEx RKNEx RTOEx SACRy LKNEy LTOEy RKNEy RTOEy SACRz LKNEz LTOEz RKNEz RTOEz LASIx LTIBx RASIx RTIBx Document1 LASIy LTIBy RASIy RTIBy LASIz LTIBz RASIz RTIBz LTHIx LANKx RTHIx RANKx LTHIy LANKy RTHIy RANKy LTHIz LANKz RTHIz RANKz