State and errors
Robot state
State |
Dictionary key |
Unit |
Data type |
---|---|---|---|
Axis - specific (joint) actual position |
|
|
|
Axis-specific (joint) actual velocity internally calculated as the position difference in 1/100 second interval |
|
|
|
External acting torques without the component resulting from the robot weight and mass inertias during motion |
|
|
|
Cartesian position (X,Y,Z) |
|
|
|
Cartesian orientation (A,B,C) |
|
|
|
External Cartesian forces (X,Y,Z) |
|
|
|
External Cartesian torques (A,B,C) |
|
|
|
Last registered error code. See Errors |
|
|
|
Whether motion has terminated due to a break condition |
|
|
|
Whether the robot is ready for motion. A true value does not necessarily mean that the brakes are open and that the robot is under servo control |
|
|
|
Whether the robot is active. It does not provide any information on whether the robot is currently in motion (a false value does not necessarily mean that the robot is stationary) |
|
|
get_state
- LibIiwa.get_state(refresh: bool = False) Mapping[str, ndarray]
Get the state of the robot
- Parameters:
refresh (bool, optional) – If True, the state is requested from the robot otherwise the last received state is returned (default: False)
- Returns:
The state of the robot
- Return type:
Example:
>>> # get an updated robot state >>> iiwa.get_state(refresh=True) {'joint_position': array([0., 0., 0., 0., 0., 0., 0.], dtype=float32), 'joint_velocity': array([0., 0., 0., 0., 0., 0., 0.], dtype=float32), 'joint_acceleration': array([0., 0., 0., 0., 0., 0., 0.], dtype=float32), 'joint_torque': array([0., 0., 0., 0., 0., 0., 0.], dtype=float32), 'cartesian_position': array([0., 0., 0.], dtype=float32), 'cartesian_orientation': array([0., 0., 0.], dtype=float32), 'cartesian_force': array([0., 0., 0.], dtype=float32), 'cartesian_torque': array([0., 0., 0.], dtype=float32)} >>> # get the last updated robot state >>> iiwa.get_state(refresh=False) # or just `iiwa.get_state()` {'joint_position': array([0., 0., 0., 0., 0., 0., 0.], dtype=float32), 'joint_velocity': array([0., 0., 0., 0., 0., 0., 0.], dtype=float32), 'joint_acceleration': array([0., 0., 0., 0., 0., 0., 0.], dtype=float32), 'joint_torque': array([0., 0., 0., 0., 0., 0., 0.], dtype=float32), 'cartesian_position': array([0., 0., 0.], dtype=float32), 'cartesian_orientation': array([0., 0., 0.], dtype=float32), 'cartesian_force': array([0., 0., 0.], dtype=float32), 'cartesian_torque': array([0., 0., 0.], dtype=float32)}
Errors
Operation errors |
Enum ( |
---|---|
The robot has been configured to work with incompatible control settings |
|
Validation of the load model for impedance control to use servo motions has failed |
|
Asynchronous motion command execution failed |
|
Synchronous motion command execution failed |
|
Joint subscript is out of range |
|
An operation or function receives an argument that has the right type but an inappropriate value |
|
No error. This is not a guarantee that there are no errors |
|
- class libiiwa.Error(value)
Bases:
Enum
An enumeration.
- ASYNCHRONOUS_MOTION_ERROR = -14
- INVALID_CONFIGURATION_ERROR = -16
- INVALID_JOINT_ERROR = -12
- NO_ERROR = -10
- SYNCHRONOUS_MOTION_ERROR = -13
- UNKNOW_ERROR = 0
- VALIDATION_FOR_IMPEDANCE_ERROR = -15
- VALUE_ERROR = -11
get_last_error
- LibIiwa.get_last_error(clear_after_read: bool = True) Error
Get the last error message from the robot
If there is no error,
Error.NO_ERROR
enum will be returned- Parameters:
clear_after_read (bool, optional) – If True, the internal error flag will be reset after this call (default: True).
- Returns:
The last error message from the robot
- Return type:
Example:
>>> # no errors >>> iiwa.get_last_error() <Error.NO_ERROR: -10>