def rhMonitorThread (memory_service):
global last_personid
t = threading.currentThread()
print "personbehind thread started"
personid = 0
while getattr(t, "do_run", True):
v = 'false'
try:
pdist = memory_service.getData("Device/SubDeviceList/Platform/Back/Sonar/Sensor/Value")
#distance to consider that the person following
#print "rear sonar dist: ", pdist
if (pdist < 1.5):
v = 'true'
except:
v = 'false'
set_condition(memory_service,'personbehind',v)
time.sleep(0.5)
print "personbehind thread quit"
评论列表
文章目录