Golang, make and robotics #gocon

Golang, make and robotics #gocon

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

B8e70282c568fd82f483a8bf854843f6?s=128

Hideyuki TAKEI

June 21, 2015
Tweet

Transcript

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

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

  3. ࣗݾ঺հ

  4. ΞδΣϯμ w ͍·झຯͰ࡞͍ͬͯΔϩϘοτͷ͝঺հ w (PͰϝδϟʔͳిࢠ޻࡞ͷπʔϧ(PCPU w "SEVJOPͱ'JSNBUB w ҙ֎ͱ໘౗ͳγϦΞϧ௨৴Ͱͷσʔλ΍ΓͱΓ w

    31$ͷඞཁੑͱH31$ w ಈ͘σϞʂ w ίʔυͷઆ໌
  5. झຯͷϩϘοτͮ͘Γ w ຍ࠿ϩϘοτΛ࡞Γ͍ͨ w ُ ২෺ w ͔Θ͍͘ಈ͔͍ͨ͠ w Ώ͘Ώ͘͸໺ʹ์͍ͪͨ

    w ໺ྑϩϘοτ
  6. 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
  7. ͍͍ͩͨࢼ࡞͸Ͱ͖ͨ

  8. w FBHMFϓϦϯτج൘ઃܭιϑτ΢ΣΞ w FMFDSPX GVTJPOQDCϓϦϯτج൘੡଄αʔϏε w *OWFOUPS%$"% w 4IBQFXBZT%ϓϦϯταʔϏε w

    "73($$CJUϚΠίϯ $ݴޠͰ։ൃ ࢼ࡞ͰΑ͘࢖͏΋ͷ
  9. w ϩϘοτΛ֎෦͔Βίϯτϩʔϧ͍ͨ͠ w ͔ͤͬ͘ͳͷͰ(PΛ࢖͓͏ ͳʹͰ੍ޚ͠Α͏

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

  11. ͍Ζ͍ΖରԠ

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

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

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

  15. "SVEJOPͱ'JSNBUB ֎෦͔Β੍ޚ͢ΔͨΊ ͷϑΝʔϜ΢ΣΞΛ ͋Β͔͡Ίॻ͖ࠐΉ w 'JSNBUBͷ৔߹ w ओମ͸1$ w 1$͕ͳ͍ͱಈ͔ͳ͍

    w ϓϩάϥϜ͸"SEVJOPʹอଘ͞Εͳ͍
  16. 'JSNBUBͷ(PPE#BE w (PPE w ௨৴ͱ͔ίϚϯυͱ͔ϝοηʔδͱ͔ ҙࣝ͢Δඞཁ͕ͳ͍ w ༷ʑͳݴޠ͔Βୟ͚Δ w #BE

    w جຊతʹ͸ϓϦϛςΟϒͳ໋ྩ͔͠ͳ͍ ͷͰɺϦΞϧλΠϜੑ͕ߴ͍΋ͷʹ͸ɹ ෆ޲͖ w ୯ಠͰ͸ಈ͔ͳ͍
  17. ΧελϜϓϩτίϧͷಓ w 6"35ʁ#-&ʁ#MVFUPPUIʁ w ͍͍ͩͨ͸6"35Ͱ0,͔ w ϚΠίϯଆʗ1$ଆͷϓϩάϥϜ΋ඞཁ w 6"35͕ͭຒ·Δ w

    QSJOUGσόοά͕͠ʹ͘͘ͳΔ w ϓϩτίϧܾΊͳ͍ͱ w ΊΜͲ͍͘͞
  18. ͦ͜Ͱ31$ w ϚΠίϯଆͷؔ਺Λίʔϧ͢Δ w ෳࡶͳૢ࡞Λͭͷؔ਺ʹ·ͱΊΔ w Yͷ-&%ϚτϦοΫεʹʮ͋ʯͱඳ͘ w ίϚϯυαʔϘෳ਺ݸͷಉ࣌Ґஔࢦఆ w

    ௨৴ܦ࿏͸6"35 w #MVFUPPUIͷ411΍64#4FSJBM͕࢖͑Δ w ͳʹ͔ྑ͍31$ͳ͍͔ʜ
  19. ϩϘοτ 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#
  20. าߦσϞ  (P ݸͷαʔϘϞʔλΛ ੍ޚ͠ͳ͕Β  (P า͋Δ͖·͢

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

  23. ϩϘοτ 1S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FSJBM
  27. 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$αʔόىಈ
  28. H31$ΫϥΠΞϯτ DQC/FX4PUI$MJFOU DPOO  S FSSD.PWF4FSWPT DPOUFYU#BDLHSPVOE  QC.PWF4FSWPT3FRVFTU\ 4FSWP'SPOU3JHIU1PTJUJPO

     4FSWP'SPOU-FGU1PTJUJPO  4FSWP#BDL3JHIU1PTJUJPO  4FSWP#BDL-FGU1PTJUJPO  4FSWP:BX1PTJUJPO ^
  29. (PͰָ͍͠ϩϘοτΛ ૑Γ·͠ΐ͏ʂ

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