documentation:skiros:skill_description

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
documentation:skiros:skill_description [2023/06/26 12:12] – [Pre-conditions] pontusrdocumentation:skiros:skill_description [2023/06/26 12:39] (current) pontusr
Line 42: Line 42:
  
 ===== Pre-conditions ===== ===== Pre-conditions =====
 +
 +The purpose of pre conditions are two-fold. Firstly pre conditions specify if a skill can be run or not, if the pre conditions cannot be satisfied the skill will not execute. Secondly pre conditions help SkiROS infer parameter, these do not need to be specified in the SkiROS gui, instead they are inferred when the skill is run.
  
 Pre-conditions can be specified in the skill description in the following way Pre-conditions can be specified in the skill description in the following way
Line 52: Line 54:
       self.addPreCondition(self.getRelationCond('1_has_2', 'skiros:hasA', 'param1', 'param2', True))       self.addPreCondition(self.getRelationCond('1_has_2', 'skiros:hasA', 'param1', 'param2', True))
 </cli> </cli>
 +
 +A precondition for a skill with this skill description will then be that param1 is related to param2 with a hasA relation. This can be used to infer parameters from the world model, an example of this can be seen in [[https://git.cs.lth.se/robotlab/skill_examples/-/blob/master/src/skill_examples/infer_parameters.py|infer_parameters]]. If the preconditions are not satisfied the skill will not even start. Sometimes SkiROS tells you why and which preconditions failed, sometimes it does not tell you.
 +
 +The relationship between parameters specified can't be overly complicated because then SkiROS will not be able to infer them correctly. Exactly when SkiROS fails to infer parameters is unknown at the moment. A normal relationship as above and chained relationships are however fine. When several elements are related to several other elements it gets more hairy.
  
 ===== Hold-conditions ===== ===== Hold-conditions =====
  
-TODO+A hold condition is a condition which SkiROS either checks while the skill is running or your responsible for checking it continuously. Only SkiROS knows. They are specified similarly to the other conditions, i.e.: 
 + 
 +<cli> 
 +      self.addHoldCondition(""" condition """
 +</cli>
  
 ===== Post-conditions ===== ===== Post-conditions =====
  
-TODO+A post condition is a condition which needs to be true when the skill has concluded. These are primarily used for skill planning. A post condition is specified similarly to the other conditions, i.e. 
 + 
 +<cli> 
 +      self.addPostCondition(""" condition """
 +</cli>
  • documentation/skiros/skill_description.1687781561.txt.gz
  • Last modified: 2023/06/26 12:12
  • by pontusr