File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -850,8 +850,18 @@ A typical automated workflow could look like this:
850850import franky
851851
852852with franky.RobotWebSession(" 172.16.0.2" , " username" , " password" ) as robot_web_session:
853- # First take control, in case some other web session is currently running
854- assert robot_web_session.take_control(), " Control not granted"
853+ # First take control
854+ try :
855+ # Try taking control. The session currently holding control has to release it in order for this session to gain
856+ # control. In the web interface, a notification will show prompting the user to release control. If the other
857+ # session is another franky.RobotWebSession, then the `release_control` method can be called on the other
858+ # session to release control.
859+ robot_web_session.take_control(wait_timeout = 10.0 )
860+ except franky.TakeControlTimeoutError:
861+ # If nothing happens for 10s, we try to take control forcefully. This is particularly useful if the session
862+ # holding control is dead. Taking control by force requires the user to manually push the blue button close to
863+ # the robot's wrist.
864+ robot_web_session.take_control(wait_timeout = 30.0 , force = True )
855865
856866 # Unlock the brakes
857867 robot_web_session.unlock_brakes()
You can’t perform that action at this time.
0 commit comments