Sha256: c5a291625fdae10abc38615ae070d41f4545c30cddb3c007d98dbf22d0eb8fb3
Contents?: true
Size: 1.17 KB
Versions: 1
Compression:
Stored size: 1.17 KB
Contents
require 'artoo/adaptors/adaptor' module Artoo module Adaptors # This class connects to a ARDrone 2.0 # @see http://rubydoc.info/gems/hybridgroup-argus/0.2.0/Argus/Drone Argus Drone Documentation class Ardrone < Adaptor finalizer :finalize attr_reader :ardrone # Finalizes connection with ARDrone by landing and stopping the device def finalize if connected? ardrone.land ardrone.stop end end # Creates Argus Drone connection with device # @return [Boolean] def connect require 'argus' unless defined?(::Argus::Drone) @ardrone = ::Argus::Drone.new(socket: connect_to_udp, host: port.host, port: port.port) super end # Disconnects device by stopping it and ending connection # @return [Boolean] def disconnect ardrone.stop super end # Calls ardrone actions using method missing # @see https://github.com/hybridgroup/argus/blob/master/lib/argus/drone.rb hybridgroup-argus Drone def method_missing(method_name, *arguments, &block) ardrone.send(method_name, *arguments, &block) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
artoo-ardrone-1.2.0 | lib/artoo/adaptors/ardrone.rb |