hexiposi improvements from x06sa
This commit is contained in:
@@ -11,8 +11,8 @@ class Hexiposi(DiscretePositionerBase):
|
||||
url = "http://" + url
|
||||
if not url.endswith(":"):
|
||||
url = url + ":"
|
||||
self.url_set = url + str (self.PORT_SET)+ "/hexiposi/" #"/TellWeb/"
|
||||
self.url_get = url + str (self.PORT_GET)+ "/hexiposi/" #"/TellWeb/"
|
||||
self.url_set = url + str (self.PORT_SET)+ "/hexiposi/"
|
||||
self.url_get = url + str (self.PORT_GET)+ "/hexiposi/"
|
||||
self.moved = True
|
||||
self.homing_state = State.Disabled
|
||||
self.rback = self.UNKNOWN_POSITION
|
||||
@@ -117,14 +117,18 @@ class Hexiposi(DiscretePositionerBase):
|
||||
|
||||
#Retrying after end of move -> once in a while move raises a not in position exception.
|
||||
def assertInPosition(self, pos):
|
||||
retries = 3
|
||||
poll_interval = 2.0
|
||||
max_turn_time = 8.0 # s
|
||||
retries = int(max_turn_time / poll_interval)
|
||||
for i in range(retries):
|
||||
#st = self.get_status()
|
||||
#print "asserting hexiposi in position " + pos + " --- moving:" + str(st["moving"]) + " --- state:" + str(self.getState())
|
||||
try:
|
||||
super(Hexiposi, self).assertInPosition(pos)
|
||||
return
|
||||
except:
|
||||
if i <(retries-1):
|
||||
time.sleep(0.5)
|
||||
if i < retries - 1:
|
||||
time.sleep(poll_interval)
|
||||
else:
|
||||
raise
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import random
|
||||
import time
|
||||
def hexiposi_tester(num_moves = 10, wait = 3.0):
|
||||
release_safety()
|
||||
for n in range(num_moves):
|
||||
pos = random.choice("ABCDEF")
|
||||
print str(n) + " of " + str(num_moves) + ") moving to " + pos
|
||||
hexiposi.move(pos)
|
||||
#print " sleep " + str(wait) + " s"
|
||||
time.sleep(wait)
|
||||
|
||||
print " done "
|
||||
|
||||
+9
-1
@@ -94,6 +94,14 @@ cold_position_timeout = get_setting("cold_position_timeout")
|
||||
if cold_position_timeout is None:
|
||||
set_setting("cold_position_timeout", 0)
|
||||
|
||||
def blower_on():
|
||||
robot.evaluate("doFOut1=true")
|
||||
|
||||
|
||||
def blower_off():
|
||||
robot.evaluate("doFOut1=false")
|
||||
|
||||
|
||||
|
||||
def is_room_temperature_enabled():
|
||||
setting = get_setting(ROOM_TEMPERATURE_ENABLED_PREFERENCE)
|
||||
@@ -467,4 +475,4 @@ restore_samples_info()
|
||||
|
||||
|
||||
print "Initialization complete"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user