Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
doc:srdl2_tutorial [2014/11/27 17:00] – [Startup] admindoc:srdl2_tutorial [2014/11/27 17:04] – [Matching requirements to capabilities] admin
Line 136: Line 136:
  
 The matching can effectively reduced to the following statement: The matching can effectively reduced to the following statement:
 +<code prolog>
   missing_cap_for_action(Action, Robot, Cap) :-   missing_cap_for_action(Action, Robot, Cap) :-
      required_cap_for_action(Action, Cap),      required_cap_for_action(Action, Cap),
      \+ cap_available_on_robot(Cap, Robot).      \+ cap_available_on_robot(Cap, Robot).
 +</code>
 +     
 A missing capability is thus defined as one that is required by an action, but not provided by the robot. Required means that either the action itself or any sub-action has a dependency on this capability: A missing capability is thus defined as one that is required by an action, but not provided by the robot. Required means that either the action itself or any sub-action has a dependency on this capability:
 +<code prolog>
   required_cap_for_action(Action, Cap) :-   required_cap_for_action(Action, Cap) :-
      class_properties(Action, srdl2cap:'dependsOnCapability', Cap).      class_properties(Action, srdl2cap:'dependsOnCapability', Cap).
Line 145: Line 149:
      plan_subevents_recursive(Action, SubAction),      plan_subevents_recursive(Action, SubAction),
      class_properties(SubAction, srdl2cap:'dependsOnCapability', Cap).      class_properties(SubAction, srdl2cap:'dependsOnCapability', Cap).
 +</code>
  
-There are three possibilities to express that a capability is available on a robot: Either it is asserted to be available for the whole class of robots (e.g. every PR2 has a holonomic base), for a specific robot instance, or it can be concluded that the capability should be available because all specified dependencies on components or other capabilities are fulfilled: 
  
 +There are three possibilities to express that a capability is available on a robot: Either it is asserted to be available for the whole class of robots (e.g. every PR2 has a holonomic base), for a specific robot instance, or it can be concluded that the capability should be available because all specified dependencies on components or other capabilities are fulfilled:
 +<code prolog>
   % capability asserted for robot instance   % capability asserted for robot instance
   cap_available_on_robot(Cap, Robot) :-   cap_available_on_robot(Cap, Robot) :-
Line 167: Line 173:
      forall( class_properties(Cap, srdl2cap:'dependsOnCapability', SubCap),      forall( class_properties(Cap, srdl2cap:'dependsOnCapability', SubCap),
              cap_available_on_robot(SubCap, Robot) ).              cap_available_on_robot(SubCap, Robot) ).
 +</code>
  
 The matching procedure is equivalent for components. The matching procedure is equivalent for components.