The API.MOTION class provides a comprehensive set of interfaces for controlling and monitoring robot motion. It includes methods for jogging, aligning, and moving the robot to specific positions, as well as retrieving and setting tools, work objects, and coordinate systems. This class simplifies motion control operations, enabling developers to efficiently interact with and manage the robot's movement and positioning.
- Source
Members
(readonly) COORDS :string
- string
| Name | Type | Description |
|---|---|---|
Wobj | enum | The work object coordinate system |
Base | enum | The Base coordinate system |
Tool | enum | The Tool coordinate system |
World | enum | The World coordinate system |
Current | enum | The active coordinate system |
Wobj | string | |
Base | string | |
Tool | string | |
World | string | |
Current | string |
- Source
(readonly) JOGMODE :string
- string
| Name | Type | Description |
|---|---|---|
Align | string | |
GoToPos | string | |
ConfigurationJog | string | |
Cartesian | string | |
AxisGroup1 | string | |
AxisGroup2 | string | |
Current | string |
- Source
(readonly) POSITIONTYPES :number
- number
| Name | Type | Description |
|---|---|---|
robtarget | number | |
jointtarget | number |
- Source
Methods
align(speedRatio, tool, wobj, coord) → {undefined|Promise.<{}>}
Performs align task Non-SPOC systems (e.g., RobotWare 7): The interface shall work when the two conditions are met:
- Operation mode is manual reduce mode
- User logins as local client SPOC systems (e.g., RobotWare 8): The interface shall work when the two conditions are met:
- Operation mode is manual reduce mode
- Write access is held
| Name | Type | Description |
|---|---|---|
speedRatio | number | Align speed ratio, whose value range is 1 to 100. |
tool | API. | If empty, use active tool as align tool |
wobj | API. | If empty, use active wobj as align wobj |
coord | API. | If empty, use active coord as align coord |
- Source
- Resolves if aligning succeeds, rejects if fails
- Type:
- undefined |
Promise.<{}>
await API.MOTION.align(10)executeJogging(jogMode, optionsopt) → {Promise.<(object|void)>}
Jogs the robot Non-SPOC systems (e.g., RobotWare 7): The interface shall work when the two conditions are met:
- Operation mode is manual reduce mode
- User logins as local client SPOC systems (e.g., RobotWare 8): The interface shall work when the two conditions are met:
- Operation mode is manual reduce mode
- Write access is held
| Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
jogMode | JOGMODE | Jogging mode | |||||||||||||||||||||||||||||||
options | Object | <optional> | Optional jogging options Properties
|
- Source
- Resolves if jogging succeeds, rejects if failure
- Type:
- Promise.<(object|void)>
// Perform aligning
await API.MOTION.executeJogging(API.MOTION.JOGMODE.Align)getAxisNumber() → {Promise.<number>}
Gets the axis number of the robot.
- Source
Axis number of the robot.
- Type:
- Promise.<number>
let axisNum = await API.MOTION.getAxisNumber()getCoord() → {Promise.<string>}
Gets the current coordinate system
- Source
A string describing the current coordinate system of the robot.
- Type:
- Promise.<string>
await API.MOTION.getCoord()getRobotPosition() → {Promise.<object>}
Gets the current position of the robot
- Source
- An object containing current position of the robot
- Type:
- Promise.<object>
await API.MOTION.getRobotPosition()getTool() → {Promise.<object>}
Gets the current tool
- Source
- Object containing current position of the robot
- Type:
- Promise.<object>
await API.MOTION.getTool()getWobj() → {Promise.<object>}
Gets the active work object
- Source
- An object containing current position of the robot
- Type:
- Promise.<object>
await API.MOTION.getWobj()goToPosition(speedRatio, targetPosition, tool, wobj, coord) → {undefined|Promise.<{}>}
Executes the GOTO task. Non-SPOC systems (e.g., RobotWare 7): The interface shall work when the two conditions are met:
- Operation mode is manual reduce mode
- User logins as local client SPOC systems (e.g., RobotWare 8): The interface shall work when the two conditions are met:
- Operation mode is manual reduce mode
- Write access is held
| Name | Type | Description |
|---|---|---|
speedRatio | number | GOTO movement speed ratio, whose value range is 1 to 100. |
targetPosition | RobTarget | | The target location of the GOTO task |
tool | API. | If empty, use active tool as align tool |
wobj | API. | If empty, use active wobj as align wobj |
coord | API. | If empty, use active coord as align coord |
- Source
- Resolves if the motion task is executed, rejects if failed
- Type:
- undefined |
Promise.<{}>
let variableValue = await API.RAPID.getVariableValue("MainModule","pos1");
await API.MOTION.goToPosition(10, variableValue)setTool(tool) → {Promise.<object>}
Sets the active tool to the specified value
| Name | Type | Description |
|---|---|---|
tool | string | Name of the tool |
- Source
Resolves if setting correctly, rejects if failed.
- Type:
- Promise.<object>
await API.MOTION.setTool("tool0")setWobj(value) → {Promise.<object>}
Sets the active work object to the specified value.
| Name | Type | Description |
|---|---|---|
value | string | Name of the work object. |
- Source
Resolves if setting correctly, rejects if failed.
- Type:
- Promise.<object>
await API.MOTION.setWobj("wobj0")stopJogging() → {undefined|Promise.<{}>}
Stops any running jog
- Source
Resolves if stopped correctly, rejects if failed.
- Type:
- undefined |
Promise.<{}>
await API.MOTION.stopJogging()teachPosition(type, tool, wobj, coords, mechunit) → {undefined|Promise.<{RobTarget}>|Promise.<{JointTarget}>}
Teaches a robot position.
| Name | Type | Description |
|---|---|---|
type | API. | Position type |
tool | string | The tool used to teach position |
wobj | string | The wobj used to teach position |
coords | string | The coordinate system used to teach position |
mechunit | string | The mechanical unit used to teach position |
- Source
- The teached position
- Type:
- undefined |
Promise.<{RobTarget}> | Promise.<{JointTarget}>
let position = await API.MOTION.teachPosition(API.MOTION.POSITIONTYPES.robtarget);Type Definitions
ExtAx
Properties| Name | Type | Description |
|---|---|---|
eax_a | number | |
eax_b | number | |
eax_c | number | |
eax_d | number | |
eax_e | number | |
eax_f | number |
- Source
JointTarget
Properties| Name | Type | Description |
|---|---|---|
robax | RobAx | |
extax | ExtAx |
- Source
RobAx
Properties| Name | Type | Description |
|---|---|---|
rax_1 | number | |
rax_2 | number | |
rax_3 | number | |
rax_4 | number | |
rax_5 | number | |
rax_6 | number |
- Source
RobConf
Properties| Name | Type | Description |
|---|---|---|
cf1 | number | |
cf4 | number | |
cf6 | number | |
cfx | number |
- Source
RobTarget
Properties| Name | Type | Description |
|---|---|---|
trans | Trans | |
rot | Rot | |
robconf | RobConf | |
extax | ExtAx |
- Source
Rot
Properties| Name | Type | Description |
|---|---|---|
q1 | number | |
q2 | number | |
q3 | number | |
q4 | number |
- Source
Trans
Properties| Name | Type | Description |
|---|---|---|
x | number | |
y | number | |
z | number |
- Source
executeJoggingProps
Properties| Name | Type | Attributes | Description |
|---|---|---|---|
tool | string | <optional> | |
wobj | string | <optional> | |
coords | COORDS | <optional> | |
jogMode | JOGMODE | <optional> | |
jogData | JogData | <optional> | |
robTarget | RobTarget | <optional> | |
jointTarget | JointTarget | <optional> | |
doJoint | boolean | <optional> |
- Source