com.kuka.motion
Interface IMotionContainer


public interface IMotionContainer

Represents the execution state of robot motions.


Method Summary
 void append(IMotion motion)
          Appends a motion to the executing motions.
 void await()
          Blocks the calling thread until the container has finished it's execution.
 void await(long timeout, TimeUnit unit)
          Blocks the calling thread until the container has finished it's execution.
 void cancel()
          Cancels all motions in this container.
 IMotion getCurrentMotion()
          Returns the motion command that is being currently executed.
 String getErrorMessage()
          Gets the error message for the container.
 ICondition getFiredBreakCondition()
          Gets the user condition that has fired and caused the stopping of this motion container.
 IMotion getLastExecutedMotion()
          Returns the last executed motion command, if the container is already finished.
 ICommandRuntimeData getRuntimeData()
          Gets the custom runtime data associated with this container.
 MotionContainerState getState()
          Returns the current state of this motion container.
 boolean hasError()
          Checks if this container is in an error state.
 boolean hasFired(ICondition condition)
          Tests whether the given condition has fired for this container. this is equivalent to
{@code getFiredConditionInfo() !
 boolean isFinished()
          Checks if the container has finished it's execution either with a successful execution or with an error.
 

Method Detail

getCurrentMotion

IMotion getCurrentMotion()
Returns the motion command that is being currently executed. This is the part of the robot trajectory where the robot is currently moving.

If the motion consists of segments (for example spline command), the currently executed segment of the spline will be returned.

Returns:
the commanded motion that is currently being executed. For spline commands this refers to the currently executing segment.
This is the same object that has been passed when commanding the motion.
If execution is not started yet or has been finished, returns null.

getLastExecutedMotion

IMotion getLastExecutedMotion()
Returns the last executed motion command, if the container is already finished.

If not, the motion that is currently being executed will be returned. This is the part of the robot trajectory where the robot is currently moving.
If the motion consists of segments (for example spline command), the currently executed segment of the spline will be returned.

Returns:
the last executed motion or the commanded motion that is currently being executed. For spline commands this refers to the currently executing segment.
This is the same object that has been passed when commanding the motion.
If execution is not started yet, returns null.
When the container is finished (also because of break condition or error), returns the last executed motion.

append

void append(IMotion motion)
Appends a motion to the executing motions. Can be called as long as the motions are executing. Appended motions can be blended, if applicable.

Parameters:
motion - the motion to be appended
Throws:
UnsupportedOperationException - appending of motions is not supported for this type or this particular combination of motions
IllegalStateException - the execution of the stack has already been finished.

cancel

void cancel()
Cancels all motions in this container.


await

void await()
Blocks the calling thread until the container has finished it's execution. If the container is invalid or was canceled, an appropriate exception will be thrown.

Throws:
ThreadInterruptedException - if the thread was interrupted while waiting

await

void await(long timeout,
           TimeUnit unit)
           throws TimeoutException
Blocks the calling thread until the container has finished it's execution. Only blocks the thread until the timeout is reached. If the container is invalid or was canceled, an appropriate exception will be thrown.

Parameters:
timeout - The timeout.
unit - The unit of the timeout.
Throws:
ThreadInterruptedException - if the thread was interrupted while waiting
TimeoutException - the wait timed out

getState

MotionContainerState getState()
Returns the current state of this motion container.

Caution: Because this method is not synchronized to the motion container, its current state might have progressed to another state by the time this method returns.

Returns:
the current motion container state

isFinished

boolean isFinished()
Checks if the container has finished it's execution either with a successful execution or with an error. If you like to see if an error occurred, you have to check the error message or call the method hasError().

Returns:
true if the container execution is finished, otherwise false.

hasError

boolean hasError()
Checks if this container is in an error state.

Returns:
true if this container is in an error state.

getErrorMessage

String getErrorMessage()
Gets the error message for the container.

Returns:
The error message.

hasFired

boolean hasFired(ICondition condition)
Tests whether the given condition has fired for this container. this is equivalent to
getFiredConditionInfo() != null && getFiredConditionInfo().getFiredCondition() == condition

Parameters:
condition - the condition to test if it has fired.
Returns:
true if the condition has fired, false otherwise.
This element is not in its final state and might change in future versions.

getFiredBreakCondition

ICondition getFiredBreakCondition()
Gets the user condition that has fired and caused the stopping of this motion container. May be null if no user defined condition has fired.

HINT regarding motion batches: if the motion contained in this container is a motion batch, only the fired condition of the batch itself shows up in the info. The stop conditions that may have fired on the motions within the batch don't stop the batch. That's why in this case the fired condition info will be null.

Returns:
The user defined condition that has fired and caused the stopping of this motion. May be null.

getRuntimeData

ICommandRuntimeData getRuntimeData()
Gets the custom runtime data associated with this container.

Returns:
the custom runtime data associated with this container. Can be null.


Copyright © 2019. All rights reserved.