3D/VR 3D/VR Apply 3D/VR Vrtual Realty Technque to Prove the 3D/VR Smulaton of Ankle
爲 堃
Vsual C++ OpenGL 3D/VR v
Abstract The purpose of ths thess s to set up a mechansm of ankle for normal human walkng. Frst, flmng the walked normal human by dgtal camera, then based the persstence of human vson to cut the flm wth the rato of thrty pctures per second. Dervng the trajectory equaton of knee and toe by the pctures and apply nverse dynamcs equaton to calculate angle of ankle for human walkng, applyng Vsual C++ and OpenGL to buld 3D/VR vrtual realty technque and to prove the angle of ankle for human walkng and comparng t wth the actual angle of ankle for human walkng, dscussng t s error and modfy t to close the angle of ankle for human walkng. v
......v Abstract...v...v... v...x...x...1 1.1...1 1.2...1 1.3...2...4 2.1...4 2.2...4 2.3...6 2.4...11 OpenGL...13 3.1 OpenGL...13 3.2 OpenGL...14...19 4.1 Vsual C++...19 4.2...19 4.3...20 v
4.4 VC++ 3D/VR...22...25 5.1...25 5.2...26...28 v
v 1.1...2 1.2...2 1.3 Jones...3 1.4 Wrst...3 1.5...3 2.1...4 2.2 D-H...5 2.3 D-H...6 2.4...7 2.5...10 2.6...11 2.7...11 2.8...11 2.9...11 2.10...12 2.11...12 2.12...12 2.13...12 3.1...15 3.2 15 3.3...16 3.4...16 3.5...17
3.6 3.7 3.8 3.9 3.10 3.11 4.1 4.2 4.3 4.4 4.5 4.6 5.1 5.2 5.3...18 45...18 ( )...18 45...18...18...18 modal...21 modeless...21 (sde vew)...23 (sde vew)...23 (ftront vew)...24 (front vew)...24 25 25 26 x
2.1 D-H...8 x
P -1 A -1 D-H Matrx a α d θ T px p y p z x y z O Q A R1 R2 R3 θ 1 θ 2 (Sde vew) θ 3 (Front vew) L Q A Qx Q y Q Z Q x y z Ox O y O Z O x y z x
1.1 (Stance phase) (Swng phase) (Bped-robot) 1.2 ( ) ( ) [1-7] 3D/VR 1
1.3 1.1 1.2 [8-9] 1.1 1.2 Jones (Ankle axs) (Subtalar axs) Jones 1.3 Wrst 2
(Unversal jont) 1.4 1.5 [10] 1.3 Jones 1.4 Wrst 1.5 3
2.1 Wrst 2.1 2.1 2.2 Denavt-Hartenberg Method [11] P -1 P : P = A P -1-1 P -1 P -1-1 A -1 D-H Matrx D-H Matrx : Denavt-Hartenberg lnk length a lnk twst α 4
lnk offset d jont angle θ 2.2 d Z X 1 X θ Z X 1 X a X Z Z + 1 α X Z Z + 1 2.2 D-H 2.2 (-1) (a) (-1) Z 1 d O 1 H 1 (b) (-1) Z 1 θ X 1 X (c) (-1) X a O 1 O (d) (-1) X α 1 A 1 A = T ( z, d ) T ( z, θ ) T ( x, a) T ( x,α ) (2.1) 1 A cθ = sθ 0 0 cα sθ 0 cα cθ sα sα sθ sα cθ cα 0 acθ a sθ d 1 (2.2) 5
snθ cosθ Denavt-Hartenberg D-H ] T [ p = p p p 1 x y z 1 1 (-1) p= A p 2.3 Denavt-Hartenberg D-H Z0 1 O Y0 X0 R1 Z2 3 X2 Y2 A R2 2 Z1 Y1 X1 Q Y3 R3 Z3 X3 2.3 D-H 2.3 O A Q R1 R2 6
R3 θ 1 θ 2 (Sde vew) θ 3 (Front vew) Q (X0,Y0,Z0, X3,Y3,Z3) (2.3) (θ 1,θ 2,θ 3) (2.4) Q A R2 R3 Q A 2-3 Z0 1 O Y0 X0 R1 2 3 Y2 A Z1 Z2 X2 L Y1 X1 Z3 Q Y 3 X3 2.4 2.4 Q A L Q A 7
L= 2 2 R2 + R3 (2.5) d θ a α D-H 2.1 D-H Jont d θ a α 1 0 θ 1 R1 0 2 0 θ 2 0-90 3 0 θ 3 L 0 D-H D-H Cθ1 Sθ1 0 R1Cθ1 Sθ1 Cθ1 0 R1Sθ 1 A 1= 0 0 1 0 0 0 0 1 Cθ 2 0 Sθ 2 0 1 Sθ 2 0 Cθ 2 0 A 2 = 0 1 0 0 0 0 0 1 Cθ3 Sθ3 0 LCθ3 2 Sθ3 Cθ3 0 LSθ 3 A 3= 0 0 1 0 0 0 0 1 0 O Q 0 A Cθ12Cθ3 Cθ12Sθ3 Sθ12 LCθ12Cθ3 + R1Cθ1 Sθ Cθ Sθ Sθ Cθ LSθ Cθ + R1Sθ 12 3 12 3 12 12 3 1 3 = Sθ3 Cθ3 0 LSθ3 Cθ COS( θ θ ) 12 1 2 0 0 0 1 (2.6) (2.7) (2.8) (2.9) = + O (0,0,0) Q LCθ Cθ + R1Cθ, LSθ12Cθ3 + R1Sθ1, LSθ3 ) ( 12 3 1 8
Q O = LSθ (2.10) Z Z Q Z Q Z OZ O Z θ 2 1 QZ OZ θ3 = sn L 3 12 3 1 (2.11) Q O = LCθ Cθ + R1Cθ (2.12) x x Q O = LSθ Cθ + R1Sθ (2.13) y y 12 3 1 (2.12) (2.13) ( ) 2 2 2 2 2 2 Q O LCθ Cθ 2LR1CθCθ Cθ R1 Cθ x = + + (2.14) x 12 3 1 12 3 1 ( ) 2 2 2 2 2 2 Qy Oy L Sθ12Cθ3 2LR1Sθ1 Sθ12Cθ3 R1 Sθ1 (2.14) (2.15) = + + (2.15) ( ) ( ) 2 2 2 2 2 x x y y θ3 2 1 θ2 θ3 1 Q O + Q O = LC + LR C C + R (2.16) ( ) ( ) 2 2 2 2 2 x x y y 1 θ3 2 1 θ2 θ3 Q O + Q O R LC = LR C C (2.17) θ = cos 2 1 ( ) ( ) 2 2 2 2 2 x x + y y 1 θ3 Q O Q O R LC 2LR1C θ 3 (2.18) θ 3 (2.12) (2.13) (2.19) (2.20) ( ) Q O = LCθ CθCθ Sθ Sθ + R1Cθ (2.19) x x 3 1 2 1 2 1 ( ) Q O = LCθ SθCθ + Cθ Sθ + R1Sθ (2.20) y y 3 1 2 1 2 1 x x ( 1) ( ) Q O = Cθ LCθ Cθ + R Sθ LCθ Sθ (2.21) 1 3 2 1 3 2 9
y y ( 1) ( ) Q O = Sθ LCθ Cθ + R + Cθ LCθ Sθ (2.22) 1 3 2 1 3 2 (2.21) (2.22) Cθ = ( x x)( + 1) + ( y y) Q O LCθ Cθ R Q O LCθ Sθ 3 2 3 2 ( LCθ Cθ ) + ( LCθ Sθ ) 1 2 2 Sθ = 3 2 3 2 ( y y)( + 1) ( x x) ( LCθ Cθ ) + ( LCθ Sθ ) Q O LCθ Cθ R Q O LCθ Sθ 3 2 3 2 1 2 2 3 2 3 2 (2.23) (2.24) tanθ Sθ 1 1 = (2.25) Cθ1 θ Sθ tan 1 1 1 = Cθ1 (2.26) 2.5 R1 R1 R3 R2 L R2 R3 2.5 θ2 θ1 θ2 θ = cos 2 1 1 QZ OZ θ3 = sn L ( ) ( ) 2 2 2 2 2 x x + y y 1 θ3 Q O Q O R LC 2LR1C θ 3 1 R3 sn L (2.27) (2.28) 10
θ ( 0 θ cos θ 90 1) ( ) θ sn ( θ 3 2 3 2 0 90 ) ( θ3cos θ2 90 1) ( ) θ3sn ( θ2 90 ) ( ) ( ) ( ) ( ) Q O LC + + R Q O LC + 1 y y x x 1 = tan 0 0 Qx Ox LC + + R + Qy Oy LC + (2.29) 2.4 3D/VR 30 2.6 2.7 2.8 2.9 2.6 2.7 2.8 2.9 11
matlab [12] 2.12 2.13 2.10 2.11 2.12 2.13 12
OpenGL 3.1 OpenGL OpenGL Slcon Graphcs IRIS GL(SGI) IRIS 3D API(Applcaton Programmng Interface) ) IRIS GL SGI IRIS GL OpenGL OpenGL API OpenGL OpenGL OpenGL OpenGL 3D OpenGL 3D OpenGL OpenGL 3D API 300 OpenGL C GLbyte GLshort GLnt GLflort GLdouble GL OpenGL C byte short nt float double C OpenGL 13
GLUT OpenGL utlty toolkt( ) OpenGL GLUT OpenGL GLUT [13] 3.2 OpenGL API OpenGL GLU GLUT [14] 14
3.1 M=TRS OpenGL 3.2 (1)vod glpushmatrx(vod) (2)vod glrotatef(type angle, TYPE x, TYPE y, TYPE z) 15
(3)vod gltranslatef (GLdouble x,gldouble y,gldouble z); (4)vod glcolor3ub(glfloat red, GLfloat green, GLfloat blue) (5)vod drawretc(float W,float L,float H) (6)vod glpopmatrx(vod) 3.3 3.4 16
y xy z 3.5 17
3.6 3.7 45 3.8 ( ) 3.9 45 3.10 3.11 18
4.1 Vsual C++ Wndows (Integrated Development Envronment IDE) Vsual C++ Mcrosoft Vsual C++ -MFC(Mcrosoft Foundaton Class) API 4.2 1. CWnd ON_WM_XXX 2. CCmdTarget ON_COMMAND( ) 3. MFC [15] 19
4.3 1/30 Wndows 1. modal 2. modeless [16] 1. dalog template RC... modal front sde 2. dalog procedure WM_INITDIALOG WM_COMMAND WM_COMMAND notfcaton modeless 20
4.1 modal 4.2 modeless 21
4.4 VC++ 3D/VR Vsual C++ Tmer (Tmer) Wndows API SetTmer() WM_TIMER UINT SetTmer( HWND UINT UINT TIMERPROC ) SetTmer() 0 WM_TIMER 1000 1 WM_TIMER WM_TIMER WM_TIMER NULL WM_TIMER BOOL KllTmer(nt ) [17] 22
4.3 (sde vew) 4.4 (sde vew) 23
4.5 (ftront vew) 4.6 (front vew) 24
5.1 matlab 105 100 (degree) 95 90 85 80 75 70 65 0 10 20 30 40 50 60 70 80 90 100 % 5.1 120 115 110 (degree) 105 100 95 90 85 80 75 70 0 10 20 30 40 50 60 70 80 90 100 % 5.2 25
5.l 5.2 120 115 110 (degree) 105 100 95 90 85 80 75 70 0 10 20 30 40 50 60 70 80 90 100 % 5.3 0 5.3 60% 90 80% 0 0 98 5.2 60% 87 80% 0 102 5.2 26
Mcrosoft VC++ OpenGL 27
[1],,,,,,2004.11.26~27 [2],,,,,2004.11.26~27 [3],,,,, 2004.11.26~27 [4],,,,,2004.11.26~27 [5],,,,,2004.11.26~27 [6],,,,2002.1 [7],,,,2003.6 [8], [ ],,1995[ 84] [9], [ ],,1997[ 86] [10],, 87 [11] Lung-Wen Tsa, Robot analyss the mechancs of seral and parallel manpulators,john wley&sons,1999 28
[12] C. Lndfeld and J. Penny,, - MATLAB,,86 12 [13], OpenGL, 93 [14] Edward Angel, OpenGL,,1998[ 87] [15] /, Wndows Me,,2000 09 15 [16], MFC 2, [17] Vsual C++,2004.03, 29