artoo-crazyflie 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5eada782f3bbf17701752f48f6220667965ae6ca
4
- data.tar.gz: 0dc54ca75c1524f430997578b7b2c6215ba7a591
3
+ metadata.gz: fb61fb25a1dc1eddc5ef2cb9eca834ad03dad108
4
+ data.tar.gz: 03557c6a7c4de31d38f890634a12f72c98ddb7bd
5
5
  SHA512:
6
- metadata.gz: 4d912e025bd8777841d3a4346db60d4d453313d9b7acba91041e0632e6c4820e71610d36a00f1df3e47bfb3f5d5ce08f1cf77e88ac21495aa9fce7319eee60a5
7
- data.tar.gz: 239e2e728795c29b8e15a88362027b191c8f3c80c747f27c52ab0e71de9827fa9ac80c0a31a68905c574466d307a37b19257941021325026ad1c3842a3b96643
6
+ metadata.gz: 5a663adad79ec87f085477dcb1f2e696e3d120a34ca476ea6daaa747640dc02f260573b52b72c9359622e95339fad6e13b5d5010543aec5e49d10aaf231e8f7a
7
+ data.tar.gz: f24e703713079742cb9961de22dfc4f7171592ae47d356e686e6b2047ddf9a6c0a251636a5c3b94d9f2776d430d9957d119de98a19376a643f36fa9d911bb45e
data/.gitignore CHANGED
@@ -1 +1,3 @@
1
1
  .rvmrc
2
+ .rbx/
3
+ pkg/
@@ -1,35 +1,38 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- artoo-crazyflie (0.4.0)
5
- artoo (>= 1.4.0)
4
+ artoo-crazyflie (0.5.0)
5
+ artoo (>= 1.6.0)
6
6
  hybridgroup-crubyflie
7
7
 
8
8
  GEM
9
9
  remote: http://rubygems.org/
10
10
  specs:
11
- artoo (1.4.1)
11
+ artoo (1.6.0)
12
12
  celluloid (~> 0.15.0)
13
13
  celluloid-io (~> 0.15.0)
14
14
  multi_json (~> 1.6)
15
15
  pry (~> 0.9)
16
16
  rake
17
17
  reel (~> 0.4.0)
18
+ robeaux (~> 0.0.3)
18
19
  thor (~> 0.18.1)
19
20
  celluloid (0.15.2)
20
21
  timers (~> 1.1.0)
21
22
  celluloid-io (0.15.0)
22
23
  celluloid (>= 0.15.0)
23
24
  nio4r (>= 0.5.0)
24
- coderay (1.0.9)
25
- ffi (1.9.0)
25
+ coderay (1.1.0)
26
+ ffi (1.9.3)
27
+ ffi (1.9.3-java)
26
28
  http (0.5.0)
27
29
  http_parser.rb
28
- http_parser.rb (0.6.0.beta.2)
29
- hybridgroup-crubyflie (0.1.4)
30
+ http_parser.rb (0.6.0)
31
+ http_parser.rb (0.6.0-java)
32
+ hybridgroup-crubyflie (0.1.5)
30
33
  libusb
31
34
  trollop
32
- libusb (0.3.4)
35
+ libusb (0.4.0)
33
36
  ffi (>= 1.0)
34
37
  metaclass (0.0.1)
35
38
  method_source (0.8.2)
@@ -37,25 +40,33 @@ GEM
37
40
  minitest-happy (1.0.0)
38
41
  mocha (0.14.0)
39
42
  metaclass (~> 0.0.1)
40
- multi_json (1.8.2)
41
- nio4r (0.5.0)
42
- pry (0.9.12.2)
43
- coderay (~> 1.0.5)
43
+ multi_json (1.8.4)
44
+ nio4r (1.0.0)
45
+ nio4r (1.0.0-java)
46
+ pry (0.9.12.6)
47
+ coderay (~> 1.0)
44
48
  method_source (~> 0.8)
