roby 0.7 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -1
- data/History.txt +9 -0
- data/README.txt +3 -0
- data/Rakefile +3 -3
- data/app/scripts/distributed +0 -0
- data/app/scripts/generate/bookmarks +0 -0
- data/app/scripts/replay +0 -0
- data/app/scripts/results +0 -0
- data/app/scripts/run +0 -0
- data/app/scripts/server +0 -0
- data/app/scripts/shell +0 -0
- data/app/scripts/test +0 -0
- data/bin/roby +0 -0
- data/bin/roby-log +0 -0
- data/bin/roby-shell +0 -0
- data/lib/roby/config.rb +1 -1
- data/lib/roby/control.rb +1 -1
- data/lib/roby/distributed/transaction.rb +1 -1
- data/lib/roby/event.rb +22 -20
- data/lib/roby/planning/task.rb +9 -7
- data/lib/roby/transactions.rb +2 -0
- data/plugins/subsystems/test/app/scripts/distributed +0 -0
- data/plugins/subsystems/test/app/scripts/replay +0 -0
- data/plugins/subsystems/test/app/scripts/results +0 -0
- data/plugins/subsystems/test/app/scripts/run +0 -0
- data/plugins/subsystems/test/app/scripts/server +0 -0
- data/plugins/subsystems/test/app/scripts/shell +0 -0
- data/plugins/subsystems/test/app/scripts/test +0 -0
- data/test/planning/test_loops.rb +42 -34
- data/test/suite_core.rb +1 -1
- metadata +28 -28
data/.gitignore
CHANGED
data/History.txt
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
=== 0.7.1
|
2
|
+
|
3
|
+
* Fixed extension handling in 'rake setup'. It should work again.
|
4
|
+
* Fixed a lack of proper synchronization in operations without an execution
|
5
|
+
thread. This led to pile of strange errors in Roby's own test suite, but
|
6
|
+
should not have impacted normal operations (where a separate execution thread
|
7
|
+
exists)
|
8
|
+
* Fixed a potential race condition in PlanningTask
|
9
|
+
|
1
10
|
=== 0.7
|
2
11
|
|
3
12
|
* First public release. This release is still not compatible with Ruby 1.9, as
|
data/README.txt
CHANGED
data/Rakefile
CHANGED
@@ -54,7 +54,7 @@ def build_extension(name, soname = name)
|
|
54
54
|
raise "cannot set up #{name} extension"
|
55
55
|
end
|
56
56
|
end
|
57
|
-
FileUtils.ln_sf "
|
57
|
+
FileUtils.ln_sf "../ext/#{name}/#{soname}.so", "lib/#{soname}.so"
|
58
58
|
end
|
59
59
|
def clean_extension(name, soname = name)
|
60
60
|
puts "Cleaning ext/#{name}"
|
@@ -91,8 +91,8 @@ end
|
|
91
91
|
|
92
92
|
desc 'generate and build all the necessary files'
|
93
93
|
task :setup => :uic do
|
94
|
-
build_extension 'droby'
|
95
|
-
build_extension 'graph', '
|
94
|
+
build_extension 'droby', 'roby_marshalling'
|
95
|
+
build_extension 'graph', 'roby_bgl'
|
96
96
|
end
|
97
97
|
|
98
98
|
desc 'remove all generated files'
|
data/app/scripts/distributed
CHANGED
File without changes
|
File without changes
|
data/app/scripts/replay
CHANGED
File without changes
|
data/app/scripts/results
CHANGED
File without changes
|
data/app/scripts/run
CHANGED
File without changes
|
data/app/scripts/server
CHANGED
File without changes
|
data/app/scripts/shell
CHANGED
File without changes
|
data/app/scripts/test
CHANGED
File without changes
|
data/bin/roby
CHANGED
File without changes
|
data/bin/roby-log
CHANGED
File without changes
|
data/bin/roby-shell
CHANGED
File without changes
|
data/lib/roby/config.rb
CHANGED
data/lib/roby/control.rb
CHANGED
data/lib/roby/event.rb
CHANGED
@@ -204,17 +204,18 @@ module Roby
|
|
204
204
|
if Propagation.gathering?
|
205
205
|
Propagation.add_event_propagation(false, Propagation.sources, self, (context unless context.empty?), nil)
|
206
206
|
else
|
207
|
-
|
208
|
-
Propagation.
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
207
|
+
Roby::Control.synchronize do
|
208
|
+
errors = Propagation.propagate_events do |initial_set|
|
209
|
+
Propagation.add_event_propagation(false, nil, self, (context unless context.empty?), nil)
|
210
|
+
end
|
211
|
+
if errors.size == 1
|
212
|
+
e = errors.first.exception
|
213
|
+
raise e, e.message, e.backtrace
|
214
|
+
elsif !errors.empty?
|
215
|
+
for e in errors
|
216
|
+
STDERR.puts e.exception.full_message
|
217
|
+
end
|
216
218
|
end
|
217
|
-
raise "multiple exceptions"
|
218
219
|
end
|
219
220
|
end
|
220
221
|
end
|
@@ -461,17 +462,18 @@ module Roby
|
|
461
462
|
if Propagation.gathering?
|
462
463
|
Propagation.add_event_propagation(true, Propagation.sources, self, (context unless context.empty?), nil)
|
463
464
|
else
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
465
|
+
Roby::Control.synchronize do
|
466
|
+
errors = Propagation.propagate_events do |initial_set|
|
467
|
+
Propagation.add_event_propagation(true, Propagation.sources, self, (context unless context.empty?), nil)
|
468
|
+
end
|
469
|
+
if errors.size == 1
|
470
|
+
e = errors.first.exception
|
471
|
+
raise e, e.message, e.backtrace
|
472
|
+
elsif !errors.empty?
|
473
|
+
for e in errors
|
474
|
+
STDERR.puts e.full_message
|
475
|
+
end
|
473
476
|
end
|
474
|
-
raise "multiple exceptions"
|
475
477
|
end
|
476
478
|
end
|
477
479
|
end
|
data/lib/roby/planning/task.rb
CHANGED
@@ -47,14 +47,16 @@ module Roby
|
|
47
47
|
end
|
48
48
|
|
49
49
|
def planned_task
|
50
|
-
|
51
|
-
|
50
|
+
if success? || result
|
51
|
+
result
|
52
|
+
elsif task = planned_tasks.find { true }
|
53
|
+
task
|
54
|
+
elsif pending?
|
52
55
|
task = planned_model.new
|
53
56
|
task.planned_by self
|
54
57
|
task.executable = false
|
58
|
+
task
|
55
59
|
end
|
56
|
-
|
57
|
-
task
|
58
60
|
end
|
59
61
|
|
60
62
|
# The thread that is running the planner
|
@@ -103,9 +105,9 @@ module Roby
|
|
103
105
|
# If the transaction is distributed, and is not proposed to all
|
104
106
|
# owners, do it
|
105
107
|
transaction.propose
|
106
|
-
transaction.commit_transaction
|
107
|
-
|
108
|
-
|
108
|
+
transaction.commit_transaction do
|
109
|
+
@result = result_task
|
110
|
+
end
|
109
111
|
end
|
110
112
|
|
111
113
|
# Polls for the planning thread end
|
data/lib/roby/transactions.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/test/planning/test_loops.rb
CHANGED
@@ -162,46 +162,54 @@ class TC_PlanningLoop < Test::Unit::TestCase
|
|
162
162
|
# end. The system tries to always have some prepared subplans ready to be
|
163
163
|
# executed.
|
164
164
|
def test_periodic
|
165
|
-
main_task, loop_planner = prepare_plan :period =>
|
165
|
+
main_task, loop_planner = prepare_plan :period => 1, :lookahead => 2
|
166
166
|
loop_planner.start!
|
167
167
|
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
assert(first_planner.running?)
|
172
|
-
assert(!second_planner.running?)
|
168
|
+
FlexMock.use(Time) do |time_proxy|
|
169
|
+
current_time = Time.now + 5
|
170
|
+
time_proxy.should_receive(:now).and_return { current_time }
|
173
171
|
|
174
|
-
|
175
|
-
|
176
|
-
|
172
|
+
assert_equal(2, loop_planner.patterns.size)
|
173
|
+
first_planner = loop_planner.patterns[-1].first
|
174
|
+
second_planner = loop_planner.patterns[-2].first
|
175
|
+
assert(first_planner.running?)
|
176
|
+
assert(!second_planner.running?)
|
177
177
|
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
second_task = planning_task_result(second_planner)
|
182
|
-
third_planner = loop_planner.patterns[-3].first
|
183
|
-
assert(third_planner.running?)
|
184
|
-
assert(first_task.running?)
|
185
|
-
assert(second_task.pending?)
|
178
|
+
# Call #loop_start! already, to make the loop start the first running
|
179
|
+
# task as soon as it is ready.
|
180
|
+
loop_planner.loop_start!
|
186
181
|
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
182
|
+
# Usual pattern: wait for the result of the first two planners, check
|
183
|
+
# that the first task actually runs
|
184
|
+
first_task = planning_task_result(first_planner)
|
185
|
+
second_task = planning_task_result(second_planner)
|
186
|
+
third_planner = loop_planner.patterns[-3].first
|
187
|
+
assert(third_planner.running?)
|
188
|
+
assert(first_task.running?)
|
189
|
+
assert(second_task.pending?)
|
190
|
+
|
191
|
+
# Make the first task finish and make sure the system does not start it right away
|
192
|
+
first_task.success!
|
193
|
+
assert(first_task.success?)
|
194
|
+
assert(second_task.pending?)
|
195
|
+
|
196
|
+
current_time += 0.2
|
197
|
+
process_events
|
198
|
+
assert(second_task.pending?)
|
200
199
|
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
200
|
+
current_time += 0.8
|
201
|
+
process_events
|
202
|
+
assert(second_task.running?, loop_planner.arguments)
|
203
|
+
|
204
|
+
# Use the third task to check that the timeout can be overriden by
|
205
|
+
# calling loop_start! on the PlanningLoop task
|
206
|
+
third_task = planning_task_result(third_planner)
|
207
|
+
|
208
|
+
assert(second_task.running? && !third_task.running?)
|
209
|
+
second_task.success!
|
210
|
+
loop_planner.loop_start!
|
211
|
+
assert(!second_task.running? && third_task.running?)
|
212
|
+
end
|
205
213
|
end
|
206
214
|
|
207
215
|
# Test periodic loop tasks with zero lookahead
|
data/test/suite_core.rb
CHANGED
@@ -9,11 +9,11 @@ require 'test_state'
|
|
9
9
|
require 'test_propagation'
|
10
10
|
require 'test_exceptions'
|
11
11
|
|
12
|
-
|
13
12
|
require 'test_plan'
|
14
13
|
require 'test_query'
|
15
14
|
require 'test_transactions'
|
16
15
|
require 'test_transactions_proxy'
|
16
|
+
require 'test_thread_task'
|
17
17
|
|
18
18
|
require 'suite_planning'
|
19
19
|
require 'suite_relations'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sylvain Joyeux
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-05-
|
12
|
+
date: 2008-05-29 00:00:00 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -528,43 +528,43 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
528
528
|
requirements: []
|
529
529
|
|
530
530
|
rubyforge_project: roby
|
531
|
-
rubygems_version: 1.
|
531
|
+
rubygems_version: 1.1.1
|
532
532
|
signing_key:
|
533
533
|
specification_version: 2
|
534
534
|
summary: A plan-based control framework for autonomous systems
|
535
535
|
test_files:
|
536
|
-
- test/
|
537
|
-
- test/
|
538
|
-
- test/
|
539
|
-
- test/
|
540
|
-
- test/
|
536
|
+
- test/relations/test_hierarchy.rb
|
537
|
+
- test/relations/test_planned_by.rb
|
538
|
+
- test/relations/test_executed_by.rb
|
539
|
+
- test/relations/test_conflicts.rb
|
540
|
+
- test/relations/test_ensured.rb
|
541
|
+
- test/test_exceptions.rb
|
542
|
+
- test/test_query.rb
|
541
543
|
- test/planning/test_loops.rb
|
544
|
+
- test/planning/test_task.rb
|
545
|
+
- test/planning/test_model.rb
|
546
|
+
- test/test_transactions.rb
|
542
547
|
- test/test_support.rb
|
543
|
-
- test/
|
544
|
-
- test/
|
548
|
+
- test/test_relations.rb
|
549
|
+
- test/test_interface.rb
|
550
|
+
- test/test_log_server.rb
|
551
|
+
- test/test_event.rb
|
552
|
+
- test/test_bgl.rb
|
545
553
|
- test/test_plan.rb
|
546
|
-
- test/
|
547
|
-
- test/distributed/
|
548
|
-
- test/distributed/test_connection.rb
|
554
|
+
- test/test_thread_task.rb
|
555
|
+
- test/distributed/test_query.rb
|
549
556
|
- test/distributed/test_communication.rb
|
557
|
+
- test/distributed/test_transaction.rb
|
550
558
|
- test/distributed/test_remote_plan.rb
|
551
|
-
- test/distributed/test_mixed_plan.rb
|
552
559
|
- test/distributed/test_plan_notifications.rb
|
553
|
-
- test/distributed/
|
554
|
-
- test/distributed/
|
560
|
+
- test/distributed/test_mixed_plan.rb
|
561
|
+
- test/distributed/test_connection.rb
|
562
|
+
- test/distributed/test_execution.rb
|
555
563
|
- test/distributed/test_protocol.rb
|
564
|
+
- test/test_task.rb
|
565
|
+
- test/test_control.rb
|
556
566
|
- test/test_transactions_proxy.rb
|
557
|
-
- test/test_relations.rb
|
558
567
|
- test/test_testcase.rb
|
559
|
-
- test/test_query.rb
|
560
|
-
- test/test_interface.rb
|
561
|
-
- test/relations/test_planned_by.rb
|
562
|
-
- test/relations/test_executed_by.rb
|
563
|
-
- test/relations/test_hierarchy.rb
|
564
|
-
- test/relations/test_conflicts.rb
|
565
|
-
- test/relations/test_ensured.rb
|
566
|
-
- test/test_bgl.rb
|
567
|
-
- test/test_thread_task.rb
|
568
|
-
- test/test_event.rb
|
569
|
-
- test/test_state.rb
|
570
568
|
- test/test_propagation.rb
|
569
|
+
- test/test_state.rb
|
570
|
+
- test/test_log.rb
|