Class: Roby::Actions::Interface
- Extended by:
- Logger::Hierarchy, Models::Interface, DRoby::Identifiable, DRoby::V5::ModelDumper
- Defined in:
- lib/roby/actions/interface.rb,
lib/roby/droby/enable.rb
Overview
Functionality to gather information about the actions available on a given Roby app
Actions are simply methods of arity zero or one, preceded by a call to #describe. The methods can modify the current plan (available as #plan) and must return the Roby::Task instance that will be used to represent the action during execution
class Iface < Roby::Actions::Interface
describe "makes the robot turn"
def robot_turn
end
end
Direct Known Subclasses
Instance Attribute Summary collapse
-
#plan ⇒ Object
readonly
The plan to which this action interface adds tasks.
Instance Method Summary collapse
- #action_script(task, &block) ⇒ Object
- #action_state_machine(task, &block) ⇒ Object
-
#initialize(plan) ⇒ Interface
constructor
A new instance of Interface.
- #model ⇒ Object
Methods included from DRoby::Identifiable
Methods included from DRoby::V5::ModelDumper
Constructor Details
#initialize(plan) ⇒ Interface
Returns a new instance of Interface.
23 24 25 |
# File 'lib/roby/actions/interface.rb', line 23 def initialize(plan) @plan = plan end |
Instance Attribute Details
#plan ⇒ Object (readonly)
The plan to which this action interface adds tasks
21 22 23 |
# File 'lib/roby/actions/interface.rb', line 21 def plan @plan end |
Instance Method Details
#action_script(task, &block) ⇒ Object
36 37 38 39 40 41 |
# File 'lib/roby/actions/interface.rb', line 36 def action_script(task, &block) model = Coordination::ActionScript. new_submodel(action_interface: self.model, root: task.model) model.parse(&block) model.new(task) end |
#action_state_machine(task, &block) ⇒ Object
29 30 31 32 33 34 |
# File 'lib/roby/actions/interface.rb', line 29 def action_state_machine(task, &block) model = Coordination::ActionStateMachine. new_submodel(action_interface: self.model, root: task.model) model.parse(&block) model.new(task) end |
#model ⇒ Object
27 |
# File 'lib/roby/actions/interface.rb', line 27 def model; self.class end |