powerOn

abstract suspend fun powerOn(): Result<String>

Powers on the robot arm and releases the brakes to reach "normal mode" via the Dashboard Server.

This function sends a series of commands to the UR robot via the dashboard server to fully power it on and make it ready for operation. The following steps are executed in order:

  1. Close any open popup dialogs.

  2. Close any active safety popups.

  3. Unlock a protective stop if one is active.

  4. Power on the robot.

  5. Release the brakes.

Return

Result containing combined response strings on success, or an Exception on failure. Response messages include:

  • "closing popup"

  • "closing safety popup"

  • "Protective stop releasing"

  • "Powering on"

  • "Brake releasing"

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 }

    println( ur.powerOn().getOrThrow() )

    /* Do something */

    println( ur.powerOff().getOrThrow() )
} 
   //sampleEnd
}