class documentation
class BaseSkill(BaseCallable, AbstractSkill):
Constructor: BaseSkill(name, suspendable, minimum_access_level, precondition_check, ...)
Abstract base skill without state machine logic.
For skills with logic in Python, there is FiniteSkillLogicMixin and ContinuousSkillLogicMixin.
Derived classes must implement at least the reset(), start() and halt() methods for a non-suspendable skill. The _condition_skill_ready() method can be overridden in order to add skill specific conditions before the start() method is allowed to be executed by the state machine.
| Method | __init__ |
Cooperative Constructor. Create a new skill instance. |
| Async Method | call |
Call another continuous skill from this skill. |
| Async Method | call |
Call another finite skill from this skill. |
| Async Method | wait |
Undocumented |
| Property | current |
Return the current state of the skill. |
| Property | ua |
Undocumented |
| Async Method | _condition |
Undocumented |
| Async Method | _get |
Undocumented |
| Async Method | _halt |
Undocumented |
| Async Method | _init |
Undocumented |
| Async Method | _write |
Write the given state without any transition logic checks. |
| Instance Variable | _called |
Undocumented |
| Instance Variable | _condition |
Undocumented |
| Instance Variable | _current |
Undocumented |
| Instance Variable | _feasibility |
Undocumented |
| Instance Variable | _precondition |
Undocumented |
| Instance Variable | _suspendable |
Undocumented |
| Instance Variable | _ua |
OPC UA node if the state variable of the state machine. |
| Instance Variable | _ua |
OPC UA base node of state machine. |
def __init__(self, *, name:
str | None = None, suspendable: bool = False, minimum_access_level: int | None = None, precondition_check: BaseSkill | None = None, feasibility_check: BaseSkill | None = None, **kwargs):
¶
Cooperative Constructor. Create a new skill instance.
| Parameters | |
name:str | None | name of the skill. |
suspendable:bool | whether the skill can be suspended/resumed. |
minimumint | None | Minimum required access level to start the skill (see User for more info). |
preconditionBaseSkill | None | Optional reference to corresponding separate precondition check for this skill. |
feasibilityBaseSkill | None | Optional reference to corresponding separate feasibility check for this skill. |
| **kwargs | Undocumented |
async def call_other_continuous_skill(self, skill:
BaseSkill, *, wait_for_running: bool = True, timeout: float | None = 10.0):
¶
Call another continuous skill from this skill.
| Parameters | |
skill:BaseSkill | the continuous skill to call. |
waitbool | should this method block until the timeout is reached or the skill is running? |
timeout:float | None | timeout in seconds, can be disabled by setting it to None. |
| Raises | |
TypeError | if given skill is not continuous. |
asyncio.TimeoutError | if the timeout is reached. |
@asynccontextmanager
async def call_other_finite_skill(self, skill: BaseSkill, *, wait_for_completion: bool = True, timeout: float | None = 60.0, reset_after_completion: bool = True) -> AsyncGenerator:
¶
Call another finite skill from this skill.
| Parameters | |
skill:BaseSkill | the finite skill to call. |
waitbool | should this method block until the timeout is reached or the skill is completed? |
timeout:float | None | timeout in seconds, can be disabled by setting it to None. |
resetbool | should the called skill be reset after completion? |
| Returns | |
AsyncGenerator | Undocumented |
| Raises | |
TypeError | if given skill is not finite. |
asyncio.TimeoutError | if the timeout is reached. |