45
49
  slop (~> 3.4)
46
- rake (10.1.0)
50
+ pry (0.9.12.6-java)
51
+ coderay (~> 1.0)
52
+ method_source (~> 0.8)
53
+ slop (~> 3.4)
54
+ spoon (~> 0.0)
55
+ rake (10.1.1)
47
56
  reel (0.4.0)
48
57
  celluloid (>= 0.15.1)
49
58
  celluloid-io (>= 0.15.0)
50
59
  http (>= 0.5.0)
51
60
  http_parser.rb (>= 0.6.0.beta.2)
52
61
  websocket_parser (>= 0.1.4)
53
- slop (3.4.6)
62
+ robeaux (0.0.3)
63
+ slop (3.4.7)
64
+ spoon (0.0.4)
65
+ ffi
54
66
  thor (0.18.1)
55
67
  timers (1.1.0)
56
68
  trollop (2.0)
57
- websocket_parser (0.1.4)
58
- http
69
+ websocket_parser (0.1.6)
59
70
 
60
71
  PLATFORMS
61
72
  java
data/LICENSE CHANGED
@@ -1,2 +1,13 @@
1
+ Copyright (c) 2012-2014 The Hybrid Group
1
2
 
2
- # TODO: put your license file here
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 CHANGED
@@ -39,21 +39,44 @@ If you are have a USB 3.0 port, you might run into this issue http://stackoverfl
39
39
 
40
40
  ## Crazyflie Hover
41
41
 
42
- To use Crazyflie with the hover command, requires installing the https://bitbucket.org/omwdunkley/crazyflie-firmware fork of the Crazyflie firmware. The easiest way to currently do this, is to install the Crazyflie PC Client, download the 'hover' branch BIN file from here https://bitbucket.org/omwdunkley/crazyflie-firmware/downloads/cflie.bin and then use the Crazyflie PC tools to update the Crazyflie firmware.
42
+ To use the Crazyflie beta 'hover' mode, you will need to install the latest beta of firmware to the Crazyflie itself from https://bitbucket.org/bitcraze/crazyflie-firmware/downloads/Crazyflie_2013.11-beta1.bin
43
43
 
44
- Once you have updated the Crazyflie firmware, you will NEED to use the following syntax in your Artoo code to use it:
44
+ Once you have updated the Crazyflie firmware, to trigger the hover mode on, use the `flightmode.althold` param on the Crazyflie like this:
45
45
 
46
46
  ```ruby
47
- connection :crazyflie, :adaptor => :crazyflie, :supports_hover => true
47
+ @crazyflie.param.set_value('flightmode.althold', true)
48
48
  ```
49
49
 
50
- If you do not add `:supports_hover => true` to your connection code to the Crazyflie, it will go crazy out of control as you as you try to connect to it. You have been warned...
50
+ Please note that the Crazyflie's interprets hover to mean "maintain altitude", not "stay in one place", so you will need to control horizontal positioning yourself.
51
51
 
