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

Golang, make and robotics #gocon

Golang, make and robotics #gocon

gRPC(Protocol Buffers)とGoとAVRを使ったロボットの制御

Hideyuki TAKEI

June 21, 2015
Tweet

More Decks by Hideyuki TAKEI

Other Decks in Technology

Transcript

  1. (Pͱిࢠ޻࡞ͱϩϘοτ
    ͚͍ͨͻͰΏ͖
    !)JEFZVLJ5BLFJ
    +VO (P$POGFSFODF

    View full-size slide

  2. ࣗݾ঺հ
    w )8ճ࿏ઃܭɺϚΠίϯɺ֎૷ઃܭɺதࠃ
    w 48ϑϩϯτΤϯυ+4ɺ"OESPJEɺ"84
    w ͔Θ͍͍ϩϘοτ͕޷͖

    View full-size slide

  3. ΞδΣϯμ
    w ͍·झຯͰ࡞͍ͬͯΔϩϘοτͷ͝঺հ
    w (PͰϝδϟʔͳిࢠ޻࡞ͷπʔϧ(PCPU
    w "SEVJOPͱ'JSNBUB
    w ҙ֎ͱ໘౗ͳγϦΞϧ௨৴Ͱͷσʔλ΍ΓͱΓ
    w 31$ͷඞཁੑͱH31$
    w ಈ͘σϞʂ
    w ίʔυͷઆ໌

    View full-size slide

  4. झຯͷϩϘοτͮ͘Γ
    w ຍ࠿ϩϘοτΛ࡞Γ͍ͨ
    w ُ২෺
    w ͔Θ͍͘ಈ͔͍ͨ͠
    w Ώ͘Ώ͘͸໺ʹ์͍ͪͨ
    w ໺ྑϩϘοτ

    View full-size slide

  5. 4FSWP.PUPS
    34.%
    'SPOU3JHIU
    4FSWP.PUPS
    34.%
    'SPOU-FGU
    4FSWP.PUPS
    34.%
    #BDL3JHIU
    4FSWP.PUPS
    34.%
    #BDL-FGU
    4FSWP.PUPS
    34.%
    :BX
    4FSWP.PUPS
    34.%
    5BJM
    64"35
    &ZF-&%
    4PMBS
    $FMM
    *$
    "73
    "59.&("%
    18.
    1SFTTVSF4FOTPS
    5FNQFSBUVSF
    )VNJEJUZ4FOTPS
    "YJT4FOTPST
    "DD (ZSP
    (14-47
    &OFSHZ
    )BSWFTUJOH
    ߏ੒
    64"35

    View full-size slide

  6. ͍͍ͩͨࢼ࡞͸Ͱ͖ͨ

    View full-size slide

  7. w FBHMFϓϦϯτج൘ઃܭιϑτ΢ΣΞ
    w FMFDSPX GVTJPOQDCϓϦϯτج൘੡଄αʔϏε
    w *OWFOUPS%$"%
    w 4IBQFXBZT%ϓϦϯταʔϏε
    w "73($$CJUϚΠίϯ $ݴޠͰ։ൃ

    ࢼ࡞ͰΑ͘࢖͏΋ͷ

    View full-size slide

  8. w ϩϘοτΛ֎෦͔Βίϯτϩʔϧ͍ͨ͠
    w ͔ͤͬ͘ͳͷͰ(PΛ࢖͓͏
    ͳʹͰ੍ޚ͠Α͏

    View full-size slide

  9. (PͰిࢠճ࿏ͷఆ൪ʁ

    View full-size slide

  10. ͍Ζ͍ΖରԠ

    View full-size slide

  11. (PCPU3BTQCFSSZ1J
    (Pͷίʔυ
    XJUI(PCPU
    3BTQCJBO
    (1*0 *$
    w 3BTQCFSSZ1J্Ͱ(Pͷίʔυ͕ಈ͘
    w ௚઀(1*0΍*$Λୟ͘͜ͱ͕Ͱ͖Δʂ

    View full-size slide

  12. (PCPU"SEVJOP
    (Pͷίʔυ
    XJUI(PCPU 'JSNBUB
    64#4FSJBM
    w 1$͔Β"SEVJOPΛૢ࡞͢Δ
    w "SEVJOP্ʹϓϩάϥϜΛసૹ͠ͳ͍

    View full-size slide

  13. "SVEJOPͱ'JSNBUB
    ౎౓ϑΝʔϜ΢ΣΞΛ
    64#ܦ༝Ͱॻ͖ࠐΉ
    w "SEVJOPͷ৔߹
    w ॻ͖ࠐΜͩޙ͸έʔϒϧ֎ͯ͠0,
    w ిݯஅͯ͠΋ϑΝʔϜ΢ΣΞ͸อଘ͞ΕͯΔ

    View full-size slide

  14. "SVEJOPͱ'JSNBUB
    ֎෦͔Β੍ޚ͢ΔͨΊ
    ͷϑΝʔϜ΢ΣΞΛ
    ͋Β͔͡Ίॻ͖ࠐΉ
    w 'JSNBUBͷ৔߹
    w ओମ͸1$
    w 1$͕ͳ͍ͱಈ͔ͳ͍
    w ϓϩάϥϜ͸"SEVJOPʹอଘ͞Εͳ͍

    View full-size slide

  15. 'JSNBUBͷ(PPE#BE
    w (PPE
    w ௨৴ͱ͔ίϚϯυͱ͔ϝοηʔδͱ͔
    ҙࣝ͢Δඞཁ͕ͳ͍
    w ༷ʑͳݴޠ͔Βୟ͚Δ
    w #BE
    w جຊతʹ͸ϓϦϛςΟϒͳ໋ྩ͔͠ͳ͍
    ͷͰɺϦΞϧλΠϜੑ͕ߴ͍΋ͷʹ͸ɹ
    ෆ޲͖
    w ୯ಠͰ͸ಈ͔ͳ͍

    View full-size slide

  16. ΧελϜϓϩτίϧͷಓ
    w 6"35ʁ#-&ʁ#MVFUPPUIʁ
    w ͍͍ͩͨ͸6"35Ͱ0,͔
    w ϚΠίϯଆʗ1$ଆͷϓϩάϥϜ΋ඞཁ
    w 6"35͕ͭຒ·Δ
    w QSJOUGσόοά͕͠ʹ͘͘ͳΔ
    w ϓϩτίϧܾΊͳ͍ͱ
    w ΊΜͲ͍͘͞

    View full-size slide

  17. ͦ͜Ͱ31$
    w ϚΠίϯଆͷؔ਺Λίʔϧ͢Δ
    w ෳࡶͳૢ࡞Λͭͷؔ਺ʹ·ͱΊΔ
    w Yͷ-&%ϚτϦοΫεʹʮ͋ʯͱඳ͘
    w ίϚϯυαʔϘෳ਺ݸͷಉ࣌Ґஔࢦఆ
    w ௨৴ܦ࿏͸6"35
    w #MVFUPPUIͷ411΍64#4FSJBM͕࢖͑Δ
    w ͳʹ͔ྑ͍31$ͳ͍͔ʜ

    View full-size slide

  18. ϩϘοτ 1$
    ͦ͜ͰʂH31$ʂ
    w γϦΞϥΠζ͸1SPUPDPM#V⒎FST
    w *%-Ͱϝοηʔδ΍31$ͷߏ଄Λఆٛ
    w QSPUPDͰιʔείʔυ΋ੜ੒͞ΕΔ
    w ਖ਼֬ʹ͸H31$64#4FSJBMήʔτ΢ΣΠ
    w Α͠ɺ͜ͷήʔτ΢ΣΠΛ(PͰॻ͜͏ʂ
    w σʔλܗࣜ͸"73·Ͱ1SPUPDPM#V⒎FSͰʂ
    "73
    ϚΠίϯ

    H31$αʔό (P

    4FSJBM
    H31$
    ΫϥΠΞϯτ
    64#

    View full-size slide

  19. าߦσϞ
    (P
    ݸͷαʔϘϞʔλΛ
    ੍ޚ͠ͳ͕Β
    (P
    า͋Δ͖·͢

    View full-size slide

  20. าߦͷσϞ
    ຍ࠿Λ݄ࠒʹௐୡ͠·ͨ͠
    ͕
    ݄ʹރΕͯ͠·͍·ͨ͠ʜ
    ݩؾͩͬͨࠒͷຍ࠿

    View full-size slide

  21. ϩϘοτ
    1SPUPDPM#V⒎FSTΛ"73Ͱ
    w OBOPQC
    w IUUQLPUJLBQTJpKQBOBOPQC
    w ૊ΈࠐΈ޲͚1SPUPDPM#V⒎FSͷ$࣮૷
    w ࠷௿ݶͷػೳͷΈ࣮૷
    w L#30. L#3".͕λʔήοτ
    w ࠓճͷϚΠίϯ͸L#30.ɺL#3".
    "73
    ϚΠίϯ

    H31$αʔό (P

    4FSJBM
    H31$
    ΫϥΠΞϯτ
    64# NPWF4FSWPT
    NPWF4FSWPT
    1$

    View full-size slide

  22. SPCPUQSPUP *%-

    TZOUBYQSPUP
    QBDLBHFSPCPU
    TFSWJDF4PUI\
    SQDNPWF4FSWPT .PWF4FSWPT3FRVFTU
    SFUVSOT .PWF4FSWPT3FTQPOTF
    \^
    ^
    NFTTBHF.PWF4FSWPT3FRVFTU\
    JOUTFSWP@GSPOU@SJHIU@QPTJUJPO
    JOUTFSWP@GSPOU@MFGU@QPTJUJPO
    JOUTFSWP@CBDL@SJHIU@QPTJUJPO
    JOUTFSWP@CBDL@MFGU@QPTJUJPO
    JOUTFSWP@ZBX@QPTJUJPO
    ^
    NFTTBHF.PWF4FSWPT3FTQPOTF\
    ^

    View full-size slide

  23. ϩϘοτ 1$
    *%-ͷίϯύΠϧ
    QSPUPDHP@PVUSPCPUQSPUP
    QSQUQDOBOPQC@PVUSPCPUQSPUP
    ͜ΕͰɺHPͱDͷίʔυ͕ग़ͯ͘Δ
    "73
    ϚΠίϯ

    H31$αʔό (P

    4FSJBM
    H31$
    ΫϥΠΞϯτ
    64#
    SPCPUQCHP
    NPWF4FSWPT
    NPWF4FSWPT
    SPCPUQCI
    SPCPUQCD

    View full-size slide

  24. H31$αʔό
    UZQFTFSWFSTUSVDU\
    TTFSJBM1PSU
    NTZOD.VUFY
    ^
    GVOD TSWTFSWFS
    .PWF4FSWPT DUYDPOUFYU$POUFYU JOQC.PWF4FSWPT3FRVFTU

    QC.PWF4FSWPT3FTQPOTF FSSPS
    \
    TSWN-PDL

    EFGFSTSWN6OMPDL

    XSJUF3PCPU4FSJBM TSWT JO

    SFUVSOQC.PWF4FSWPT3FTQPOTF\^ OJM
    ^
    γϦΞϧ௨৴ϥΠϒϥϦ͸HJUIVCDPNUBSNTFSJBM

    View full-size slide

  25. H31$αʔό
    GVODNBJO
    \
    DTFSJBM$POpH\
    /BNFlEFWUUZVTCTFSJBM%+27z #BVE^
    TFSJBM FSSTFSJBM0QFO1PSU D

    JGFSSOJM\
    MPH'BUBM FSS

    ^
    MJT FSSOFU-JTUFO UDQ QPSU

    JGFSSOJM\
    MPH'BUBMG GBJMFEUPMJTUFOW FSS

    ^
    THSQD/FX4FSWFS

    QC3FHJTUFS4PUI4FSWFS T TFSWFS\TTFSJBM^

    T4FSWF MJT

    ^
    γϦΞϧ௨৴༻ॳظԽ
    H31$αʔόىಈ

    View full-size slide

  26. H31$ΫϥΠΞϯτ
    DQC/FX4PUI$MJFOU DPOO

    S FSSD.PWF4FSWPT DPOUFYU#BDLHSPVOE

    QC.PWF4FSWPT3FRVFTU\
    4FSWP'SPOU3JHIU1PTJUJPO
    4FSWP'SPOU-FGU1PTJUJPO
    4FSWP#BDL3JHIU1PTJUJPO
    4FSWP#BDL-FGU1PTJUJPO
    4FSWP:BX1PTJUJPO
    ^

    View full-size slide

  27. (PͰָ͍͠ϩϘοτΛ
    ૑Γ·͠ΐ͏ʂ

    View full-size slide

  28. DPEFMVODIGNͱ͍͏ϙουΩϟετʹ΋
    ग़ԋ͠·ͨ͠ɻௌ͍ͯΈ͍ͯͩ͘͞ʂ
    એ఻
    "OESPJEɺ3VCZ/PEFKT͕
    ಘҙͳΤϯδχΞେืूʂ
    ΋ͪΖΜ(P΋

    View full-size slide