Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
doc:pycram:designator [2021/06/18 09:08] – [Action Designator] jdech | doc:pycram:designator [2021/06/18 10:16] – jdech | ||
---|---|---|---|
Line 105: | Line 105: | ||
===== Action Designator ===== | ===== Action Designator ===== | ||
- | Action designator are a high level representation of movements which compose different motion designator. | + | Action designator are a high level representation of movements which compose different motion designator. |
- | + | ||
- | Action designator work much like motion designator in that both hold a description which has all properties needed for execution. Action designator descriptions also have a grounding method which interferes missing properties. | + | |
- | + | ||
- | The main difference between action and motion designator is that action designator do not call a process module if they are performed, instead they call a function which is set while the designator is grounded. This function is the plan that composes the motions needed for executing the described movement. | + | |
The currently available action designator descriptions are: | The currently available action designator descriptions are: | ||
Line 127: | Line 123: | ||
* OpenActionDescription | * OpenActionDescription | ||
* CloseActionDescription | * CloseActionDescription | ||
+ | |||
+ | === Perform === | ||
+ | Like motion designator, action designator also have a perform method which executes the behaviour described in the designator. | ||
+ | |||
+ | The main difference between action and motion designator is that action designator do not call a process module if they are performed, instead they call a function which is set while the designator is grounded. This function is the plan that composes the motions needed for executing the described movement. | ||
+ | |||
+ | An example on how to perform an action designator can be seen below. | ||
+ | < | ||
+ | from pycram.action_designator import ActionDesignator, | ||
+ | |||
+ | ActionDesignator(MoveTorsoActionDesignator(position=[1, | ||
+ | |||
+ | The perform method will firstly call the ground method of the description to ensure that all necessary properties are present and then execute the function set while grounding the designator. | ||
+ | |||
+ | === Grounding === | ||
+ | Grounding is similar to the resolving of motion designator, both inference missing properties or insert standard values. The difference is that the grounding returns another action designator instead of a dictionary and that while inferencing the properties the grounding method assigns a function which is executed when the designator is performed. | ||
+ | You can see an example of how to ground an action designator below. | ||
+ | |||
+ | < | ||
+ | from pycram.action_designator import ActionDesignator, | ||
+ | |||
+ | MoveTorsoActoinDescription(position=[1, | ||
+ | |||
+ | As you can see, the grounding method is part of the description. | ||
+ | |||
+ | The grounding method will also be called when performing an action designator before executing the actual behaviour of the designator. |