releaseInt

abstract fun releaseInt(width: Double, force: Int, speed: Int, cmdTimeout: Long? = null, popupMsg: Boolean = true, onChange: (TFGToolState) -> Unit? = null, onFinished: (TFGToolState) -> Unit? = null): TFGToolState

Internal release: close the 2FG gripper to release an object held from the inside.

This method represents the internal release operation of the OnRobot 2FG7 and 2FG14 grippers. The fingers move inward to disengage from the inner walls of a cavity, tube, or hole. Although internally similar to gripInt, it is provided as a separate command for clearer semantics and a better developer experience.

Return

TFGToolState continuously updated execution state of the URScript.

Parameters

width

target finger distance (mm).

force

release force (N).

speed

release speed (mm/s).

cmdTimeout

maximum time (in milliseconds) to wait for the command to complete.

popupMsg

enable/disable popup messages on Polyscope.

onChange

⚠️ Experimental: optional callback that is invoked whenever the TFGToolState changes during execution. This API is experimental and may change or be removed in future versions.

onFinished

optional callback that is invoked once when the TFGToolState 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")
val tfg = ur.attachToolOnRobotTFG(host = "192.168.2.2", toolIndex = 0)

runBlocking {
    ur.connect()
    ur.isConnectedFlow.first { it }
    val state = tfg.releaseInt(
        width = 0.0,
        force = 100,
        speed = 100,
        cmdTimeout = 5000,
        popupMsg = false,
        onChange = null,
        onFinished = { state -> /* do something */}
    ).await() // await for the finale state
    println(state)
} 
   //sampleEnd
}