Upgrade to Pro — share decks privately, control downloads, hide ads and more …

iPhoneの外部センサーを使わない位置測定
--測定誤差を添えて--

 iPhoneの外部センサーを使わない位置測定
--測定誤差を添えて--

8/23
iOSDC 2024 外部センサーを使わない位置測定
--測定誤差を添えて--

Takumi Muraishi

August 23, 2024
Tweet

More Decks by Takumi Muraishi

Other Decks in Technology

Transcript

  1. Aug. 23, 2024 ͠Ζ͘· @mrs1669 iOSDC 2024 Track A 15:05

    ~ 15:25 iPhoneͷ֎෦ηϯαʔΛ࢖Θͳ͍Ґஔଌఆ
 --ଌఆޡࠩΛఴ͑ͯ--
  2. ͜ͷτʔΫͰ͓࿩͢Δ͜ͱ w J1IPOFͰ࢖͑Δηϯαʔ͓͞Β͍ w $PSF.PUJPO w Ճ଎౓ͱ֯଎౓ͷΈͰڑ཭ܭଌ͢Δʹ͸ʁཧ࿦ͷઆ໌ &BTZ  w

    Ճ଎౓ͱ֯଎౓σʔλͷऔಘ w ཧ࿦ͷઆ໌ )BSE ίʔσΟϯά w ଌఆ݁Ռ w ܭଌޡࠩޡࠩิਖ਼ 
  3. ͜ͷτʔΫͰ࿩͞ͳ͍͜ͱ🙏 w ֎෦ηϯαʔ $PSF-PDBUJPO #MVFUPPUI -J%"3౳  w ηϯαʔ༥߹ΞϧΰϦζϜ w

    ΧϧϚϯϑΟϧλ w ίϯϓϦϝϯλϦϑΟϧλ w "QQMF8BUDI "JS1PETͷ$PSF.PUJPO w $.#BUDIFE4FOTPS.BOBHFS J04 /&8 w $.)FBEQIPOF.PUJPO.BOBHFS J04 
  4. w ଜੴ୓ւ ͠Ζ͘· !NST w גࣜձࣾΏΊΈ৽ଔ ࿮ J04&OHJOFFS w J04%$ॳొஃʂ

    w ཱྀɾ"QQMFɾࣗ࡞1$ w 3Z[FO9ຊ೔ൃചʂ🎉  ࣗݾ঺հ
  5. w ଜੴ୓ւ ͠Ζ͘· !NST w גࣜձࣾΏΊΈ৽ଔ ࿮ J04&OHJOFFS w J04%$ॳొஃʂ

    w ཱྀɾ"QQMFɾࣗ࡞1$ w 3Z[FO9ຊ೔ൃചʂ🎉 w෺ཧɾ޻ֶৄ͘͠ͳ͍Ͱ͢🥺  ࣗݾ঺հ
  6. w ଜੴ୓ւ ͠Ζ͘· !NST w גࣜձࣾΏΊΈ৽ଔ ࿮ J04&OHJOFFS w J04%$ॳొஃʂ

    w ཱྀɾ"QQMFɾࣗ࡞1$ w 3Z[FO9ຊ೔ൃചʂ🎉 w෺ཧɾ޻ֶৄ͘͠ͳ͍Ͱ͢🥺  ࣗݾ঺հ 👈ϑΟʔυόοΫ
  7. ηϯαʔҰཡ w (14ηϯαʔ$--PDBUJPO.BOBHFS w Ϟʔγϣϯηϯαʔ$..PUJPO.BOBHFS w า਺ܭηϯαʔ$.1FEPNFUFS w ߴ౓ܭηϯαʔ$."MUJNFUFS w

    র౓ɾً౓ηϯαʔCSJHIUOFTT 6*4DSFFO  w -J%"3ηϯαʔ"3$PO fi HVSBUJPO w ଞ͍Ζ͍Ζ ਫѹ ਫԹ స౗ݕ஌ 
  8. Ϟʔγϣϯηϯαʔ w $PSF.PUJPO w $..PUJPO.BOBHFS J04  w ҎԼͷ͕ͭऔಘͰ͖Δ "DDFMFSPNFUFSՃ଎౓ܭ

    (ZSPTDPQFδϟΠϩείʔϓ .BHOFUPNFUFS࣓ྗܭ %FWJDFNPUJPOσόΠεϞʔγϣϯʁ ࢟੎ͱ͔΋औΕΔͬΆ͍ 
  9. Ϟʔγϣϯηϯαʔ w $PSF.PUJPO w $..PUJPO.BOBHFS J04  w ҎԼͷ͕ͭऔಘͰ͖Δ "DDFMFSPNFUFSՃ଎౓ܭ

    (ZSPTDPQFδϟΠϩείʔϓ .BHOFUPNFUFS࣓ྗܭ %FWJDFNPUJPOσόΠεϞʔγϣϯʁ ࢟੎ͱ͔΋औΕΔͬΆ͍ 
  10. Ϟʔγϣϯηϯαʔ "DDFMFSPNFUFSՃ଎౓ܭ w ࣠ Y Z [ ͝ͱʹಠཱͨ͠Ճ଎౓ w J1IPOFͷ৔߹Y

    Z [͸👉 w ୯Ґ͸   w  (ZSPTDPQFδϟΠϩείʔϓ G m/s2 1.0G = 9.80665m/s2 
  11.  🟣 J1IPOF x y Ґஔܭଌͷཧ࿦  ํ޲ʹ x 2m/s2

    ඵܦա a = 2m/s2 v = ∫ 1 0 aΔt + v0 = 2m/s x = ∫ 1 0 vΔt = 1m ⚫
  12.  🟣 J1IPOF x y Ґஔܭଌͷཧ࿦  ํ޲ʹ x 2m/s2

    ඵܦա a = 2m/s2 v = ∫ 2 1 aΔt + v1 = 4m/s x = ∫ 2 1 vΔt = 3m ⚫
  13.  🟣 J1IPOF x y Ґஔܭଌͷཧ࿦  ํ޲ʹ x 2m/s2

    ඵܦա a = 2m/s2 v = ∫ 3 2 aΔt + v2 = 6m/s x = ∫ 3 2 vΔt = 5m ⚫
  14. σʔλܭଌ "DDFMFSPNFUFSՃ଎౓ܭ  (ZSPTDPQFδϟΠϩείʔϓ      

      "DDFMFSBUJPO9 "DDFMFSBUJPO: "DDFMFSBUJPO;             3PUBUJPO3BUF9 3PUBUJPO3BUF: 3PUBUJPO3BUF; <SBET> <U> <U> ੩ࢭ࣌ J1IPOFը໘্޲͖ <(>
  15. σʔλܭଌ "DDFMFSPNFUFSՃ଎౓ܭ  (ZSPTDPQFδϟΠϩείʔϓ <SBET> <U> <U> ੩ࢭ࣌ J1IPOFը໘্޲͖ <(>

            "DDFMFSBUJPO9 "DDFMFSBUJPO: "DDFMFSBUJPO;             3PUBUJPO3BUF9 3PUBUJPO3BUF: 3PUBUJPO3BUF;
  16. σʔλܭଌ  ੩ࢭ࣌ J1IPOFը໘্޲͖ <(> "DDFMFSPNFUFSՃ଎౓ܭ <U>   

         "DDFMFSBUJPO9 "DDFMFSBUJPO: "DDFMFSBUJPO;
  17. σʔλܭଌ  ੩ࢭ࣌ J1IPOFը໘্޲͖ <(> "DDFMFSPNFUFSՃ଎౓ܭ <U>   

           "DDFMFSBUJPO9 "DDFMFSBUJPO:
  18. σʔλܭଌ  ੩ࢭ࣌ J1IPOFը໘্޲͖ <(> "DDFMFSPNFUFSՃ଎౓ܭ <U>   

           "DDFMFSBUJPO9 "DDFMFSBUJPO: −y −z g
  19. υΩϡϝϯτνΣοΫ 5IF$PSF.PUJPOGSBNFXPSLHJWFTZPVBDDFTTUPUIFSBXEBUBGSPNNBOZEJ ff FSFOUUZQFTPG IBSEXBSFTFOTPST JODMVEJOHBDDFMFSPNFUFST HZSPTDPQFT BOENBHOFUPNFUFST8IJMFUIF SBXEBUBJTVTFGVM JUTPNFUJNFTDPOUBJOTBEEJUJPOBMJOGPSNBUJPOZPVEPO`UOFFE'PS

    FYBNQMF UIFSBXBDDFMFSPNFUFSEBUBDPOUBJOTCPUIUIFBDDFMFSBUJPODBVTFECZHSBWJUZBOE CZUIFEFWJDF`TNPUJPO5PHFUPOMZUIFEFWJDFTQFDJ fi DBDDFMFSBUJPO ZPVNVTUSFNPWFUIF HSBWJUBUJPOBMBDDFMFSBUJPOGSPNUIFSBXEBUBWBMVFT5IFSFNPWBMPGUIJTEBUBSFRVJSFT BEEJUJPOBMJOGPSNBUJPOBOEFYUSBQSPDFTTJOHUJNF $PSF.PUJPOϑϨʔϜϫʔΫΛ࢖༻͢ΔͱɺՃ଎౓ܭɺδϟΠϩείʔϓɺ࣓ྗܭͳͲɺ͞·͟·ͳ छྨͷϋʔυ΢ΣΞηϯαʔ͔ΒͷੜσʔλʹΞΫηεͰ͖·͢ɻੜσʔλ͸ศརͰ͕͢ɺඞཁͷͳ ͍௥Ճ৘ใؚ͕·Ε͍ͯΔ৔߹͕͋Γ·͢ɻͨͱ͑͹ɺະՃ޻ͷՃ଎౓ܭσʔλʹ͸ɺॏྗʹΑΔՃ ଎౓ͱσόΠεͷಈ͖ͷ྆ํؚ͕·Ε͍ͯ·͢ɻσόΠεݻ༗ͷՃ଎౓ͷΈΛऔಘ͢Δʹ͸ɺੜσʔ λ஋͔ΒॏྗՃ଎౓Λ࡟আ͢Δඞཁ͕͋Γ·͢ɻ͜ͷσʔλΛ࡟আ͢Δʹ͸ɺ௥Ճ৘ใͱ௥Ճͷॲཧ ͕࣌ؒඞཁͰ͢ɻ 
  20. Ϟʔγϣϯηϯαʔ 5PNBLFJUFBTJFSUPHFUUIFEBUBZPVXBOU UIFEFWJDFNPUJPOTFSWJDFQSPDFTTFTUIFSBXEBUBBOE NBLFTUIFGPMMPXJOHWBMVFTBWBJMBCMF ඞཁͳσʔλΛ؆୯ʹऔಘͰ͖ΔΑ͏ʹɺEFWJDFNPUJPOαʔϏε͸ੜσʔλΛॲཧ͠ɺ࣍ͷ஋Λ࢖༻Ͱ͖Δ Α͏ʹ͠·͢ɻ w 5IFEFWJDF`TBUUJUVEF PSPSJFOUBUJPO JOUISFFEJNFOTJPOBMTQBDF࣍ݩۭؒʹ͓͚ΔσόΠεͷ࢟੎

    ·ͨ͸޲͖  w 5IFVOCJBTFESPUBUJPOSBUFPGUIFEFWJDFσόΠεͷภΓͷͳ͍ճస଎౓ w 5IFDVSSFOUHSBWJUZWFDUPSݱࡏͷॏྗϕΫτϧ w 5IFEFWJDFTQFDJ fi DBDDFMFSBUJPO XJUIPVUHSBWJUZ σόΠεݻ༗ͷՃ଎౓ ॏྗͳ͠  w 5IFDVSSFOUNBHOFUJD fi FMEWFDUPSݱࡏͷ࣓৔ϕΫτϧ 
  21. Ϟʔγϣϯηϯαʔ 5PNBLFJUFBTJFSUPHFUUIFEBUBZPVXBOU UIFEFWJDFNPUJPOTFSWJDFQSPDFTTFTUIFSBXEBUBBOE NBLFTUIFGPMMPXJOHWBMVFTBWBJMBCMF ඞཁͳσʔλΛ؆୯ʹऔಘͰ͖ΔΑ͏ʹɺEFWJDFNPUJPOαʔϏε͸ੜσʔλΛॲཧ͠ɺ࣍ͷ஋Λ࢖༻Ͱ͖Δ Α͏ʹ͠·͢ɻ w 5IFEFWJDF`TBUUJUVEF PSPSJFOUBUJPO JOUISFFEJNFOTJPOBMTQBDF࣍ݩۭؒʹ͓͚ΔσόΠεͷ࢟੎

    ·ͨ͸޲͖  w 5IFVOCJBTFESPUBUJPOSBUFPGUIFEFWJDFσόΠεͷภΓͷͳ͍ճస଎౓ w 5IFDVSSFOUHSBWJUZWFDUPSݱࡏͷॏྗϕΫτϧ w 5IFEFWJDFTQFDJ fi DBDDFMFSBUJPO XJUIPVUHSBWJUZ σόΠεݻ༗ͷՃ଎౓ ॏྗͳ͠  w 5IFDVSSFOUNBHOFUJD fi FMEWFDUPSݱࡏͷ࣓৔ϕΫτϧ 
  22. σʔλ࠶ܭଌ "DDFMFSPNFUFSՃ଎౓ܭ EFWJDFNPUJPO  (ZSPTDPQFδϟΠϩείʔϓ EFWJDFNPUJPO <U> ੩ࢭ࣌ J1IPOFը໘্޲͖ <SBET>

    <U> <(>        "DDFMFSBUJPO9 "DDFMFSBUJPO: "DDFMFSBUJPO;         3PUBUJPO3BUF9 3PUBUJPO3BUF: 3PUBUJPO3BUF;
  23. σʔλ࠶ܭଌ "DDFMFSPNFUFSՃ଎౓ܭ EFWJDFNPUJPO  ੩ࢭ࣌ J1IPOFը໘্޲͖ <U> <(>  

         "DDFMFSBUJPO9 "DDFMFSBUJPO: "DDFMFSBUJPO; <U> <(>         "DDFMFSBUJPO9 "DDFMFSBUJPO: "DDFMFSBUJPO; "DDFMFSPNFUFSՃ଎౓ܭ
  24. σʔλ࠶ܭଌ  <U> ੩ࢭ࣌ J1IPOFը໘্޲͖     

       3PUBUJPO3BUF9 3PUBUJPO3BUF: 3PUBUJPO3BUF; (ZSPTDPQFδϟΠϩείʔϓ (ZSPTDPQFδϟΠϩείʔϓ EFWJDFNPUJPO <SBET> <U>             3PUBUJPO3BUF9 3PUBUJPO3BUF: 3PUBUJPO3BUF; <SBET>
  25. ڑ཭ܭଌํ๏       ⃗ adevice (t)

    = ax (t) ay (t) az (t) ⃗ ω(t) = ωx (t) ωy (t) ωz (t)
  26. ڑ཭ܭଌํ๏      ⃗ aworld (t) R(t)

    ⋅ ⃗ adevice (t)   ⃗ ω(t) = ωx (t) ωy (t) ωz (t) ճసߦྻSPUBUJPONBUSJY R(t)
  27. ڑ཭ܭଌํ๏      ⃗ aworld (t) R(t)

    ⋅ ⃗ adevice (t)   ⃗ ω(t) = ωx (t) ωy (t) ωz (t)  R(t + Δt) R(t) ⋅ Rz (θz (t)) ⋅ Ry (θy (t)) ⋅ Rx (θx (t))
  28. ڑ཭ܭଌํ๏      ⃗ aworld (t) R(t)

    ⋅ ⃗ adevice (t)   ⃗ ω(t) = ωx (t) ωy (t) ωz (t)  R(t + Δt) R(t) ⋅ Rz (θz (t)) ⋅ Ry (θy (t)) ⋅ Rx (θx (t)) ωx (t) ⋅ Δt ωy (t) ⋅ Δt θx (t) = θy (t) = θz (t) = θx (t) θy (t) θz (t) ωz (t) ⋅ Δt
  29. ڑ཭ܭଌํ๏      ⃗ aworld (t) R(t)

    ⋅ ⃗ adevice (t)  R(t + Δt) R(t) ⋅ Rz (ωz (t) ⋅ Δt) ⋅ Ry (ωy (t) ⋅ Δt) ⋅ Rx (ωx (t) ⋅ Δt) ωx (t) ⋅ Δt ωy (t) ⋅ Δt ωz (t) ⋅ Δt
  30. ڑ཭ܭଌํ๏      ⃗ aworld (t) R(t)

    ⋅ ⃗ adevice (t)  R(t + Δt) R(t) ⋅ Rz (ωz (t) ⋅ Δt) ⋅ Ry (ωy (t) ⋅ Δt) ⋅ Rx (ωx (t) ⋅ Δt) ωx (t) ⋅ Δt ωy (t) ⋅ Δt ωz (t) ⋅ Δt Rx (θx ) = 1 0 0 0 cos θx −sin θx 0 sin θx cos θx Ry (θy ) = cos θy 0 sin θy 0 1 0 −sin θy 0 cos θy Rz (θz ) = cos θz −sin θz 0 sin θz cos θz 0 0 0 1
  31. ڑ཭ܭଌํ๏      ⃗ aworld (t) R(t)

    ⋅ ⃗ adevice (t)  R(t + Δt) R(t) ⋅ Rz (ωz (t) ⋅ Δt) ⋅ Ry (ωy (t) ⋅ Δt) ⋅ Rx (ωx (t) ⋅ Δt) ωx (t) ⋅ Δt ωy (t) ⋅ Δt ωz (t) ⋅ Δt Rx (θx ) = 1 0 0 0 cos θx −sin θx 0 sin θx cos θx Ry (θy ) = cos θy 0 sin θy 0 1 0 −sin θy 0 cos θy Rz (θz ) = cos θz −sin θz 0 sin θz cos θz 0 0 0 1 ωx (t) ⋅ Δt ωy (t) ⋅ Δt θx (t) = θy (t) = θz (t) = ωz (t) ⋅ Δt θx θy θz 1 0 0 0 cos θx −sin θx 0 sin θx cos θx
  32. ڑ཭ܭଌํ๏      ⃗ aworld (t) R(t)

    ⋅ ⃗ adevice (t)  R(t + Δt) R(t) ⋅ cos θz (t) −sin θz (t) 0 sin θz (t) cos θz (t) 0 0 0 1 cos θy (t) 0 sin θy (t) 0 1 0 −sin θy (t) 0 cos θy (t) 1 0 0 0 cos θx (t) −sin θx (t) 0 sin θx (t) cos θx (t) θx θx θx θx θy θy θy θy θz θz θz θz
  33.     ⃗ aworld (t) R(t) ⋅ ⃗

    adevice (t)      ⃗ v(t + Δt) = ⃗ v(t) ⃗ aworld (t) ⋅ Δt ڑ཭ܭଌํ๏  ⃗ aworld (t)
  34.     ⃗ aworld (t) R(t) ⋅ ⃗

    adevice (t) ڑ཭ܭଌํ๏       ⃗ v(t + Δt) = ⃗ v(t) ⃗ aworld (t) ⋅ Δt ⃗ aworld (t)     ⃗ d(t + Δt) = ⃗ d(t) ⃗ v(t) ⋅ Δt ⃗ d(t)
  35. ڑ཭ܭଌํ๏  D(t) = dx (t)2 + dy (t)2 +

    dz (t)2 dx (t) dy (t) dz (t)
  36. σʔλ࠶ܭଌ "DDFMFSPNFUFSՃ଎౓ܭ EFWJDFNPUJPO  (ZSPTDPQFδϟΠϩείʔϓ EFWJDFNPUJPO <U> ੩ࢭ࣌ J1IPOFը໘্޲͖ <SBET>

    <U> <(>        "DDFMFSBUJPO9 "DDFMFSBUJPO: "DDFMFSBUJPO;         3PUBUJPO3BUF9 3PUBUJPO3BUF: 3PUBUJPO3BUF;
  37. ޡࠩิਖ਼ ΩϟϦϒϨʔγϣϯ "DDFMFSPNFUFSՃ଎౓ܭ EFWJDFNPUJPO  (ZSPTDPQFδϟΠϩείʔϓ EFWJDFNPUJPO <U> ੩ࢭ࣌ J1IPOFը໘্޲͖

    <SBET> <U> <(>        "DDFMFSBUJPO9 "DDFMFSBUJPO: "DDFMFSBUJPO;         3PUBUJPO3BUF9 3PUBUJPO3BUF: 3PUBUJPO3BUF;
  38. ·ͱΊ w J1IPOFͰ࢖͑Δηϯαʔ͍Ζ͍Ζ w υΩϡϝϯτ͸͔ͬ͠Γಡ΋͏ʂ w ཧ࿦্͸Ճ଎౓ͱ֯଎౓͚ͩͰҐஔ ڑ཭ ܭଌͰ͖Δ w

    ޡࠩ͸͍Ζ͍Ζ w ޡࠩͷิਖ਼͸͍ͩͿ໽հ w "3,JU "QQMF7JTJPO1SP͸༏ल ֎෦ηϯαʔͷิਖ਼͸ॏཁ 
  39. Aug. 23, 2024 ͠Ζ͘· @mrs1669 iOSDC 2024 Track A 15:05

    ~ 15:25 iPhoneͷ֎෦ηϯαʔΛ࢖Θͳ͍Ґஔଌఆ
 --ଌఆޡࠩΛఴ͑ͯ--