$30 off During Our Annual Pro Sale. View Details »

HoloLensでドローンを遠隔操作してみた

gaomar
December 07, 2017

 HoloLensでドローンを遠隔操作してみた

HoloLensでドローンを遠隔操作してみた

gaomar

December 07, 2017
Tweet

More Decks by gaomar

Other Decks in Technology

Transcript

  1. ࣗݾ঺հ ॴଐɿגࣜձࣾΞΠΤϯλʔ ɹɹɹ3%ɹ೥ೖࣾ ۀ຿ɿ)PMP-FOTݚڀ։ൃ ɹɹɹυϩʔϯɺ.3ɺ73ݚڀ ߴഅɹ޺య !HBPNBS

  2. ࠷ۙ΍ͬͨϗϩ׆ wɹϩϘοτετϦʔτग़ల wɹ෱ԬͰ)PMP-FOTʹؔ͢Δొஃ wɹകΩϟϯ*P5ొஃ wɹ+BQBO93'FTUWPMग़ల

  3. ࡶஊ (PPHMF)PNFങ͍·ͨ͠ʂ ̎୆

  4. ࡶஊ ͕͜͜ศརͩΑ(PPHMF)PNF *'555ͱͷ࿈ܞ ϥδί͕ௌ͚Δ ੠ͰϝϞग़དྷΔ ങ͏΋ͷϦετ

  5. ࡶஊ (PPHMF)PNF࢖ͬͯ ϥΠτૢ࡞͍ͯ͠Δਓ͕͍ͨ

  6. ຊ୊

  7. ͦ͏ͩɺ)PMP-FOTͰ υϩʔϯΛૢ࡞͠Α͏

  8. ࠓճ࢖༻ͨ͠υϩʔϯ 1BSSPUࣾ.".#0

  9. ͜Μͳײ͡

  10. 3BTQCFSSZ1JʹOPEFSPMMJOHTQJEFSͷ ϞδϡʔϧΛೖΕΔ $npm install rolling-spider --save

  11. υϩʔϯίϚϯυྫ // ཭཮ drone.takeOff(); // ண཮ drone.land(); // ্ঢ ※stepsͷ஋͸޷͖ʹม͍͑ͯͩ͘͞ɻ਺ࣈ

    ͕ଟ͍ͱ୔ࢁҠಈ͠·͢ drone.up( {steps: 10}); // Լ߱ drone.down( {steps: 10} ); // ӈટճ drone.clockwise( {steps: 10} ); // ࠨટճ drone.counterClockwise( {steps: 10} ); // ӈҠಈ drone.right( {steps: 10} ); // ࠨҠಈ drone.left( {steps: 10} ); // ஦ฦΓ drone.backFlip();
  12. ৄࡉ͸ͪ͜ΒͷHJUIVC΁ IUUQTHJUIVCDPNWPPEPPUJLJHPEOPEFSPMMJOHTQJEFS

  13. 'JSFCBTFͷϞδϡʔϧΛೖΕΔ $npm install firebase --save

  14. )PMP-FOT͔Β'JSFCBTFʹ 8FC)PPLͰߋ৽͢Δ

  15. public class TouchAction : MonoBehaviour, IInputClickHandler { string fb_url =

    “https://xxxxxxxx.firebaseio.com/xxxxxxxxxx/word.json”; public void OnInputClicked(InputClickedEventData eventData) { StartCoroutine(Put(fb_url, “\"཭ண཮\"")); } public IEnumerator Put(string url, string jsonStr) { var request = new UnityWebRequest(); request.url = url; byte[] body = Encoding.UTF8.GetBytes(jsonStr); request.uploadHandler = new UploadHandlerRaw(body); request.downloadHandler = new DownloadHandlerBuffer(); request.SetRequestHeader("Content-Type", "application/json; charset=UTF-8"); request.method = UnityWebRequest.kHttpVerbPUT; yield return request.Send(); if (!request.isNetworkError) { if (request.responseCode == 200) { Debug.Log("success"); Debug.Log(request.downloadHandler.text); } else { Debug.Log("failed"); } } } }
  16. 'JSFCBTF͕ߋ৽͞ΕΔͱ /PEFKTʹߋ৽ͨ͠৘ใ͕དྷΔ

  17. ߋ৽৘ใ͕དྷͨΒରԠͨ͠ίϚϯυΛ࣮ߦ db.ref("/drone").on("value", function(changedSnapshot) { //஋औಘ var value = changedSnapshot.child("word").val(); if

    (value) { if (value.split(" ")[0] == '཭ண཮') { if (!drone.status.flying) { drone.takeOff(); } else { drone.land(); }
  18. IUUQTZPVUVCFZ$.$H5UL σϞಈը

  19. ଞͷਓ͔ΒݟΔͱ ·ΔͰຐ๏Λ࢖͍ͬͯΔΈ͍ͨ

  20. 'JSFCBTFʹߋ৽͢ΔͷͰ ֎ग़ઌͰ΋υϩʔϯૢ࡞͕Մೳ

  21. )PMP-FOTY*P5 ৄࡉ͸2JJUBʹهड़ͯ͋͠Γ·͢ IUUQTRJJUBDPNIUBLBVNBJUFNTFBGFBBECEC

  22. ͓·͚

  23. IUUQTZPVUVCF-2-8.F$P6 σϞಈը

  24. (PPHMF)PNFY*P5 ৄࡉ͸2JJUBʹهड़ͯ͋͠Γ·͢ IUUQTRJJUBDPNIUBLBVNBJUFNTCGDCFD

  25. ࣮ԋ

  26. Ұॹʹ)PMP-FOT࢖ͬͯԿ͔΍Γ·ͤΜ͔ʁ ݱࡏύʔτφʔืूதͰ͢ʂ

  27. ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