artoo 1.8.0 → 1.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +3 -1
- data/.travis.yml +3 -2
- data/CONTRIBUTING.md +1 -0
- data/Gemfile +1 -1
- data/README.md +2 -3
- data/artoo.gemspec +3 -3
- data/lib/artoo/adaptors/io/digital_pin.rb +8 -4
- data/lib/artoo/robot.rb +19 -13
- data/lib/artoo/version.rb +1 -1
- metadata +14 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2bd5f19df7614902b2db851504c69b84c62802bf
|
4
|
+
data.tar.gz: 553d99621d690f7dd34c6d44f3f5e00558a80ac4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 846e9655c178b18fa55325cf11f8d857683a1fedd4951844c242a64f7193ce239a2947e04d87abe3ed14dc3df63e7fe066b5067071f7c5fec28810dbb278aa2c
|
7
|
+
data.tar.gz: 5a5adc204d4196683e0ceb275d395d39d91ee77b48cd6e940e6ee8b86c8c7fd9cfce8752a3e3cf404e5b4708261480a61d4d6da3f5f35932fe96b127a626a86f
|
data/.ruby-version
CHANGED
data/.travis.yml
CHANGED
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
To get started, <a href="https://thg-clahub.herokuapp.com/agreements/clahub">Sign the Contributor License Agreement</a>
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -106,7 +106,7 @@ Artoo has a extensible system for connecting to hardware devices. The following
|
|
106
106
|
- [OpenCV](http://opencv.org/) <=> [Adaptor](https://github.com/hybridgroup/artoo-opencv)
|
107
107
|
- [Pebble](http://getpebble.com/) <=> [Adaptor](https://github.com/hybridgroup/artoo-pebble)
|
108
108
|
- [Raspberry Pi](http://www.raspberrypi.org/) <=> [Adaptor](https://github.com/hybridgroup/artoo-raspi)
|
109
|
-
- [Roomba](http://www.irobot.com/
|
109
|
+
- [Roomba](http://www.irobot.com/About-iRobot/STEM.aspx) <=> [Adaptor](https://github.com/hybridgroup/artoo-roomba)
|
110
110
|
- [Spark Core](http://www.spark.io/) <=> [Adaptor](https://github.com/hybridgroup/artoo-spark)
|
111
111
|
- [Sphero](http://www.gosphero.com/) <=> [Adaptor](https://github.com/hybridgroup/artoo-sphero)
|
112
112
|
|
@@ -319,7 +319,6 @@ If you want to help us with some documentation on the site, you can go to [artoo
|
|
319
319
|
Need more help? Just want to say "Hello"? Come visit us on IRC freenode #artoo
|
320
320
|
|
321
321
|
## Contributing
|
322
|
-
* All active development is in the dev branch. New or updated features must be added to the dev branch. Hotfixes will be considered on the master branch in situations where it does not alter behaviour or features, only fixes a bug.
|
323
322
|
* All patches must be provided under the Apache 2.0 License
|
324
323
|
* Please use the -s option in git to "sign off" that the commit is your work and you are providing it under the Apache 2.0 License
|
325
324
|
* Submit a Github Pull Request to the appropriate branch and ideally discuss the changes with us in IRC.
|
@@ -333,4 +332,4 @@ Need more help? Just want to say "Hello"? Come visit us on IRC freenode #artoo
|
|
333
332
|
* For git help see [progit](http://git-scm.com/book) which is an awesome (and free) book on git
|
334
333
|
|
335
334
|
|
336
|
-
(c) 2012-
|
335
|
+
(c) 2012-2015 The Hybrid Group
|
data/artoo.gemspec
CHANGED
@@ -20,13 +20,13 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
21
21
|
s.require_paths = ["lib"]
|
22
22
|
|
23
|
-
s.add_runtime_dependency 'celluloid', '
|
24
|
-
s.add_runtime_dependency 'celluloid-io', '
|
23
|
+
s.add_runtime_dependency 'celluloid', '~> 0.16.0'
|
24
|
+
s.add_runtime_dependency 'celluloid-io', '~> 0.16.0'
|
25
25
|
s.add_runtime_dependency 'http', '~> 0.6.1'
|
26
26
|
s.add_runtime_dependency 'reel', '~> 0.5.0'
|
27
27
|
s.add_runtime_dependency 'multi_json', '~> 1.10.1'
|
28
28
|
s.add_runtime_dependency 'rake'
|
29
29
|
s.add_runtime_dependency 'pry', '~> 0.9.0'
|
30
30
|
s.add_runtime_dependency 'thor', '~> 0.19.1'
|
31
|
-
s.add_runtime_dependency 'robeaux', '0.
|
31
|
+
s.add_runtime_dependency 'robeaux', '0.4.1'
|
32
32
|
end
|
@@ -50,14 +50,17 @@ module Artoo
|
|
50
50
|
@mode = mode
|
51
51
|
|
52
52
|
if mode == 'w'
|
53
|
-
|
54
|
-
@pin_file = File.open("#{ GPIO_PATH }/gpio#{ pin_num }/value", "w")
|
53
|
+
set_pin(mode: 'w', direction: GPIO_DIRECTION_WRITE)
|
55
54
|
elsif mode =='r'
|
56
|
-
|
57
|
-
@pin_file = File.open("#{ GPIO_PATH }/gpio#{pin_num}/value", "r")
|
55
|
+
set_pin(mode: 'r', direction: GPIO_DIRECTION_READ)
|
58
56
|
end
|
59
57
|
end
|
60
58
|
|
59
|
+
def set_pin(mode:, direction:)
|
60
|
+
File.open("#{ GPIO_PATH }/gpio#{ pin_num }/direction", "w") { |f| f.write(direction) }
|
61
|
+
@pin_file = File.open("#{ GPIO_PATH }/gpio#{ pin_num }/value", mode)
|
62
|
+
end
|
63
|
+
|
61
64
|
def on?
|
62
65
|
(@status == 'high') ? true : false
|
63
66
|
end
|
@@ -78,6 +81,7 @@ module Artoo
|
|
78
81
|
|
79
82
|
# Unexports the pin in GPIO to leave it free
|
80
83
|
def close
|
84
|
+
off! if @mode == 'w'
|
81
85
|
File.open("#{ GPIO_PATH }/unexport", "w") { |f| f.write("#{pin_num}") }
|
82
86
|
end
|
83
87
|
end
|
data/lib/artoo/robot.rb
CHANGED
@@ -186,23 +186,29 @@ module Artoo
|
|
186
186
|
|
187
187
|
def initialize_connections(params={})
|
188
188
|
@connections = {}
|
189
|
-
connection_types.each {|
|
190
|
-
Logger.info "Initializing connection #{ct[:name].to_s}..."
|
191
|
-
cp = params[ct[:name]] || {}
|
192
|
-
c = Connection.new(ct.merge(cp).merge(:parent => current_instance))
|
193
|
-
@connections[ct[:name]] = c
|
194
|
-
}
|
189
|
+
connection_types.each {|type| initialize_connection(params, type, @connections)}
|
195
190
|
end
|
196
191
|
|
197
192
|
def initialize_devices(params={})
|
198
193
|
@devices = {}
|
199
|
-
device_types.each {|
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
194
|
+
device_types.each {|type| initialize_device(params, type, @devices)}
|
195
|
+
end
|
196
|
+
|
197
|
+
def initialize_connection(params, type, connections)
|
198
|
+
connection = initialize_object(Connection, params, type)
|
199
|
+
@connections[type[:name]] = connection
|
200
|
+
end
|
201
|
+
|
202
|
+
def initialize_device(params, type, devices)
|
203
|
+
type = initialize_object(Device, params, type)
|
204
|
+
instance_eval("def #{type.name}; return devices[:#{type.name}]; end")
|
205
|
+
@devices[type.name.intern] = type
|
206
|
+
end
|
207
|
+
|
208
|
+
def initialize_object(klass, params, type)
|
209
|
+
Logger.info "Initializing #{klass.to_s.downcase} #{type[:name].to_s}..."
|
210
|
+
param = params[type[:name]] || {}
|
211
|
+
klass.new(type.merge(param).merge(:parent => current_instance))
|
206
212
|
end
|
207
213
|
|
208
214
|
def execute_startup(things, &block)
|
data/lib/artoo/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: artoo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8.
|
4
|
+
version: 1.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ron Evans
|
@@ -12,36 +12,36 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2015-05-23 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: celluloid
|
19
19
|
requirement: !ruby/object:Gem::Requirement
|
20
20
|
requirements:
|
21
|
-
- - "
|
21
|
+
- - "~>"
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 0.16.0
|
23
|
+
version: 0.16.0
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: !ruby/object:Gem::Requirement
|
27
27
|
requirements:
|
28
|
-
- - "
|
28
|
+
- - "~>"
|
29
29
|
- !ruby/object:Gem::Version
|
30
|
-
version: 0.16.0
|
30
|
+
version: 0.16.0
|
31
31
|
- !ruby/object:Gem::Dependency
|
32
32
|
name: celluloid-io
|
33
33
|
requirement: !ruby/object:Gem::Requirement
|
34
34
|
requirements:
|
35
|
-
- - "
|
35
|
+
- - "~>"
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version: 0.16.0
|
37
|
+
version: 0.16.0
|
38
38
|
type: :runtime
|
39
39
|
prerelease: false
|
40
40
|
version_requirements: !ruby/object:Gem::Requirement
|
41
41
|
requirements:
|
42
|
-
- - "
|
42
|
+
- - "~>"
|
43
43
|
- !ruby/object:Gem::Version
|
44
|
-
version: 0.16.0
|
44
|
+
version: 0.16.0
|
45
45
|
- !ruby/object:Gem::Dependency
|
46
46
|
name: http
|
47
47
|
requirement: !ruby/object:Gem::Requirement
|
@@ -132,14 +132,14 @@ dependencies:
|
|
132
132
|
requirements:
|
133
133
|
- - '='
|
134
134
|
- !ruby/object:Gem::Version
|
135
|
-
version: 0.
|
135
|
+
version: 0.4.1
|
136
136
|
type: :runtime
|
137
137
|
prerelease: false
|
138
138
|
version_requirements: !ruby/object:Gem::Requirement
|
139
139
|
requirements:
|
140
140
|
- - '='
|
141
141
|
- !ruby/object:Gem::Version
|
142
|
-
version: 0.
|
142
|
+
version: 0.4.1
|
143
143
|
description: Ruby-based microframework for robotics
|
144
144
|
email:
|
145
145
|
- artoo@hybridgroup.com
|
@@ -154,6 +154,7 @@ files:
|
|
154
154
|
- ".ruby-version"
|
155
155
|
- ".travis.yml"
|
156
156
|
- ".yardopts"
|
157
|
+
- CONTRIBUTING.md
|
157
158
|
- CONTRIBUTORS.md
|
158
159
|
- Gemfile
|
159
160
|
- LICENSE
|
@@ -288,22 +289,5 @@ rubygems_version: 2.2.2
|
|
288
289
|
signing_key:
|
289
290
|
specification_version: 4
|
290
291
|
summary: Ruby-based microframework for robotics
|
291
|
-
test_files:
|
292
|
-
- test/adaptors/adaptor_test.rb
|
293
|
-
- test/adaptors/loopback_test.rb
|
294
|
-
- test/api/api_routes_test.rb
|
295
|
-
- test/api/api_test.rb
|
296
|
-
- test/artoo_test.rb
|
297
|
-
- test/connection_test.rb
|
298
|
-
- test/delegator_test.rb
|
299
|
-
- test/device_test.rb
|
300
|
-
- test/drivers/driver_test.rb
|
301
|
-
- test/ext/numeric_test.rb
|
302
|
-
- test/interfaces/interface_test.rb
|
303
|
-
- test/master_test.rb
|
304
|
-
- test/port_test.rb
|
305
|
-
- test/robot_test.rb
|
306
|
-
- test/test_helper.rb
|
307
|
-
- test/utility_test.rb
|
308
|
-
- test/utility_test_cases.rb
|
292
|
+
test_files: []
|
309
293
|
has_rdoc:
|