Startup
This commit is contained in:
23
script/tasks/ColdPositionTimeout.py
Normal file
23
script/tasks/ColdPositionTimeout.py
Normal file
@@ -0,0 +1,23 @@
|
||||
cold_position_timeout = int(get_setting("cold_position_timeout"))
|
||||
if cold_position_timeout > 0:
|
||||
if robot.last_command_position == "cold":
|
||||
if (time.time() - robot.last_command_timestamp) > cold_position_timeout:
|
||||
if robot.is_cold():
|
||||
log("Detected cold position timeout", False)
|
||||
if get_context().state == State.Ready:
|
||||
if robot.state == State.Ready:
|
||||
if feedback_psys_safety.take() == True:
|
||||
#TODO: Chan
|
||||
get_context().evalLine("dry(wait_cold = -1)") #Dry and park : use get_context().evalLine to change application state
|
||||
else:
|
||||
raise Exception("Cannot clear cold position: feedback_psys_safety = False ")
|
||||
else:
|
||||
raise Exception("Cannot clear cold position: robot state: " + str(robot.state))
|
||||
else:
|
||||
raise Exception("Cannot clear cold position: system state: " + str(get_context().state))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user