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

Synchronized iPhones!

Tachibana Kaoru
September 01, 2018

Synchronized iPhones!

iOSDC 2018

Tachibana Kaoru

September 01, 2018
Tweet

More Decks by Tachibana Kaoru

Other Decks in Technology

Transcript

  1. Synchronized iPhones!
    iOSDC 2018
    @TachibanaKaoru

    View full-size slide

  2. About Me
    @TachibanaKaoru
    Freelance iOS Engineer
    iOSDC Core Staff (Track A)
    ϘϧμϦϯά޷͖
    ࠓ೥ͷςʔϚɿཱྀΛ͠ͳ͕Β࢓ࣄΛ͢Δ
    όϦౡɺαϯτϦʔχౡɺόϯίΫɺϑΟϯϥϯυɺϊϧ΢Σʔ
    ͱ͖Ͳ͖φΨϊ 2018 ࢀՃத

    View full-size slide

  3. ࠓ೔ͷ࿩
    iOSσόΠεΛSyncͯ͠΍Γ͍ͨ͜ͱ
    iOSσόΠεͷ࣌ࠁ߹Θͤ
    σόΠεؒಉظ

    View full-size slide

  4. Sync ͯ͠΍Γ͍ͨ͜ͱ

    View full-size slide

  5. t
    deviceA
    deviceB
    deviceC
    deviceD

    View full-size slide

  6. Syncͱ͸
    iOS୺຤ͷϦϑϨογϡϨʔτʹ͋Θͤͯಉ͡ը໘Λදࣔ͢Δɻ
    ୺຤ؒͷදࣔ࣌ؒʹޡ͕ࠩ͋Δ৔߹ɺϦϑϨογϡϨʔτͷߋ৽ִؒҎ
    Լɻ
    ୺຤͝ͱʹϦϑϨογϡϨʔτ͕ҟͳΔ৔߹ʹ͸ɺ࠷΋ૣ͍୺຤ʹ͋Θ
    ͤΔɻ

    View full-size slide

  7. Syncͱ͸
    iOS୺຤Ͱ࠷΋ૣ͍ϦϑϨογϡϨʔτ͸60fps
    ϦϑϨογϡϨʔτͷߋ৽ִؒ͸1/60 = 16.66 msec

    View full-size slide

  8. ϦϑϨογϡϨʔτʹ͋Θͤͨඳը
    CADisplayLinkΛ࢖͑͹ɺϦϑϨογϡϨʔτʹ͋Θͤͯඳը͢Δ͜ͱ͕
    Ͱ͖Δɻ
    iOSͷϦϑϨογϡϨʔτ͸جຊతʹ͸60͕ͩɺ༷ʑͳঢ়گʹΑͬͯ΋ม
    Խ͢Δɻ
    σόΠεͷछྨ΍iOS versionɺforeground/backgroundͰಈ࡞͍ͯ͠Δϓ
    ϩηεʹґଘɻ

    View full-size slide

  9. How to use CADisplayLink
    let displaylink = CADisplayLink(target: self,
    selector: #selector(drawSomething))
    displaylink?.add(to: .current,
    forMode: RunLoop.Mode.default)

    View full-size slide

  10. Ͳ͏΍ͬͨΒ୺຤ؒͷޡࠩΛ16.66 msec
    ҎԼʹͰ͖Δʁ

    View full-size slide

  11. ·ͣ͸iPhoneͷγεςϜ࣌ؒΛ
    ͋ΘͤͯΈΔ

    View full-size slide

  12. ͯ͞ɻ͜͜ͰɺiPhone͸Ͳ͏΍ͬͯ࣌
    ؒΛ͋Θ͍ͤͯΔͷ͔Λ෮श͠·͢ɻ

    View full-size slide

  13. ձ৔ͷΈͳ͞Μʹ࣭໰Ͱ͢ɻ

    View full-size slide

  14. iOSσόΠε͸Ͳ͏΍ͬͯ࣌ࠁΛ͋Θ
    ͍ͤͯΔͷͰ͠ΐ͏ʁ

    View full-size slide

  15. iOS୺຤ͷ࣌ࠁ͋Θͤ
    ʢෳ਺ճ౴Մʣ
    1. ࣌ใ༻ͷి೾Λ͔͍ͭͬͯΔ
    2. Πϯλʔωοτ্ͷ࣌ࠁαʔόʔʹΞΫηε͍ͯ͠Δ
    3. GPS৴߸ʹؚ·Εͨ࣌ࠁΛར༻͍ͯ͠Δ
    4. ܞଳి࿩ճઢ͔ΒऔಘͰ͖Δ࣌ࠁΛར༻͍ͯ͠Δ

    View full-size slide

  16. ࣌ใ༻ͷి೾Λ
    ͔͍ͭͬͯΔ

    View full-size slide

  17. Πϯλʔωοτ্
    ͷ࣌ࠁαʔόʔʹ
    ΞΫηε͍ͯ͠Δ

    View full-size slide

  18. GPS৴߸ʹؚ·Εͨ
    ࣌ࠁΛར༻͍ͯ͠Δ

    View full-size slide

  19. ܞଳి࿩ճઢ͔
    ΒऔಘͰ͖Δ࣌
    ࠁΛར༻͍ͯ͠Δ

    View full-size slide

  20. iOS୺຤ͷ࣌ࠁ͋Θͤ
    ʢෳ਺ճ౴Մʣ
    1. ࣌ใ༻ͷి೾Λ͔͍ͭͬͯΔ
    2. Πϯλʔωοτ্ͷ࣌ࠁαʔόʔʹΞΫηε͍ͯ͠Δ
    3. GPS৴߸ʹؚ·Εͨ࣌ࠁΛར༻͍ͯ͠Δ
    4. ܞଳి࿩ճઢ͔ΒऔಘͰ͖Δ࣌ࠁΛར༻͍ͯ͠Δ

    View full-size slide

  21. iOS୺຤ͷ࣌ࠁ͋Θͤ
    1. ࣌ใ༻ͷి೾Λ͔͍ͭͬͯΔ
    2. Πϯλʔωοτ্ͷ࣌ࠁαʔόʔʹΞΫηε͍ͯ͠Δ
    3. GPS৴߸ʹؚ·Εͨ࣌ࠁΛར༻͍ͯ͠Δ
    4. ܞଳి࿩ճઢ͔ΒऔಘͰ͖Δ࣌ࠁΛར༻͍ͯ͠Δ

    View full-size slide

  22. iOS୺຤ͷ࣌ࠁ͋Θͤ
    1. ࣌ใ༻ͷి೾ ඪ४ి೾
    2. Πϯλʔωοτ্ͷ࣌ࠁαʔόʔʹΞΫηε NTP
    3. GPS৴߸ʹؚ·Εͨ࣌ࠁ GPS
    4. ܞଳి࿩ճઢ͔ΒऔಘͰ͖Δ࣌ࠁ NITZ

    View full-size slide

  23. iOS୺຤ͷ࣌ࠁ͋Θͤ
    NITZ GPS NTP
    iPhone ○ ○ ○
    iPad (with Mobile) ○ ○ ○
    iPad (without Mobile) × ○ ○
    iPod touch × × ○

    View full-size slide

  24. iOS୺຤ͷ࣌ࠁ͋Θͤ
    Ͳͷ୺຤ͰͲͷํࣜΛ༏ઌ͍ͯ͠Δ͔͸ެද͞Ε͍ͯͳ͍ɻ
    ड৴࣌ͷਫ਼౓ʹΑͬͯ࠾༻ɾෆ࠾༻Λม͍͑ͯΔՄೳੑ΋͋Δɻ

    View full-size slide

  25. ඪ४ి೾
    ৘ใ௨৴ݚڀػߏʢNICTʣͰӡ༻͍ͯ͠Δ࣌ใ༻ͷి೾
    ͍ΘΏΔి೾࣌ܭͰ࢖ΘΕ͍ͯΔ࢓૊Έ
    ೔ຊࠃ಺޲͚
    ࣌ࠁ͸UTCͰૹ৴͞ΕΔ

    View full-size slide

  26. NTP
    Network্ͷ NTPαʔόʔʢ࣌ࠁαʔόʔʣʹ઀ଓͯ࣌͠ࠁΛઃఆ͢Δɻ
    UTC͕഑৴͞ΕΔ
    Mac OSͰ͸ɺσϑΥϧτNTP ͸ time.asia.apple.com ʢมߋՄʣ
    iosͰ͸ɺσϑΥϧτNTP͸มߋෆՄ

    View full-size slide

  27. GPS
    ΞϝϦΧ͕؅ཧ͢ΔӴ੕Λ࢖ͬͨଌҐγεςϜ
    ੈքதͰ࢖༻Մೳ
    GPS time͕ૹ৴͞ΕΔ
    ࣌ࠁਫ਼౓͸ඇৗʹߴ͍͕ɺਖ਼͘͠ܭࢉ͢ΔͨΊʹ͸GPSӴ੕4ͭͷ৴߸Λ
    ड৴͢Δඞཁ͕͋Δ

    View full-size slide

  28. NITZ
    Network Identity and Time Zone
    ௨৴ΩϟϦΞ͔Β഑৴͞ΕΔ࣌ࠁ
    ରԠͨ͠ΩϟϦΞͰͷΈ࢖༻Մೳ
    ਫ਼౓͸ͦΕͧΕͷࣄۀऀʹΑΔ
    UTCϕʔεͷLocal TimeɺTime Zone͕ૹ৴͞ΕΔ

    View full-size slide

  29. ࣌ࠁ߹Θͤͷํ๏
    औಘํ๏ Time
    ඪ४ి೾ ి೾ UTC
    NTP Πϯλʔωοτճઢ UTC
    GPS ి೾ GPS Time
    NITZ ܞଳి࿩ճઢ
    Local Time
    (on UTC)

    View full-size slide

  30. …What is UTC/GPS Time?

    View full-size slide

  31. JST, UTC, TAI
    http://www.nict.go.jp/JST/JST5.html
    JST 13:02:45
    UTC 04:02:45
    TAI 04:03:22
    9:00:00
    0:00:37
    TimeZone
    ???

    View full-size slide

  32. What is TAI?
    TAI : Temps Atomique International ʢϑϥϯεޠʣɺࠃࡍݪࢠ࣌
    Le TAI est une échelle de temps-coordonnée définie dans un repère de référence
    géocentrique avec comme unité d'échelle la seconde du SI telle qu'elle est réalisée sur
    le géoïde en rotation
    ༁ɿTAI ͸, ճస͢ΔδΦΠυ্Ͱ࣮ݱ͞ΕΔ SI ͷඵΛ໨੝Γͷ୯Ґͱͨ͠, ஍৺࠲ඪܥͰఆٛ͞ΕΔ࠲ඪ࣌ͷ໨
    ੝ΓͰ͋Δ
    ― CCDS ͷ੠໌ɺBIPM Com. Cons. Déf. Seconde, 1980, 9, S 15 ٴͼ Metrologia, 1981, 17, 70

    View full-size slide

  33. What is TAI?
    TAI ͸ɺճస͢ΔδΦΠυ্Ͱ࣮ݱ͞ΕΔ SI ͷඵΛ໨੝Γͷ୯Ґͱ͠
    ͨɺ஍৺࠲ඪܥͰఆٛ͞ΕΔ࠲ඪ࣌ͷ໨੝ΓͰ͋Δɻ
    δΦΠυͱ͸ɺ஍ٿͷฏۉւਫ໘ʹۃΊͯྑ͘Ұக͢Δ౳δΦϙςϯ
    γϟϧ໘Λݴ͏ɻʢWikipediaͷδΦΠυͷ߲໨ΑΓʣ
    ·͋ɺʮ͍͍ͩͨւਫ໘্ʯͱͱΒ͍͑ͯͩ͘͞ɻ

    View full-size slide

  34. ͳͥʮδΦΠυʯ্ͳͷ͔
    Ұൠ૬ରੑཧ࿦ͷӨڹͰɺॏྗ৔ͷڧ͞
    ʹΑͬͯɺ࣌ؒͷྲྀΕ͕ӨڹΛ͏͚Δ͔
    ΒͰ͢ɻ
    ඪߴ͕ߴ͘ͳΕ͹ͳΔ΄Ͳɺॏྗ͸ऑ͘
    ͳΓɺ࣌ؒ͸ૣ͘ਐΈ·͢ɻ
    Slow
    Fast

    View full-size slide

  35. What is TAI?
    TAI ͸ɺճస͢ΔδΦΠυ্Ͱ࣮ݱ͞ΕΔ SI ͷඵΛ໨੝Γͷ୯Ґͱ͠
    ͨɺ஍৺࠲ඪܥͰఆٛ͞ΕΔ࠲ඪ࣌ͷ໨੝ΓͰ͋Δɻ
    SIͷඵͱ͸ɺʮηγ΢Ϝ133ݪࢠͷجఈঢ়ଶͷ2ͭͷ௒ඍࡉߏ଄४ҐʢF
    = 4, M = 0 ͓Αͼ F = 3, M = 0ʣؒͷભҠʹରԠ͢Δ์ࣹͷपظͷ 9
    192 631 770 ഒͷܧଓ࣌ؒɻʯʢ1967೥੍ఆʣ
    1967೥ΑΓલ͸ɺ̍೔ͷ௕͞Λ 86400 Ͱ෼ׂͨ͠΋ͷͰͨ͠ɻ

    View full-size slide

  36. What is TAI?
    TAIͱ͸ɺఱମͷಈ͖ʢ஍ٿ΍ଠཅͳͲʣͷಈ͖Λجૅʹͨ͠Θ͚Ͱ͸ͳ
    ͘ɺʮ஍ද໘Ͱଌఆ͍ͯ͠Δʢηγ΢Ϝʣݪࢠ࣌ܭΛجຊʹͨ࣌͠ࠁܥʯ

    View full-size slide

  37. What is UTC?
    UTC : Coordinated Universal Timeɺ ڠఆੈք࣌
    ࠃࡍݪࢠ࣌ (TAI) ʹ༝དྷ͢Δݪࢠ࣌ܥͷ࣌ࠁͰɺUT1ੈք࣌ʹಉௐ͢ΔΑ
    ͏ʹௐ੔͞Εͨج४࣌ࠁΛࢦ͢ɻ
    1972೥͔Β࢖ΘΕ͍ͯΔɻ

    View full-size slide

  38. What is UTC?
    ࠃࡍݪࢠ࣌ (TAI) ʹ༝དྷ͢Δݪࢠ࣌ܥͷ࣌ࠁͰɺUT1ੈք࣌ʹಉௐ͢ΔΑ
    ͏ʹௐ੔͞Εͨج४࣌ࠁΛࢦ͢ɻ
    UTCͱTAIͷඵͷ௕͞͸ಉ͡ɻ

    View full-size slide

  39. What is UTC?
    ࠃࡍݪࢠ࣌ (TAI) ʹ༝དྷ͢Δݪࢠ࣌ܥͷ࣌ࠁͰɺUT1ੈք࣌ʹಉௐ͢ΔΑ
    ͏ʹௐ੔͞Εͨج४࣌ࠁΛࢦ͢ɻ
    UT1͸ఱମͷಈ͖͔Βܭࢉͨ࣌͠ࠁܥ

    View full-size slide

  40. What is UTC?
    ݫີͳ࣌ࠁଌఆ͕Ͱ͖ΔΑ͏ʹͳͬͯ͘Δͱɺ̍೥ͷ௕͞ɺ̍೔ͷ௕͞
    ͕ݫີʹ͸ҰఆͰ͸ͳ͍͜ͱ͕Θ͔͖ͬͯ·ͨ͠ɻ
    ͜͜Ͱ͸Θ͔Γ΍͘͢ɺ̍೔ͷ௕͕͞13 SIඵͷ೔ͱɺ16 SIඵͷ೔͕͋Δ
    ৔߹Λߟ͑ͯݟ·͠ΐ͏ɻ

    View full-size slide

  41. ఱจ͔࣌Βܭࢉͨ࣌͠ࠁ
    TAI
    UT1
    ఱจ͔࣌Βܭࢉ
    ͨ࣌͠ࠁ
    x13 x13 x13
    x13 x13 X13
    1೔ͷ௕͕͞13 SIඵͷ೔ 1೔ͷ௕͕͞13 SIඵͷ೔ 1೔ͷ௕͕͞16 SIඵͷ೔


    View full-size slide

  42. Մมඵ
    ΋͠ɺʮ̍೔ͷ௕͞ͷ86400 ෼ׂʯΛඵͰఆٛͯ͠͠·͏ͱɺ೔ʹΑͬ
    ͯ̍ඵͷ௕͕͞ҧ͖ͬͯͯ͠·͍·͢ɻ
    ͜Ε͸ɺ೔ৗੜ׆ΛૹΔ্Ͱ͸໰୊͋Γ·ͤΜ͕ɺ෺ཧ࣮ݧ΍Τϯδ
    χΞϦϯάʹ͸େ͖ͳࢧো͕Ͱ·͢ΑͶɻ

    View full-size slide

  43. ̍೔ͷ௕͞ͷมಈ
    ̍೔ΛSIඵͰදࣔͨ͠΋ͷɻ௕͍೔ͱ୹͍೔Ͱ 5msͷ͕ࠩ͋Δ͜ͱ͕Θ
    ͔Δɻ

    View full-size slide

  44. UTC
    TAI
    UT1
    UTC
    x13 x13 X13+3
    x13 x13 X13
    1೔ͷ௕͕͞13 SIඵͷ೔ 1೔ͷ௕͕͞13 SIඵͷ೔ 1೔ͷ௕͕͞16 SIඵͷ೔


    ͏Δ͏ඵ

    View full-size slide

  45. ͏Δ͏ඵ
    Leap second : ͏Δ͏ඵ
    TAIͱఱจ༝དྷͷ࣌ࠁΛ͋ΘͤΔͨΊʹUTCʹૠೖ͞ΕΔ
    UTCͷӡ༻։͔࢝Βద༻͞Εɺࠓ·Ͱ37ճ͔Βૠೖ͞Ε͍ͯΔ

    View full-size slide

  46. Leap second in iOS and macOS
    iOSͱMac OSͷ಺෦࣌ܭɺ͓ΑͼFoundationͷDateΫϥε͸Leap second
    ʹରԠ͍ͯ͠·ͤΜɻ

    View full-size slide

  47. Leap second in iOS and macOS
    લճͷ͏Δ͏ඵ͸ɺ2016/12/31 23:59:60 UTCͰͨ͠ɻ
    2016/12/31 23:59:59 UTC
    2016/12/31 23:59:60 UTC
    2017/01/01 00:00:00 UTC

    View full-size slide

  48. Leap second in iOS and macOS
    let calendar = Calendar(identifier: .gregorian)
    // 2016/12/31 23:59
    var dateComp20162332235959 = DateComponents()
    dateComp20162332235959.calendar = calendar
    dateComp20162332235959.year = 2016
    dateComp20162332235959.month = 12
    dateComp20162332235959.day = 31
    dateComp20162332235959.hour = 23
    dateComp20162332235959.minute = 59
    dateComp20162332235959.second = 59
    dateComp20162332235959.date?.timeIntervalSince1970 // => 1483196399

    View full-size slide

  49. Leap second in iOS and macOS
    let calendar = Calendar(identifier: .gregorian)
    // 2016/12/31 23:60
    var dateComp20162332235960 = DateComponents()
    dateComp20162332235960.calendar = calendar
    dateComp20162332235960.year = 2016
    dateComp20162332235960.month = 12
    dateComp20162332235960.day = 31
    dateComp20162332235960.hour = 23
    dateComp20162332235960.minute = 59
    dateComp20162332235960.second = 60
    dateComp20162332235960.date?.timeIntervalSince1970 // => 1483196400

    View full-size slide

  50. Leap second in iOS and macOS
    let calendar = Calendar(identifier: .gregorian)
    // 2017/01/01 00:00
    var dateComp20170101000000 = DateComponents()
    dateComp20170101000000.calendar = calendar
    dateComp20170101000000.year = 2017
    dateComp20170101000000.month = 1
    dateComp20170101000000.day = 1
    dateComp20170101000000.hour = 0
    dateComp20170101000000.minute = 0
    dateComp20170101000000.second = 0
    dateComp20170101000000.date?.timeIntervalSince1970 // => 1483196400

    View full-size slide

  51. Leap second in iOS and macOS
    // 2016/12/31 23:59
    dateComp20162332235959.date?.timeIntervalSince1970 // => 1483196399
    // 2016/12/31 23:60
    dateComp20162332235960.date?.timeIntervalSince1970 // => 1483196400
    // 2017/01/01 00:00
    dateComp20170101000000.date?.timeIntervalSince1970 // => 1483196400
    2016/12/31 23:60ͱ2017/01/01 00:00͸಺෦తʹ౳͍͠ɻ
    ʹɹ͏Δ͏ඵʹ͸ରԠ͍ͯ͠ͳ͍ɻ

    View full-size slide

  52. Leap second in iOS and macOS
    ݫີʹ͸ɺMac΍iPhone΍ʢͦͷଞͷଟ͘ͷσδλϧσόΠε͸ʣ͢΂ͯ
    TAIʹ༝དྷ͢Δಠࣗͷݪࢠ࣌ͷ࣌ࠁͰɺඪ४ి೾΍NTPͳͲͷ֤छٕज़ʹ
    ΑͬͯɺUTCʹಉௐ͢ΔΑ͏ʹௐ੔͞Εͨ࣌ࠁΛ͖͟ΜͰ͍ΔΘ͚Ͱ
    ͢ɻ

    View full-size slide

  53. What is GPS Time?
    http://leapsecond.com/java/gpsclock.htm
    UTC 04:02:45
    GPS 04:02:45
    TAI 04:03:22
    0:00:19 ???
    0:00:37 ͏Δ͏ඵ

    View full-size slide

  54. GPS Time
    ࠃࡍݪࢠ࣌ (TAI) ʹ༝དྷ͢Δݪࢠ࣌ܥͷ࣌ࠁͰɺ1980/1/6ʹUTCͱಉظ͠
    ͍ͯΔ࣌ࠁΛࢦ͢ɻ
    ॳͷGPSӴ੕ଧ্͕ͪ͛1978೥ɻ
    ͏Δ͏ඵͷิਖ਼͸ߦͳ͍ͬͯͳ͍ɻʢTAIͱͷࠩ͸Ұఆʣ

    View full-size slide

  55. ඵͷ௕͞ ͏Δ͏ඵิਖ਼ ӡ༻ظؒ
    TAI SIඵʢݻఆʣ ͳ͠ 1970~
    GPS Time SIඵʢݻఆʣ ͳ͠ 1980~
    UTC SIඵʢݻఆʣ ͋Γ 1972~
    چUTC มಈ ͳ͠ 1961~1971

    View full-size slide

  56. Special relativity in GPS
    −(v/c)2/2 = − 8.4 × 10−11

    View full-size slide

  57. General relativity in GPS
    ΔU/c2 = 5.27 × 10−10

    View full-size slide

  58. Relativity in GPS
    −4.45 × 10−10
    −(v/c)2/2 = − 8.4 × 10−11
    ΔU/c2 = 5.27 × 10−10

    View full-size slide

  59. ࣮ࡍͷiOS DeviceͰଌఆͯ͠ΈΔ

    View full-size slide

  60. ۀ຿ػີ
    ۀ຿ػີ
    ۀ຿ػີ

    View full-size slide

  61. iOS Systemͷ࣌ࠁ߹Θͤਫ਼౓͸ࠓճඞཁ
    ͳਫ਼౓ʹରͯ͠͸NGͰͨ͠ɻ

    View full-size slide

  62. Ͳ͏΍ͬͯSync͢Δ?

    View full-size slide

  63. Peer to Peer Time Sync on BT

    View full-size slide

  64. BTʹΑΔ৘ใڞ༗
    CoreBTͰPeripheralͱCentralؒͰදࣔ৘ใΛڞ༗͢Δɻ
    ਌ͱͳΔPeripheralʹଞͷ୺຤͕Centralͱͯ͠઀ଓɻ
    Peripheral͔Β઀ଓͨ͠Centralʹදࣔ৘ใΛૹ৴ɻ
    BTʹ͓͍ͯPeripheral-CentralؒͰૹ৴Ͱ͖Δ৘ใྔ͸গͳ͍ͨΊɺը
    ૾σʔλΛૹ৴͢ΔΘ͚Ͱ͸ͳ͘ɺ͋Β͔͡Ί୺຤಺ʹอ࣋͢Δը૾
    Λมߋ͢Δํࣜͱ͢Δɻ

    View full-size slide

  65. BTʹΑΔ৘ใڞ༗
    Peripheral͔ΒCentralʹ࣮ࡍʹૹ৴ͯ͠Έͨͱ͜Ζɺฏۉͯ͠20~40
    msecͷ஗Ԇ͕ੜ͡ɺཁٻ͞ΕΔ16.66 msecͷൣғʹ͸͓͞·Βͳ͔ͬ
    ͨɻ

    View full-size slide

  66. t
    Peripheral
    Central 1
    Central 2
    Central 3
    20~40 msec

    View full-size slide

  67. ௨৴࣌ͷ஗ԆΛফڈ͢Δ
    BT௨৴ʹ͔͔Δॲཧ࣌ؒ
    ୺຤಺ͷॲཧ࣌ؒ + ௨৴࣌ؒ
    ௨৴࣌ؒ ∝ PeripheralͱCentralͷڑ཭

    View full-size slide

  68. ௨৴࣌ͷ஗ԆΛফڈ͢Δ
    Central
    Peripheral
    Peripheral͔ΒCentralʹTAIΛجຊͱͨ͠ಠࣗͷ࣌ࠁ
    ܥΛఆظతʹૹ৴͠ɺCentral͔Β΋Peripheralଆʹ
    ࣗσόΠεͷ࣌ࠁ஋Λૹ৴͢Δɻ

    View full-size slide

  69. ௨৴࣌ͷ஗ԆΛফڈ͢Δ
    Peripheral
    Central
    1 2 3 4 5 6
    ? ? ? ? ? ?
    1
    - -

    View full-size slide

  70. ௨৴࣌ͷ஗ԆΛফڈ͢Δ
    Peripheral
    Central
    1 2 3 4 5 6
    0.4 1.4 2.4 3.4 4.4 5.4
    1
    1
    - -

    View full-size slide

  71. ௨৴࣌ͷ஗ԆΛফڈ͢Δ
    Peripheral
    Central
    1 2 3 4 5 6
    1.4
    0.4 1.4 2.4 3.4 4.4 5.4

    View full-size slide

  72. ௨৴࣌ͷ஗ԆΛফڈ͢Δ
    Peripheral
    Central
    1 2 3 4 5 6
    1.4
    2.6
    0.4 1.4 2.4 3.4 4.4 5.4

    View full-size slide

  73. ௨৴࣌ͷ஗ԆΛফڈ͢Δ
    Peripheral
    Central
    1 2 3 4 5 6
    1.4
    2.6 3
    2.6 1.4
    0.4 1.4 2.4 3.4 4.4 5.4

    View full-size slide

  74. ௨৴࣌ͷ஗ԆΛফڈ͢Δ
    Peripheral
    Central
    1 2 3 4 5 6
    1.2
    2.6
    3
    2.6 1.4
    3 + ( 2.6 - 1.4) / 2
    = 3.6
    3.0
    0.4 1.4 2.4 3.4 4.4 5.4

    View full-size slide

  75. ௨৴࣌ͷ஗ԆΛফڈ͢Δ
    Peripheral
    Central
    1 2 3 4 5 6
    1.2
    2.6
    3.6 > 3.0
    3.0
    0.4 1.4 2.4 3.4 4.4 5.4
    3
    2.6 1.4

    View full-size slide

  76. ௨৴࣌ͷ஗ԆΛফڈ͢Δ
    Peripheral
    Central
    1 2 3 4 5 6
    1.2
    2.6
    3.6 > 3.0
    3.6
    0.4 1.4 2.4 3.4 4.4 5.4
    3
    2.6 1.4

    View full-size slide

  77. ௨৴࣌ͷ஗ԆΛফڈ͢Δ
    Peripheral
    Central
    1 2 3 4 5 6
    1.2
    2.6
    3.6 > 3.0
    3.6
    1.0 2.0 3.0 4.0 5.0 6.0
    3
    2.6 1.4

    View full-size slide

  78. ௨৴࣌ͷ஗ԆΛফڈ͢Δ
    Peripheral
    Central
    1 2 3 4 5 6
    1.2
    2.6
    3.6
    4.0
    1.0 2.0 3.0 4.0 5.0 6.0

    View full-size slide

  79. ௨৴࣌ͷ஗ԆΛফڈ͢Δ
    Peripheral
    Central
    1 2 3 4 5 6
    1.2
    2.6
    3.6
    4.0
    4.6
    1.0 2.0 3.0 4.0 5.0 6.0

    View full-size slide

  80. ௨৴࣌ͷ஗ԆΛফڈ͢Δ
    Peripheral
    Central
    1 2 3 4 5 6
    1.2
    2.6
    3.6
    4.0
    4.6
    5
    4.6 4.0
    1.0 2.0 3.0 4.0 5.0 6.0

    View full-size slide

  81. ௨৴࣌ͷ஗ԆΛফڈ͢Δ
    Peripheral
    Central
    1 2 3 4 5 6
    1.2
    2.6
    3.6
    4.0
    4.6
    5 + (4.6 - 4.0) / 2
    = 5.3
    5.6
    1.0 2.0 3.0 4.0 5.0 6.0
    5
    4.6 4.0

    View full-size slide

  82. ௨৴࣌ͷ஗ԆΛফڈ͢Δ
    Peripheral
    Central
    1 2 3 4 5 6
    1.2
    2.6
    3.6
    4.0
    4.6
    5.3 < 5.6
    5.6
    1.0 2.0 3.0 4.0 5.0 6.0
    5
    4.6 4.0

    View full-size slide

  83. ௨৴࣌ͷ஗ԆΛফڈ͢Δ
    Centralଆ͔ΒPeripheralʹࣗσόΠεͷ࣌ࠁΛૹ৴͠ɺPeripheralଆ͔Β͸
    ͦͷࠩΛৗʹCentralଆʹૹ৴͢ΔΑ͏ʹઃఆɻ
    ఆظతʹޡࠩΛૹΔ͜ͱͰɺ࣌ؒࠩΛऩଋͤ͞Δɻ
    ͜ΕʹΑΓɺPeripheral - Central ؒͷޡࠩΛ10 msecఔ౓ʹ͢Δ͜ͱ͕Մ
    ೳͱͳͬͨɻ

    View full-size slide

  84. ͔͠͠ɺ·ͨผͷ੍ݶ͕……

    View full-size slide

  85. ઀ଓτϥϒϧ
    1୆ͷPeripheralʹରͯ͠ɺ4୆ͷCentral·
    Ͱ͸઀ଓ͢Δ͜ͱ͕Ͱ͖͕ͨɺ5୆໨ͷ
    CentralΛ઀ଓ͢Δ͜ͱ͕Ͱ͖ͳ͔ͬͨɻ

    View full-size slide

  86. Appleʹ໰͍߹Θͤ
    1୆ͷPeripheralʹ઀ଓͰ͖ΔCentral਺͸ɺ࢓্༷͸੍ݶ͕ͳ͍͕࣮ӡ༻
    ্͸౰વ੍ݶ͕͋Δɻ
    ͦͷ઀ଓ୆਺͸ɺσόΠεͷεϖοΫ΍؀ڥʹΑܾͬͯ·ΓɺҰҙʹఆ
    ٛ͢Δ͜ͱ͸Ͱ͖ͳ͍ɻ

    View full-size slide

  87. Single Layer Structure

    View full-size slide

  88. MultiLayer Structure

    View full-size slide

  89. Multilayer Structure
    ͜ΕͰ10୆ఔ౓ͷSync͸Մೳͱͳͬͨɻ
    ͨͩ͠ɺPeripheralͱCentralΛ͔Ͷͨ୺຤ͷ઀ଓ͕ෆ҆ఆɻ
    Centralଆ͔ΒPeripheralͷ઀ଓ͕੒ޭ͢Δ͕ɺҰఆ࣌ؒʢ਺ඵʙॏ਺
    ඵʣͨͭͱࣗવʹdisconnect͢Δ৔߹͕͋Δɻ

    View full-size slide

  90. ·ͱΊ
    BT૬ޓ௨৴Ͱ࣌ࠁࠩΛऩଋͤ͞Δ࢓૊ΈʹΑΓɺ୺຤ؒͷ࣌ࠁࠩΛ10
    msecఔ౓·Ͱʹ͢Δ͜ͱ͕Ͱ͖ͨɻ
    MultiLayer StructureΛͱΔ͜ͱʹΑΓɺBTͷ઀ଓ੍ݶ਺Λ௒͑ͨଟ਺ͷ
    ୺຤ؒͰͷSync΁ͷՄೳੑ͸ײ͡Δɻ
    ͨͩ҆ఆ౓ʹ໰୊͕͋Γɺݱঢ়Ͱ͸100୆ͷ୺຤ʹΑΔSync͸ԕ͍ɻ

    View full-size slide

  91. References
    •ը૾
    ͍Β͢ͱ΍
    https://www.irasutoya.com/
    •GPSͷ૬ର࿦ิਖ਼ʹ͍ͭͯ
    GPS ͱ෺ཧʢ໺ଜ ਗ਼ӳʣ
    http://maya.phys.kyushu-u.ac.jp/~knomura/museum/GPS/node11.html

    View full-size slide