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

どうしてもPerlでドローンを飛ばしたい人のためのハードウェアハック概論

mackee
August 21, 2015

 どうしてもPerlでドローンを飛ばしたい人のためのハードウェアハック概論

マコピー a.k.a mackee_w
面白法人カヤック

YAPC::Asia 2015
2015-08-21 #yapcasiaC

mackee

August 21, 2015
Tweet

More Decks by mackee

Other Decks in Programming

Transcript

  1. PR

  2. ͜Μͳײ͡ use Device::MultiWii; my $port = "/dev/tty.usbserial"; my $mw =

    Device::MultiWii->new(port => $port); is exception { $mw->open }, undef; my $ident = $mw->fetch_ident; cmp_deeply $ident, { version => 230, multitype => 3, capability => ignore(), };
  3. ͜Μͳײ͡ my $rc = $mw->fetch_rc; cmp_deeply $rc, { yaw =>

    1500, pitch => 1500, roll => 1500, throttole => 1500, auxs => ignore(), }; $rc->{yaw} = 1400; ok $mw->set_raw_rc(%$rc); $refetched_rc = $mw->fetch_rc; cmp_deeply $refetched_rc, { yaw => 1400, pitch => 1500, roll => 1500, throttole => 1500, auxs => ignore(), };
  4. ֘౰෦෼ͷίʔυ if (chan<8 && rcSerialCount > 0) { rcSerialCount --;

    #if defined(FAILSAFE) failsafeCnt = 0; #endif if (rcSerial[chan] >900) { rcData[chan] = rcSerial[chan]; } }
  5. ͜͏ม͑ͨίʔυ if ( chan<8 && (rcData4Values[AUX1][rc4ValuesIndex] > 1800 || rcSerialCount

    > 0)) { rcSerialCount --; #if defined(FAILSAFE) failsafeCnt = 0; #endif if (rcSerial[chan] >900 && (chan == ROLL || chan == PITCH || chan == THROTTLE || chan == YAW)) { rcData[chan] = rcSerial[chan]; } }
  6. Intel Edison • 500MHz Atom σϡΞϧίΞ (x86ͩʂʂʂʂ) • ϔϦ੎ͱͯ͠͸7V -

    15Vͷిݯ͕৯͑ΔͷͰ3 ηϧLiPo12V͕ͦͷ··৯͑Δͷ͕͏Ε͍͠ • RasPiʹ͍͍ͭͯͳ͍WiFi ͱ BT ͕͋Δ
  7. Intel Edison meets MultiWii • Edison͸UARTΛ2ܥ౷͍࣋ͬͯΔ͕Ϩϕϧม׵͕ ඞཁ(1.8V IO)ͳͷͰOTGέʔϒϧͰUSB-UARTม ׵Λհͯ͠઀ଓɻϋϯμ෇͚ෆཁͩʂ •

    Breakout boardఈ໘ʹ2.54mmϐονͷϗʔϧ͕ ۭ͍͍ͯΔ͕͜ͷ഑ஔͩͱϒϨουϘʔυʹͤ͞ ͳ͍ͷͰळ݄ిࢠͷม׵Ϙʔυ͕࣮ݧ༻ʹ͸͓͢ ͢ΊͰ͢