movel
Move to position (linear in tool-space).
Return
ArmState representing the current URScript command execution state, which is continuously updated.
Parameters
target pose of the TCP (tool center point).
tool acceleration (m/s^2)
tool speed (m/s)
time to reach the target position (s).
blend radius (m).
maximum time (in milliseconds) to wait for the command to complete. If this time is exceeded, the command is considered failed and the ArmState will no longer be updated.
⚠️ Experimental: optional callback that is invoked whenever the ArmState changes during execution. This API is experimental and may change or be removed in future versions.
optional callback that is invoked once when the ArmState is final. The state is final when runningState assumes the following value: RunningState.END, RunningState.TIMEOUT, RunningState.CANCELED
Samples
import com.wolfscowl.ur_client.UR
import com.wolfscowl.ur_client.examples.Examples.ur
import com.wolfscowl.ur_client.interfaces.state.await
import com.wolfscowl.ur_client.interfaces.state.awaitBlocking
import com.wolfscowl.ur_client.interfaces.state.awaitBlockingUntil
import com.wolfscowl.ur_client.interfaces.state.awaitUntil
import com.wolfscowl.ur_client.model.element.JointPosition
import com.wolfscowl.ur_client.model.element.Pose
import com.wolfscowl.ur_client.model.element.RunningState
import com.wolfscowl.ur_client.model.element.Vec3
import com.wolfscowl.ur_client.model.robot_state.mode.RobotMode
import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.runBlocking
import kotlin.system.exitProcess
fun main() {
//sampleStart
val ur = UR("192.168.2.1")
runBlocking {
ur.connect()
ur.isConnectedFlow.first { it }
val state = ur.arm.movel(
p = Pose(
x = 0.545,
y = 0.133,
z = 0.409,
rx = 2.221,
ry = 0.000,
rz = 2.221
),
a = 0.8,
v = 0.2,
t = 0.0,
r = 0.0,
cmdTimeout = 100000,
onChange = null,
onFinished = { state -> /* Do something */ }
).await() // await for the finale state
println(state)
}
//sampleEnd
}Move to position (linear in tool-space).
Return
ArmState representing the current URScript command execution state, which is continuously updated.
Parameters
target joint positions. Then forward kinematics is used to calculate the corresponding pose.
tool acceleration (m/s^2)
tool speed (m/s)
time to reach the target position (s).
blend radius (m).
maximum time (in milliseconds) to wait for the command to complete. If this time is exceeded, the command is considered failed and the ArmState will no longer be updated.
⚠️ Experimental: optional callback that is invoked whenever the ArmState changes during execution. This API is experimental and may change or be removed in future versions.
optional callback that is invoked once when the ArmState is final. The state is final when runningState assumes the following value: RunningState.END, RunningState.TIMEOUT, RunningState.CANCELED
Samples
import com.wolfscowl.ur_client.UR
import com.wolfscowl.ur_client.examples.Examples.ur
import com.wolfscowl.ur_client.interfaces.state.await
import com.wolfscowl.ur_client.interfaces.state.awaitBlocking
import com.wolfscowl.ur_client.interfaces.state.awaitBlockingUntil
import com.wolfscowl.ur_client.interfaces.state.awaitUntil
import com.wolfscowl.ur_client.model.element.JointPosition
import com.wolfscowl.ur_client.model.element.Pose
import com.wolfscowl.ur_client.model.element.RunningState
import com.wolfscowl.ur_client.model.element.Vec3
import com.wolfscowl.ur_client.model.robot_state.mode.RobotMode
import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.runBlocking
import kotlin.system.exitProcess
fun main() {
//sampleStart
val ur = UR("192.168.2.1")
runBlocking {
ur.connect()
ur.isConnectedFlow.first { it }
val state = ur.arm.movel(
q = JointPosition(
base = Math.toRadians(180.00),
shoulder = Math.toRadians(-90.00),
elbow = Math.toRadians(110.00),
wrist1 = Math.toRadians(-220.00),
wrist2 = Math.toRadians(-90.00),
wrist3 = Math.toRadians(-90.00)
),
a = 0.8,
v = 0.2,
t = 0.0,
r = 0.0,
cmdTimeout = 100000,
onChange = null,
onFinished = { state -> /* Do something */ }
).await() // await for the finale state
println(state)
}
//sampleEnd
}