Method: Roby::PlanningLoop.filter_options

Defined in:
lib/roby/planning/loops.rb

.filter_options(options) ⇒ Object

Filters the options in options, splitting between the options that are specific to the planning task and those that are to be forwarded to the planner itself



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/roby/planning/loops.rb', line 79

def self.filter_options(options) # :nodoc:
    task_arguments, planning_options = Kernel.filter_options options, 
  :period => nil,
  :lookahead => 1,
  :planner_model => nil,
  :planned_model => Roby::Task,
  :method_name => nil,
  :method_options => {},
  :planning_owners => nil

    if !task_arguments[:method_name]
  raise ArgumentError, "required argument :method_name missing"
    elsif !task_arguments[:planner_model]
  raise ArgumentError, "required argument :planner_model missing"
    elsif task_arguments[:lookahead] < 0
  raise ArgumentError, "lookahead must be positive"
    end
    task_arguments[:period] ||= nil
    [task_arguments, planning_options]
end