Zum Inhalt

SimulationInstruction

The base class for robot instructions.

Attributes:

Name Type Description
name str

The name of the instruction used for logging.

add_to_program(self, program)

Adds the instruction to a given RoboDK program.

Source code in core/manipulator/SimulationInstruction.py
17
18
19
20
21
def add_to_program(self, program: robolink.Item):
    """Adds the instruction to a given RoboDK program."""
    assert program is not None and program.Type() == robolink.ITEM_TYPE_PROGRAM
    if not program.Valid():
        raise ValueError('Simulation not setup correctly. Cannot add {} instruction to given program.'.format(self.name))

apply_to_cube_state(self, cube_state)

Applies the instruction to a given CubeState and returns the result.

Returns:

Type Description
CubeState

The resulting CubeState

Source code in core/manipulator/SimulationInstruction.py
27
28
29
30
31
32
33
def apply_to_cube_state(self, cube_state: CubeState) -> CubeState:
    """Applies the instruction to a given CubeState and returns the result.

    Returns:
        The resulting CubeState
    """
    raise NotImplementedError('Cannot apply to cube state.')

execute(self)

Executes the instruction from within python.

Source code in core/manipulator/SimulationInstruction.py
23
24
25
def execute(self):
    """Executes the instruction from within python."""
    raise NotImplementedError('Cannot execute instruction.')

GripInstruction

A grip instruction for the robot.

Either closes (grip) or opens (release) the gripper fingers.

Attributes:

Name Type Description
name str

The name of the instruction used for logging.

grip bool

Flag, indicating whether the gripper should close.


MoveInstruction

A move instruction for the robot.

Moves the robot to a new target.

Attributes:

Name Type Description
name str

The name of the instruction used for logging.

target robolink.Item
grip_position grip_target_generation.GripPosition

The associated grip_position with this target.

linear bool

Flag, indicating whether the robot should move linearly.


PythonInstruction

A python instruction to execute.

For example this could be used for advanced logging or GUI updates / animations.

Attributes:

Name Type Description
name str

The name of the instruction used for logging.

block Callable

the python callable to execute

*args

additional arguments for the callable

**kwargs

additional keyword arguments for the callable


PyAnimationInstruction

Simple animation instruction.

Attributes:

Name Type Description
name str

The name of the animation used for logging.

animation Callable

the python callable to execute

*args

additional arguments for the callable

**kwargs

additional keyword arguments for the callable