unlockProtectiveStop

abstract suspend fun unlockProtectiveStop(): Result<String>

Closes the current popup (Polyscope) and unlocks protective stop via the dashboard server. The unlock protective stop command fails if less than 5 seconds has passed since the protective stop occurred.

Return

Result containing the response string on success, or an Exception on failure. Response messages may include:

  • "Protective stop releasing"

  • "Cannot unlock protective stop ..."

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 {
    val result = ur.unlockProtectiveStop().getOrElse { it.message }
    println(result)
} 
   //sampleEnd
}