52
+ To turn hover mode off:
53
+
54
+ ```ruby
55
+ @crazyflie.param.set_value('flightmode.althold', false)
56
+ ```
57
+ Once you turn hover mode off, the Crazyflie requires that you immediately apply thrust, or it will just drop like an unpowered PCB from the air. You have been warned...
58
+
59
+ ## Documentation
60
+
61
+ Check out our [documentation](http://artoo.io/documentation/) for lots of information about how to use Artoo.
62
+
63
+ ## IRC
64
+
65
+ Need more help? Just want to say "Hello"? Come visit us on IRC freenode #artoo
52
66
 
53
67
  ## Contributing
54
68
 
55
- 1. Fork it
56
- 2. Create your feature branch (`git checkout -b my-new-feature`)
57
- 3. Commit your changes (`git commit -am 'Add some feature'`)
58
- 4. Push to the branch (`git push origin my-new-feature`)
59
- 5. Create new Pull Request
69
+ * All patches must be provided under the Apache 2.0 License
70
+ * 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
71
+ * Submit a Github Pull Request to the appropriate branch and ideally discuss the changes with us in IRC.
72
+ * We will look at the patch, test it out, and give you feedback.
73
+ * Avoid doing minor whitespace changes, renamings, etc. along with merged content. These will be done by the maintainers from time to time but they can complicate merges and should be done seperately.
74
+ * Take care to maintain the existing coding style.
75
+ * Add unit tests for any new or changed functionality.
76
+ * All pull requests should be "fast forward"
77
+ * If there are commits after yours use “git rebase -i <new_head_branch>”
78
+ * If you have local changes you may need to use “git stash”
79
+ * For git help see [progit](http://git-scm.com/book) which is an awesome (and free) book on git
80
+
81
+
82
+ (c) 2012-2014 The Hybrid Group
@@ -6,7 +6,7 @@ Gem::Specification.new do |s|
6
6
  s.name = "artoo-crazyflie"
7
7
  s.version = Artoo::Crazyflie::VERSION
8
8
  s.platform = Gem::Platform::RUBY
9
- s.authors = ["Adrian Zankich"]
9
+ s.authors = ["Adrian Zankich", "Ron Evans"]
10
10
  s.email = ["artoo@hybridgroup.com"]
11
11
  s.homepage = "https://github.com/hybridgroup/artoo-crazyflie"
12
12
  s.summary = %q{Artoo adaptor and driver for Crazyflie}
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
19
19
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
20
  s.require_paths = ["lib"]
21
21
 
22
- s.add_runtime_dependency 'artoo', '>= 1.4.0'
22
+ s.add_runtime_dependency 'artoo', '>= 1.6.0'
23
23
  s.add_runtime_dependency 'hybridgroup-crubyflie'
24
24
  s.add_development_dependency 'minitest', '>= 5.0'
25
25
  s.add_development_dependency 'minitest-happy'
@@ -0,0 +1,141 @@
1
+ # Commands
2
+
3
+ ## start
4
+
5
+ Starts the crazyfly's motors and controls.
6
+
7
+ ##### Returns
8
+
9
+ `nil`
10
+
11
+ ## stop
12
+
13
+ Stops the crazyfly's motors.
14
+
15
+ ##### Returns
16
+
17
+ `nil`
18
+
19
+ ## hover
20
+
21
+ Makes the crazyflie hover in a position.
22
+
23
+ ##### Returns
24
+
25
+ `nil`
26
+
27
+ ## land
28
+
29
+ Initiates a landing sequence.
30
+
31
+ ##### Returns
32
+
33
+ `nil`
34
+
35
+ ## take_off
36
+
37
+ Initiates take off sequence.
38
+
39
+ ##### Returns
40
+
41
+ `nil`
42
+
43
+ ## up
44
+
45
+ Orders crazy flie to go up.
46
+
47
+ ##### Returns
48
+
49
+ `nil`
50
+
51
+ ## down
52
+
53
+ Orders crazy flie to go down.
54
+
55
+ ##### Returns
56
+
57
+ `nil`
58
+
59
+ ## left(deg)
60
+
61
+ Orders crazyflie to go left the amount specified by deg (roll left).
62
+
63
+ ##### Params
64
+
65
+ - **deg** - params
66
+
67
+ ##### Returns
68
+
69
+ `nil`
70
+
71
+ ## right(deg)
72
+
73
+ Orders crazyflie to go right the amount specified by deg (roll right).
74
+
75
+ ##### Params
76
+
77
+ - **deg** - params
78
+
79
+ ##### Returns
80
+
81
+ `nil`
82
+
83
+ ## forward(deg)
84
+
85
+ Orders crazyflie to go forward the amount specified by deg (pitch forward).
86
+
87
+ ##### Params
88
+
89
+ - **deg** - params
90
+
91
+ ##### Returns
92
+
93
+ `nil`
94
+
95
+ ## backward(deg)
96
+
97
+ Orders crazyflie to go backward the amount specified by deg (pitch backward).
98
+
99
+ ##### Params
100
+
101
+ - **deg** - params
102
+
103
+ ##### Returns
104
+
105
+ `nil`
106
+
107
+ ## turn_left(deg)
108
+
109
+ Orders crazyflie to turn left the amount specified by deg (yaw left).
110
+
111
+ ##### Params
112
+
113
+ - **deg** - params
114
+
115
+ ##### Returns
116
+
117
+ `nil`
118
+
119
+ ## turn_right(deg)
120
+
121
+ Orders crazyflie to turn right the amount specified by deg (yaw right).
122
+
123
+ ##### Params
124
+
125
+ - **deg** - params
126
+
127
+ ##### Returns
128
+
129
+ `nil`
130
+
131
+ ## power(deg)
132
+
133
+ Sets thrust power to deg.
134
+
135
+ ##### Params
136
+
137
+ - **deg** - params
138
+
139
+ ##### Returns
140
+
141
+ `nil`
@@ -0,0 +1,49 @@
1
+ # Commands
2
+
3
+ ## set_value
4
+
5
+ Sets a value for the Crazyflie.
6
+
7
+ ##### Returns
8
+
9
+ `nil`
10
+
11
+ ## start_get_value
12
+
13
+ Gets a value from the Crazyflie.
14
+
15
+ ##### Returns
16
+
17
+ `integer`
18
+
19
+ ## toc
20
+
21
+ Gets the toc from the Crazyflie.
22
+
23
+ ##### Returns
24
+
25
+ `integer`
26
+
27
+ ## values
28
+
29
+ Gets the values from the Crazyflie.
30
+
31
+ ##### Returns
32
+
33
+ `integer`
34
+
35
+ ## log()
36
+
37
+ Logs a value to the Crazyflie.
38
+
39
+ ##### Returns
40
+
41
+ `nil`
42
+
43
+ ## start_driver()
44
+
45
+ Starts the driver.
46
+
47
+ ##### Returns
48
+
49
+ `nil`
@@ -0,0 +1,6 @@
1
+ # Events
2
+
3
+ ## start_driver
4
+
5
+ Starts the driver
6
+
@@ -0,0 +1,6 @@
1
+ # Events
2
+
3
+ ## start_driver
4
+
5
+ Starts the driver
6
+
@@ -1,6 +1,6 @@
1
1
  require 'artoo'
2
2
 
3
- connection :crazyflie, :adaptor => :crazyflie, :supports_hover => true
3
+ connection :crazyflie, :adaptor => :crazyflie
4
4
  device :drone, :driver => :crazyflie, :connection => :crazyflie, :interval => 0.1
5
5
 
6
6
  work do
@@ -1,6 +1,6 @@
1
1
  require 'artoo'
2
2
 
3
- connection :crazyflie, :adaptor => :crazyflie, :supports_hover => true
3
+ connection :crazyflie, :adaptor => :crazyflie
4
4
  device :drone, :driver => :crazyflie, :connection => :crazyflie, :interval => 0.1
5
5
 
6
6
  work do
@@ -1,6 +1,6 @@
1
1
  require 'artoo'
2
2
 
3
- connection :crazyflie, :adaptor => :crazyflie, :supports_hover => true
3
+ connection :crazyflie, :adaptor => :crazyflie
4
4
  device :drone, :driver => :crazyflie, :connection => :crazyflie, :interval => 0.01
5
5
 
6
6
  connection :joystick, :adaptor => :joystick
@@ -1,6 +1,6 @@
1
1
  require 'artoo'
2
2
 
3
- connection :crazyflie, :adaptor => :crazyflie, :supports_hover => true
3
+ connection :crazyflie, :adaptor => :crazyflie
4
4
  device :drone, :driver => :crazyflie, :connection => :crazyflie
5
5
 
6
6
  connection :leap, :adaptor => :leapmotion, :port => '127.0.0.1:6437'
@@ -1,23 +1,13 @@
1
1
  require 'artoo'
2
2
 
3
- connection :crazyflie, :adaptor => :crazyflie, :supports_hover => true
4
- #device :commander, :driver => :crazyflie, :connection => :crazyflie
3
+ connection :crazyflie, :adaptor => :crazyflie
5
4
  device :drone, :driver => :crazyflie_nav, :connection => :crazyflie
6
5
 
7
6
  work do
8
- #commander.start
9
-
10
- #puts drone.toc
11
- # drone.start_get_value("pid_attitude.pitch_kp")
12
- # drone.start_get_value("pid_attitude.pitch_ki")
13
- # drone.start_get_value("pid_attitude.pitch_kd")
14
7
  drone.log_value("stabilizer.pitch")
15
8
  drone.start_logging
16
9
 
17
10
  every(1.seconds) {
18
11
  puts drone.log
19
- #puts drone.values["pid_attitude.pitch_kp"]
20
- #puts drone.values["pid_attitude.pitch_ki"]
21
- #puts drone.values["pid_attitude.pitch_kd"]
22
12
  }
23
13
  end
@@ -1,5 +1,5 @@
1
1
  module Artoo
2
2
  module Crazyflie
3
- VERSION = '0.4.0'
3
+ VERSION = '0.5.0'
4
4
  end
5
5
  end
@@ -20,7 +20,6 @@ module Artoo
20
20
  end
21
21
  source = flies.first
22
22
  end
23
- @crazyflie.supports_hover = additional_params[:supports_hover] || false
24
23
  @crazyflie.open_link(source)
25
24
  @commander = ::Crubyflie::Commander.new(@crazyflie)
26
25
  super
@@ -119,8 +119,7 @@ module Artoo
119
119
  private
120
120
 
121
121
  def send_command
122
- set_thrust_hover if hover_mode == 1
123
- connection.commander.send_setpoint(roll, pitch, yaw, thrust, xmode, hover_mode)
122
+ connection.commander.send_setpoint(roll, pitch, yaw, thrust, xmode)
124
123
  end
125
124
  end
126
125
  end
@@ -4,7 +4,7 @@ module Artoo
4
4
  module Drivers
5
5
  # The crazyflie driver behaviors
6
6
  class CrazyflieNav < Driver
7
- COMMANDS = [:start_get_value, :toc, :values, :log].freeze
7
+ COMMANDS = [:set_value, :start_get_value, :toc, :values, :log].freeze
8
8
 
9
9
  attr_reader :values, :log
10
10
 
@@ -26,6 +26,12 @@ module Artoo
26
26
  connection.param.toc
27
27
  end
28
28
 
29
+ def set_value(name, value)
30
+ connection.param.set_value(name, value) do |val|
31
+ @values[value] = val
32
+ end
33
+ end
34
+
29
35
  def start_get_value(value)
30
36
  connection.param.get_value(value) do |val|
31
37
  @values[value] = val
metadata CHANGED
@@ -1,83 +1,84 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: artoo-crazyflie
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Zankich
8
+ - Ron Evans
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-11-27 00:00:00.000000000 Z
12
+ date: 2014-02-07 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: artoo
15
16
  requirement: !ruby/object:Gem::Requirement
16
17
  requirements:
17
- - - '>='
18
+ - - ">="
18
19
  - !ruby/object:Gem::Version
19
- version: 1.4.0
20
+ version: 1.6.0
20
21
  type: :runtime
21
22
  prerelease: false
22
23
  version_requirements: !ruby/object:Gem::Requirement
23
24
  requirements:
24
- - - '>='
25
+ - - ">="
25
26
  - !ruby/object:Gem::Version
26
- version: 1.4.0
27
+ version: 1.6.0
27
28
  - !ruby/object:Gem::Dependency
28
29
  name: hybridgroup-crubyflie
29
30
  requirement: !ruby/object:Gem::Requirement
30
31
  requirements:
31
- - - '>='
32
+ - - ">="
32
33
  - !ruby/object:Gem::Version
33
34
  version: '0'
34
35
  type: :runtime
35
36
  prerelease: false
36
37
  version_requirements: !ruby/object:Gem::Requirement
37
38
  requirements:
38
- - - '>='
39
+ - - ">="
39
40
  - !ruby/object:Gem::Version
40
41
  version: '0'
41
42
  - !ruby/object:Gem::Dependency
42
43
  name: minitest
43
44
  requirement: !ruby/object:Gem::Requirement
44
45
  requirements:
45
- - - '>='
46
+ - - ">="
46
47
  - !ruby/object:Gem::Version
47
48
  version: '5.0'
48
49
  type: :development
49
50
  prerelease: false
50
51
  version_requirements: !ruby/object:Gem::Requirement
51
52
  requirements:
52
- - - '>='
53
+ - - ">="
53
54
  - !ruby/object:Gem::Version
54
55
  version: '5.0'
55
56
  - !ruby/object:Gem::Dependency
56
57
  name: minitest-happy
57
58
  requirement: !ruby/object:Gem::Requirement
58
59
  requirements:
59
- - - '>='
60
+ - - ">="
60
61
  - !ruby/object:Gem::Version
61
62
  version: '0'
62
63
  type: :development
63
64
  prerelease: false
64
65
  version_requirements: !ruby/object:Gem::Requirement
65
66
  requirements:
66
- - - '>='
67
+ - - ">="
67
68
  - !ruby/object:Gem::Version
68
69
  version: '0'
69
70
  - !ruby/object:Gem::Dependency
70
71
  name: mocha
71
72
  requirement: !ruby/object:Gem::Requirement
72
73
  requirements:
73
- - - '>='
74
+ - - ">="
74
75
  - !ruby/object:Gem::Version
75
76
  version: 0.14.0
76
77
  type: :development
77
78
  prerelease: false
78
79
  version_requirements: !ruby/object:Gem::Requirement
79
80
  requirements:
80
- - - '>='
81
+ - - ">="
81
82
  - !ruby/object:Gem::Version
82
83
  version: 0.14.0
83
84
  description: Artoo adaptor and driver for Crazyflie
@@ -87,13 +88,17 @@ executables: []
87
88
  extensions: []
88
89
  extra_rdoc_files: []
89
90
  files:
90
- - .gitignore
91
+ - ".gitignore"
91
92
  - Gemfile
92
93
  - Gemfile.lock
93
94
  - LICENSE
94
95
  - README.md
95
96
  - Rakefile
96
97
  - artoo-crazyflie.gemspec
98
+ - docs/commands_flight.md
99
+ - docs/commands_nav.md
100
+ - docs/events_flight.md
101
+ - docs/events_nav.md
97
102
  - examples/crazy_hop.rb
98
103
  - examples/crazy_hover.rb
99
104
  - examples/crazy_joystick.rb
@@ -117,17 +122,17 @@ require_paths:
117
122
  - lib
118
123
  required_ruby_version: !ruby/object:Gem::Requirement
119
124
  requirements:
120
- - - '>='
125
+ - - ">="
121
126
  - !ruby/object:Gem::Version
122
127
  version: '0'
123
128
  required_rubygems_version: !ruby/object:Gem::Requirement
124
129
  requirements:
125
- - - '>='
130
+ - - ">="
126
131
  - !ruby/object:Gem::Version
127
132
  version: '0'
128
133
  requirements: []
129
134
  rubyforge_project: artoo-crazyflie
130
- rubygems_version: 2.0.3
135
+ rubygems_version: 2.2.1
131
136
  signing_key:
132
137
  specification_version: 4
133
138
  summary: Artoo adaptor and driver for Crazyflie