Sha256: a0f301cda50ba9b1654c239c75b28610a96a788bed887156d7b71dc43f5acbba

Contents?: true

Size: 1.21 KB

Versions: 2

Compression:

Stored size: 1.21 KB

Contents

require 'artoo/adaptors/adaptor'

module Artoo
  module Adaptors
    # Connect to a ARDrone 2.0  video data stream
    # @see http://rubydoc.info/gems/hybridgroup-argus/0.2.0/Argus/TcpVideoStreamer TCP Video Streamer Documentation
    # @see http://rubydoc.info/gems/hybridgroup-argus/0.2.0/Argus/PaVEParser PaVEParser Documentation
    class ArdroneVideo < Adaptor
      attr_reader :ardrone, :video_parser

      # Creates connection to Argus TCP Video Streamer and
      # Argus PaVE Parser starting a stream with ardrone device
      # @return [Boolean]
      def connect
        require 'argus' unless defined?(Argus)
        require 'argus'
        @ardrone = Argus::VideoStreamer.new(socket: connect_to_tcp, host: port.host, post: port.port)
        @ardrone.start(connect_to_udp)
        super
      end

      # Closes ardrone connection
      # @return [Boolean]
      def disconnect
        ardrone.close
        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

2 entries across 2 versions & 1 rubygems

Version Path
artoo-ardrone-1.1.0 lib/artoo/adaptors/ardrone_video.rb
artoo-ardrone-1.0.3 lib/artoo/adaptors/ardrone_video.rb