artoo 1.0.0.rc2 → 1.0.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/Gemfile.lock +1 -3
- data/README.md +19 -1
- data/bin/artoo +9 -0
- data/lib/artoo/commands/connect.rb +22 -5
- data/lib/artoo/version.rb +1 -1
- metadata +4 -8
- data/bin/artoo_bind.sh +0 -25
- data/bin/artoo_socat_linux.sh +0 -10
- data/bin/artoo_socat_osx.sh +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8dada91f56c875c86f6f1f4a689a27417a65d760
|
4
|
+
data.tar.gz: c66e5a9aa2311d76d7af2648bf6a362a14b8ed48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b6b2c71e48df2bba926db39e2561b9cd23b8ef6ea74852ee996e78b480c5a8f888c6aeae01099e192e5cf2ead9e1c07b6ab84afea4f1c6b40d03091da2796f0
|
7
|
+
data.tar.gz: 2fb9018b0178c87e21f6ae024564f0ea1ee51ee4293b6031bf65bfee2fcfb525e0e3f8be4e77e1d95a42ede9dbc2872330d33d84674b4db7d4cc2429cb2801a4
|
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
artoo
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
rbx-2.0.0-rc1
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
artoo (1.0.0.
|
4
|
+
artoo (1.0.0.rc3)
|
5
5
|
celluloid (~> 0.14.1)
|
6
6
|
celluloid-io (~> 0.14.1)
|
7
7
|
multi_json (~> 1.6)
|
@@ -62,7 +62,6 @@ GEM
|
|
62
62
|
certified
|
63
63
|
http_parser.rb
|
64
64
|
http_parser.rb (0.5.3)
|
65
|
-
http_parser.rb (0.5.3-java)
|
66
65
|
json (1.7.7)
|
67
66
|
json (1.7.7-java)
|
68
67
|
kramdown (1.1.0)
|
@@ -77,7 +76,6 @@ GEM
|
|
77
76
|
metaclass (~> 0.0.1)
|
78
77
|
multi_json (1.7.7)
|
79
78
|
nio4r (0.4.6)
|
80
|
-
nio4r (0.4.6-java)
|
81
79
|
pry (0.9.12.2)
|
82
80
|
coderay (~> 1.0.5)
|
83
81
|
method_source (~> 0.8)
|
data/README.md
CHANGED
@@ -212,12 +212,30 @@ Artoo has a Command Line Interface (CLI) so you can access important features ri
|
|
212
212
|
```
|
213
213
|
$ artoo
|
214
214
|
Commands:
|
215
|
-
artoo
|
215
|
+
artoo connect SUBCOMMAND ...ARGS # Connects to device
|
216
|
+
artoo console ROBOT # Run a robot using the Robi console
|
216
217
|
artoo generate SUBCOMMAND ...ARGS # Generates a new robot or adaptor
|
217
218
|
artoo help [COMMAND] # Describe available commands or one specific command
|
219
|
+
artoo install SUBCOMMAND ...ARGS # Installs utility programs
|
220
|
+
artoo start ROBOT # Run a robot
|
218
221
|
artoo version # Displays the current version
|
219
222
|
```
|
220
223
|
|
224
|
+
### Connect:
|
225
|
+
|
226
|
+
Artoo makes it a lot easier to connect TCP Socket to Bluetooth and serial port devices using the command line interface:
|
227
|
+
|
228
|
+
```
|
229
|
+
$ artoo connect
|
230
|
+
Commands:
|
231
|
+
artoo connect bind # bind [ADDRESS] [NAME] binds a device to some connected hardware
|
232
|
+
artoo connect help [COMMAND] # Describe subcommands or one specific subcommand
|
233
|
+
artoo connect scan # scan for connected devices
|
234
|
+
artoo connect socat # socat [PORT] [NAME] use socat to connect a socket to a serial device by name
|
235
|
+
```
|
236
|
+
|
237
|
+
You can scan your computer for paired Bluetooth devices, bind them to unix ports, and connect socket to serial interfaces, easily from the command line!
|
238
|
+
|
221
239
|
### Console:
|
222
240
|
|
223
241
|
Artoo includes Robi, a console based on Pry (http://pryrepl.org/) to allow you to interactively debug and control your robot.
|
data/bin/artoo
CHANGED
@@ -23,6 +23,15 @@ module CLI
|
|
23
23
|
run("robi #{robot}")
|
24
24
|
end
|
25
25
|
|
26
|
+
desc "start ROBOT", "Run a robot"
|
27
|
+
option :delay, :default => 0, :desc => "Number of seconds to wait for connections"
|
28
|
+
def start(robot)
|
29
|
+
say "Starting robot..."
|
30
|
+
delay = options[:delay].to_i
|
31
|
+
sleep(delay) if delay > 0
|
32
|
+
run("ruby #{robot}")
|
33
|
+
end
|
34
|
+
|
26
35
|
desc "generate SUBCOMMAND ...ARGS", "Generates a new robot or adaptor"
|
27
36
|
subcommand "generate", Artoo::Commands::Generate
|
28
37
|
|
@@ -21,10 +21,12 @@ module Artoo
|
|
21
21
|
|
22
22
|
desc "bind", "bind [ADDRESS] [NAME] binds a device to some connected hardware"
|
23
23
|
option :comm, :default => 0, :desc => "Comm number"
|
24
|
-
|
24
|
+
option :radio, :default => "hci0", :desc => "Bluetooth radio address"
|
25
|
+
def bind(address, name)
|
25
26
|
case os
|
26
27
|
when :linux
|
27
|
-
run("
|
28
|
+
run("rfcomm -i #{options[:radio]} bind /dev/rfcomm#{options[:comm]} #{address} 1")
|
29
|
+
run("sudo ln -s /dev/rfcomm#{options[:comm]} /dev/#{name}")
|
28
30
|
when :macosx
|
29
31
|
say "OSX binds devices on its own volition."
|
30
32
|
else
|
@@ -32,13 +34,28 @@ module Artoo
|
|
32
34
|
end
|
33
35
|
end
|
34
36
|
|
35
|
-
desc "socat", "socat [PORT] [NAME] use socat to connect a socket to a device by name"
|
37
|
+
desc "socat", "socat [PORT] [NAME] use socat to connect a socket to a serial device by name"
|
38
|
+
option :retries, :default => 0, :desc => "Number of times to retry connecting on failure"
|
36
39
|
def socat(port, name)
|
40
|
+
attempts = 1 + options[:retries].to_i
|
41
|
+
|
37
42
|
case os
|
38
43
|
when :linux
|
39
|
-
run("
|
44
|
+
run("sudo chmod a+rw /dev/#{name}")
|
45
|
+
|
46
|
+
while(attempts > 0) do
|
47
|
+
run("socat -d -d FILE:/dev/#{name},nonblock,raw,b115200,echo=0 TCP-LISTEN:#{port},fork")
|
48
|
+
break unless $? == 1
|
49
|
+
attempts -= 1
|
50
|
+
end
|
51
|
+
|
40
52
|
when :macosx
|
41
|
-
|
53
|
+
while(attempts > 0) do
|
54
|
+
run("socat -d -d FILE:/dev/#{name},nonblock,raw,echo=0 TCP-LISTEN:#{port},fork")
|
55
|
+
break unless $? == 1
|
56
|
+
attempts -= 1
|
57
|
+
end
|
58
|
+
|
42
59
|
else
|
43
60
|
say "OS not yet supported..."
|
44
61
|
end
|
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.0.0.
|
4
|
+
version: 1.0.0.rc3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ron Evans
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2013-07-
|
15
|
+
date: 2013-07-27 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: celluloid
|
@@ -117,14 +117,13 @@ email:
|
|
117
117
|
- artoo@hybridgroup.com
|
118
118
|
executables:
|
119
119
|
- artoo
|
120
|
-
- artoo_bind.sh
|
121
|
-
- artoo_socat_linux.sh
|
122
|
-
- artoo_socat_osx.sh
|
123
120
|
- robi
|
124
121
|
extensions: []
|
125
122
|
extra_rdoc_files: []
|
126
123
|
files:
|
127
124
|
- .gitignore
|
125
|
+
- .ruby-gemset
|
126
|
+
- .ruby-version
|
128
127
|
- .travis.yml
|
129
128
|
- .yardopts
|
130
129
|
- CONTRIBUTORS.md
|
@@ -165,9 +164,6 @@ files:
|
|
165
164
|
- api/public/partials/robot-index.html
|
166
165
|
- artoo.gemspec
|
167
166
|
- bin/artoo
|
168
|
-
- bin/artoo_bind.sh
|
169
|
-
- bin/artoo_socat_linux.sh
|
170
|
-
- bin/artoo_socat_osx.sh
|
171
167
|
- bin/robi
|
172
168
|
- examples/ardrone.rb
|
173
169
|
- examples/ardrone_multi.rb
|
data/bin/artoo_bind.sh
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
#
|
3
|
-
# This will create a connection bound to a device located at /dev/<devicename>
|
4
|
-
#
|
5
|
-
# Requires sudo or ran as root
|
6
|
-
#
|
7
|
-
# $1 = unbound /dev/rfcommXX
|
8
|
-
# $2 = device hardware address from scan
|
9
|
-
# $3 = device name
|
10
|
-
#
|
11
|
-
# Optional parameter
|
12
|
-
# $4 = bluetooth radio hcix
|
13
|
-
#
|
14
|
-
# Example
|
15
|
-
#
|
16
|
-
# sudo ./artoo_bind.sh 1 00:06:66:4A:43:23 pebble hci1
|
17
|
-
#
|
18
|
-
#
|
19
|
-
if [ -z "$4" ]; then
|
20
|
-
addr="hci0"
|
21
|
-
else
|
22
|
-
addr=$4
|
23
|
-
fi
|
24
|
-
rfcomm -i $addr bind /dev/rfcomm$1 $2 1
|
25
|
-
sudo ln -s /dev/rfcomm$1 /dev/$3
|
data/bin/artoo_socat_linux.sh
DELETED