Method: Roby::Application#prepare_action

Defined in:
lib/roby/app.rb

#prepare_action(name, mission: false, **arguments) ⇒ Object

Generate the plan pattern that will call the required action on the planning interface, with the given arguments.

This returns immediately, and the action is not yet deployed at that point.

Returns:

  • task, planning_task



3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
# File 'lib/roby/app.rb', line 3170

def prepare_action(name, mission: false, **arguments)
    if name.kind_of?(Class)
        _, m = action_from_model(name)
    else
        _, m = action_from_name(name)
    end

    if mission
        plan.add_mission_task(task = m.plan_pattern(**arguments))
    else
        plan.add(task = m.plan_pattern(**arguments))
    end
    [task, task.planning_task]
end