fetch Safety Status
Queries the safety status via the dashboard server.
Return
Result containing the response string on success, or an Exception on failure. Response messages may include: "Safetystatus: <status>", where status is
"NORMAL""REDUCED""PROTECTIVE_STOP""RECOVERY""SAFEGUARD_STOP""SYSTEM_EMERGENCY_STOP""ROBOT_EMERGENCY_STOP""VIOLATION""FAULT""AUTOMATIC_MODE_SAFEGUARD_STOP""SYSTEM_THREE_POSITION_ENABLING_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.fetchSafetyStatus().getOrElse { it.message }
println(result)
}
//sampleEnd
}