artoo-ardrone 1.0.0.pre

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7589a1bb3eda9a42a2379dfe8c46830598c92ce5
4
+ data.tar.gz: e828e0273005b701af96b0602d62f7c4c88c3d6b
5
+ SHA512:
6
+ metadata.gz: 5f8362773874b17b647c0f6dce83484d57014a746e5b049182c250392f9c2075d77d1551a17620148f2085b433ee4f2f8d28bab0879263e78847718a7b1aa3bb
7
+ data.tar.gz: 22ef1ee72589d71ad1dfb4e2a3ebc7d224e7d6960ae62d76a6c1ae069a9661272218970a46a6ef03b8571845c7a8e717e5b398e6a8bb5dfacba7e7458ac8925f
data/.gitignore ADDED
@@ -0,0 +1,2 @@
1
+ .rvmrc
2
+ .rbx
data/.rvmrc.example ADDED
@@ -0,0 +1 @@
1
+ rvm use rbx-2.0.0-rc1@artoo-ardrone --create
data/.travis.yml ADDED
@@ -0,0 +1,6 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ - 1.9.3
5
+ - jruby-19mode
6
+ - rbx-19mode
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in artoo-sphero.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,62 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ artoo-ardrone (1.0.0.pre)
5
+ artoo (~> 1.0.0.pre)
6
+ hybridgroup-argus (~> 0.3.0)
7
+
8
+ GEM
9
+ remote: http://rubygems.org/
10
+ specs:
11
+ artoo (1.0.0.pre)
12
+ celluloid (~> 0.14.0)
13
+ celluloid-io (~> 0.14.0)
14
+ multi_json (~> 1.6)
15
+ pry (~> 0.9)
16
+ rake (~> 10.0)
17
+ reel (~> 0.4.pre)
18
+ celluloid (0.14.0)
19
+ timers (>= 1.0.0)
20
+ celluloid-io (0.14.0)
21
+ celluloid (>= 0.13.0)
22
+ nio4r (>= 0.4.5)
23
+ certified (0.1.1)
24
+ coderay (1.0.9)
25
+ http (0.4.0)
26
+ certified
27
+ http_parser.rb
28
+ http_parser.rb (0.5.3)
29
+ hybridgroup-argus (0.3.0)
30
+ metaclass (0.0.1)
31
+ method_source (0.8.1)
32
+ minitest (5.0.1)
33
+ minitest-happy (1.0.0)
34
+ mocha (0.14.0)
35
+ metaclass (~> 0.0.1)
36
+ multi_json (1.7.3)
37
+ nio4r (0.4.5)
38
+ pry (0.9.12.2)
39
+ coderay (~> 1.0.5)
40
+ method_source (~> 0.8)
41
+ slop (~> 3.4)
42
+ rack (1.5.2)
43
+ rake (10.0.4)
44
+ reel (0.4.0.pre)
45
+ celluloid-io (>= 0.8.0)
46
+ http (>= 0.2.0)
47
+ http_parser.rb (>= 0.5.3)
48
+ rack (>= 1.4.0)
49
+ websocket_parser (>= 0.1.2)
50
+ slop (3.4.5)
51
+ timers (1.1.0)
52
+ websocket_parser (0.1.4)
53
+ http
54
+
55
+ PLATFORMS
56
+ ruby
57
+
58
+ DEPENDENCIES
59
+ artoo-ardrone!
60
+ minitest (~> 5.0)
61
+ minitest-happy
62
+ mocha (~> 0.14.0)
data/LICENSE ADDED
@@ -0,0 +1,13 @@
1
+ Copyright (c) 2012, 2013 The Hybrid Group
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
data/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # Artoo Adaptor For ARDrone
2
+
3
+ This repository contains the Artoo (http://artoo.io/) adaptor for the ARDrone 2.0 quadcopter.
4
+
5
+ Artoo is a open source micro-framework for robotics using Ruby.
6
+
7
+ For more information abut Artoo, check out our repo at https://github.com/hybridgroup/artoo
8
+
9
+ [![Code Climate](https://codeclimate.com/github/hybridgroup/artoo-ardrone.png)](https://codeclimate.com/github/hybridgroup/artoo-ardrone) [![Build Status](https://travis-ci.org/hybridgroup/artoo-ardrone.png?branch=master)](https://travis-ci.org/hybridgroup/artoo-ardrone)
10
+
11
+ ## Installing
12
+
13
+ ```
14
+ gem install artoo-ardrone
15
+ ```
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ require 'rake/testtask'
5
+
6
+ Rake::TestTask.new do |t|
7
+ t.pattern = "test/**/*_test.rb"
8
+ end
9
+
10
+ task :default => :test
@@ -0,0 +1,27 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "artoo-ardrone/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "artoo-ardrone"
7
+ s.version = Artoo::Ardrone::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Ron Evans", "Adrian Zankich"]
10
+ s.email = ["artoo@hybridgroup.com"]
11
+ s.homepage = "https://github.com/hybridgroup/artoo-ardrone"
12
+ s.summary = %q{Artoo adaptor and driver for Parrot ARDrone 2.0}
13
+ s.description = %q{Artoo adaptor and driver for Parrot ARDrone 2.0}
14
+
15
+ s.rubyforge_project = "artoo-ardrone"
16
+
17
+ s.files = `git ls-files`.split("\n")
18
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
+ s.require_paths = ["lib"]
21
+
22
+ s.add_runtime_dependency 'artoo', '~> 1.0.0.pre'
23
+ s.add_runtime_dependency 'hybridgroup-argus', '~> 0.3.0'
24
+ s.add_development_dependency 'minitest', '~> 5.0'
25
+ s.add_development_dependency 'minitest-happy'
26
+ s.add_development_dependency 'mocha', '~> 0.14.0'
27
+ end
@@ -0,0 +1,41 @@
1
+ require 'artoo/adaptors/adaptor'
2
+
3
+ module Artoo
4
+ module Adaptors
5
+ # This class connects to a ARDrone 2.0
6
+ # @see http://rubydoc.info/gems/hybridgroup-argus/0.2.0/Argus/Drone Argus Drone Documentation
7
+ class Ardrone < Adaptor
8
+ finalizer :finalize
9
+ attr_reader :ardrone
10
+
11
+ # Finalizes connection with ARDrone by landing and stopping the device
12
+ def finalize
13
+ if connected?
14
+ ardrone.land
15
+ ardrone.stop
16
+ end
17
+ end
18
+
19
+ # Creates Argus Drone connection with device
20
+ # @return [Boolean]
21
+ def connect
22
+ require 'argus' unless defined?(::Argus)
23
+ @ardrone = Argus::Drone.new(connect_to_udp, port.host, port.port)
24
+ super
25
+ end
26
+
27
+ # Disconnects device by stopping it and ending connection
28
+ # @return [Boolean]
29
+ def disconnect
30
+ ardrone.stop
31
+ super
32
+ end
33
+
34
+ # Calls ardrone actions using method missing
35
+ # @see https://github.com/hybridgroup/argus/blob/master/lib/argus/drone.rb hybridgroup-argus Drone
36
+ def method_missing(method_name, *arguments, &block)
37
+ ardrone.send(method_name, *arguments, &block)
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,33 @@
1
+ require 'artoo/adaptors/adaptor'
2
+
3
+ module Artoo
4
+ module Adaptors
5
+ # Connect to a ARDrone 2.0 navigation data stream
6
+ # @see http://rubydoc.info/gems/hybridgroup-argus/0.2.0/Argus/NavStreamer Argus NavStremer Documentation
7
+ class ArdroneNavigation < Adaptor
8
+ attr_reader :ardrone
9
+
10
+ # Creates connection with Argus NavStreamer and starts ardrone device
11
+ # @return [Boolean]
12
+ def connect
13
+ require 'argus' unless defined?(::Argus)
14
+ @ardrone = Argus::NavStreamer.new(connect_to_udp, port.host, port.port.to_i)
15
+ @ardrone.start
16
+ super
17
+ end
18
+
19
+ # Closes connection with ardrone device
20
+ # @return [Boolean]
21
+ def disconnect
22
+ ardrone.close
23
+ super
24
+ end
25
+
26
+ # Calls ardrone actions using method missing
27
+ # @see http://rubydoc.info/gems/hybridgroup-argus/0.2.0/Argus/Drone Argus Drone Documentation
28
+ def method_missing(method_name, *arguments, &block)
29
+ ardrone.send(method_name, *arguments, &block)
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,35 @@
1
+ require 'artoo/adaptors/adaptor'
2
+
3
+ module Artoo
4
+ module Adaptors
5
+ # Connect to a ARDrone 2.0 video data stream
6
+ # @see http://rubydoc.info/gems/hybridgroup-argus/0.2.0/Argus/TcpVideoStreamer TCP Video Streamer Documentation
7
+ # @see http://rubydoc.info/gems/hybridgroup-argus/0.2.0/Argus/PaVEParser PaVEParser Documentation
8
+ class ArdroneVideo < Adaptor
9
+ attr_reader :ardrone, :video_parser
10
+
11
+ # Creates connection to Argus TCP Video Streamer and
12
+ # Argus PaVE Parser starting a stream with ardrone device
13
+ # @return [Boolean]
14
+ def connect
15
+ require 'argus' unless defined?(::Argus)
16
+ @ardrone = Argus::VideoStreamer.new(connect_to_tcp, port.host, port.port)
17
+ @ardrone.start(connect_to_udp)
18
+ super
19
+ end
20
+
21
+ # Closes ardrone connection
22
+ # @return [Boolean]
23
+ def disconnect
24
+ ardrone.close
25
+ super
26
+ end
27
+
28
+ # Calls ardrone actions using method missing
29
+ # @see https://github.com/hybridgroup/argus/blob/master/lib/argus/drone.rb hybridgroup-argus Drone
30
+ def method_missing(method_name, *arguments, &block)
31
+ ardrone.send(method_name, *arguments, &block)
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,15 @@
1
+ require 'artoo/drivers/driver'
2
+
3
+ module Artoo
4
+ module Drivers
5
+ # Ardrone driver behaviors
6
+ # @see https://github.com/hybridgroup/argus/blob/master/lib/argus/drone.rb Argus::Drone docs for supported actions
7
+ class Ardrone < Driver
8
+ COMMANDS = [:start, :stop, :hover, :land, :take_off, :emergency, :front_camera, :bottom_camera, :up, :down, :left, :right, :forward, :backward, :turn_left, :turn_right].freeze
9
+
10
+ def start
11
+ connection.start(false) # send false, so Argus does not use NavMonitor
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,25 @@
1
+ require 'artoo/drivers/driver'
2
+
3
+ module Artoo
4
+ module Drivers
5
+ # Ardrone navigation driver behaviors
6
+ class ArdroneNavigation < Driver
7
+
8
+ # Starts driver and handle updates from device
9
+ def start_driver
10
+ every(interval) do
11
+ handle_update
12
+ end
13
+
14
+ super
15
+ end
16
+
17
+ # Receives data from navigation and publishes
18
+ # and event in update topic for it
19
+ def handle_update
20
+ navdata = connection.receive_data
21
+ publish(event_topic_name("update"), navdata)
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,27 @@
1
+ require 'artoo/drivers/driver'
2
+
3
+ module Artoo
4
+ module Drivers
5
+ # Ardrone video driver behaviors
6
+ class ArdroneVideo < Driver
7
+
8
+ # Starts drives and handles video frame
9
+ def start_driver
10
+ every(interval) do
11
+ handle_frame
12
+ end
13
+
14
+ super
15
+ end
16
+
17
+ # Retrieves frame from video connection
18
+ # and publishes data to update and frame
19
+ # event topics
20
+ def handle_frame(*params)
21
+ video = connection.receive_data
22
+ publish(event_topic_name("update"), "video", video)
23
+ publish(event_topic_name("frame"), video.frame)
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,5 @@
1
+ module Artoo
2
+ module Ardrone
3
+ VERSION = '1.0.0.pre'
4
+ end
5
+ end
@@ -0,0 +1,9 @@
1
+ require 'lib/artoo/adaptors/ardrone'
2
+ require 'lib/artoo/adaptors/ardrone_navigation'
3
+ require 'lib/artoo/adaptors/ardrone_video'
4
+
5
+ require 'lib/artoo/drivers/ardrone'
6
+ require 'lib/artoo/drivers/ardrone_navigation'
7
+ require 'lib/artoo/drivers/ardrone_video'
8
+
9
+ require 'lib/artoo-ardrone/version'
@@ -0,0 +1,24 @@
1
+ require File.expand_path(File.dirname(__FILE__) + "/../test_helper")
2
+ require 'artoo/adaptors/ardrone'
3
+ require 'argus'
4
+
5
+ describe Artoo::Adaptors::Ardrone do
6
+ before do
7
+ @port = Artoo::Port.new('/dev/awesome')
8
+ @adaptor = Artoo::Adaptors::Ardrone.new(:port => @port)
9
+ @ardrone = mock('ardrone')
10
+ Argus::Drone.stubs(:new).returns(@ardrone)
11
+ end
12
+
13
+ it 'Artoo::Adaptors::Ardrone#connect' do
14
+ @adaptor.connect.must_equal true
15
+ end
16
+
17
+ it 'Artoo::Adaptors::Ardrone#disconnect' do
18
+ @adaptor.connect
19
+
20
+ @ardrone.expects(:stop)
21
+ @adaptor.disconnect
22
+ @adaptor.connected?.must_equal false
23
+ end
24
+ end
@@ -0,0 +1,11 @@
1
+ require File.expand_path(File.dirname(__FILE__) + "/../test_helper")
2
+ require 'artoo/drivers/ardrone_navigation'
3
+
4
+ describe Artoo::Drivers::ArdroneNavigation do
5
+ before do
6
+ @device = mock('device')
7
+ @driver = Artoo::Drivers::ArdroneNavigation.new(:parent => @device)
8
+ end
9
+
10
+ it 'must do things'
11
+ end
@@ -0,0 +1,11 @@
1
+ require File.expand_path(File.dirname(__FILE__) + "/../test_helper")
2
+ require 'artoo/drivers/ardrone'
3
+
4
+ describe Artoo::Drivers::Ardrone do
5
+ before do
6
+ @device = mock('device')
7
+ @driver = Artoo::Drivers::Ardrone.new(:parent => @device)
8
+ end
9
+
10
+ it 'must do things'
11
+ end
@@ -0,0 +1,11 @@
1
+ require File.expand_path(File.dirname(__FILE__) + "/../test_helper")
2
+ require 'artoo/drivers/ardrone_video'
3
+
4
+ describe Artoo::Drivers::ArdroneVideo do
5
+ before do
6
+ @device = mock('device')
7
+ @driver = Artoo::Drivers::ArdroneVideo.new(:parent => @device)
8
+ end
9
+
10
+ it 'must do things'
11
+ end
@@ -0,0 +1,6 @@
1
+ require 'minitest/autorun'
2
+ require 'mocha/setup'
3
+
4
+ require 'artoo/robot'
5
+
6
+ Celluloid.logger = nil
metadata ADDED
@@ -0,0 +1,136 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: artoo-ardrone
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0.pre
5
+ platform: ruby
6
+ authors:
7
+ - Ron Evans
8
+ - Adrian Zankich
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-05-24 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: artoo
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ~>
19
+ - !ruby/object:Gem::Version
20
+ version: 1.0.0.pre
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ~>
26
+ - !ruby/object:Gem::Version
27
+ version: 1.0.0.pre
28
+ - !ruby/object:Gem::Dependency
29
+ name: hybridgroup-argus
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ~>
33
+ - !ruby/object:Gem::Version
34
+ version: 0.3.0
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ~>
40
+ - !ruby/object:Gem::Version
41
+ version: 0.3.0
42
+ - !ruby/object:Gem::Dependency
43
+ name: minitest
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ~>
47
+ - !ruby/object:Gem::Version
48
+ version: '5.0'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ~>
54
+ - !ruby/object:Gem::Version
55
+ version: '5.0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: minitest-happy
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ - !ruby/object:Gem::Dependency
71
+ name: mocha
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ~>
75
+ - !ruby/object:Gem::Version
76
+ version: 0.14.0
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ~>
82
+ - !ruby/object:Gem::Version
83
+ version: 0.14.0
84
+ description: Artoo adaptor and driver for Parrot ARDrone 2.0
85
+ email:
86
+ - artoo@hybridgroup.com
87
+ executables: []
88
+ extensions: []
89
+ extra_rdoc_files: []
90
+ files:
91
+ - .gitignore
92
+ - .rvmrc.example
93
+ - .travis.yml
94
+ - Gemfile
95
+ - Gemfile.lock
96
+ - LICENSE
97
+ - README.md
98
+ - Rakefile
99
+ - artoo-ardrone.gemspec
100
+ - lib/artoo-ardrone.rb
101
+ - lib/artoo-ardrone/version.rb
102
+ - lib/artoo/adaptors/ardrone.rb
103
+ - lib/artoo/adaptors/ardrone_navigation.rb
104
+ - lib/artoo/adaptors/ardrone_video.rb
105
+ - lib/artoo/drivers/ardrone.rb
106
+ - lib/artoo/drivers/ardrone_navigation.rb
107
+ - lib/artoo/drivers/ardrone_video.rb
108
+ - test/adaptors/ardrone_test.rb
109
+ - test/drivers/ardrone_navigation_test.rb
110
+ - test/drivers/ardrone_test.rb
111
+ - test/drivers/ardrone_video_test.rb
112
+ - test/test_helper.rb
113
+ homepage: https://github.com/hybridgroup/artoo-ardrone
114
+ licenses: []
115
+ metadata: {}
116
+ post_install_message:
117
+ rdoc_options: []
118
+ require_paths:
119
+ - lib
120
+ required_ruby_version: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - '>='
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ required_rubygems_version: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - '>'
128
+ - !ruby/object:Gem::Version
129
+ version: 1.3.1
130
+ requirements: []
131
+ rubyforge_project: artoo-ardrone
132
+ rubygems_version: 2.0.3
133
+ signing_key:
134
+ specification_version: 4
135
+ summary: Artoo adaptor and driver for Parrot ARDrone 2.0
136
+ test_files: []