Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
documentation:skiros:skill_description [2023/03/23 18:48] – pontusr | documentation:skiros:skill_description [2023/06/26 12:39] (current) – pontusr | ||
---|---|---|---|
Line 39: | Line 39: | ||
</ | </ | ||
- | a concrete example | + | Concrete examples |
===== Pre-conditions ===== | ===== Pre-conditions ===== | ||
- | TODO | + | 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 | ||
+ | |||
+ | < | ||
+ | def createDescription(self): | ||
+ | self.addParam(' | ||
+ | self.addParam(' | ||
+ | |||
+ | self.addPreCondition(self.getRelationCond(' | ||
+ | </ | ||
+ | |||
+ | 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:// | ||
+ | |||
+ | 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.: |
+ | |||
+ | < | ||
+ | self.addHoldCondition(""" | ||
+ | </ | ||
===== 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. |
+ | |||
+ | < | ||
+ | self.addPostCondition(""" | ||
+ | </ |