diff --git a/robots/emc/loclistener.in b/robots/emc/loclistener.in index 2bccda39fdeb6f4c4a934620174984bb91ec6b65..3642fa15ad925ce3a5fa084c59ac90c9cc9a2f1c 100644 --- a/robots/emc/loclistener.in +++ b/robots/emc/loclistener.in @@ -99,13 +99,18 @@ class LocationInfoUpdater(EventClient): try: key, value = arg.split('=') if key == "X" or key == "x": - update["loc_x"] = str( - float(value) * pixels_per_meter) + update["loc_x"] = float(value) * pixels_per_meter + if update["loc_x"] < 0.0: + update["loc_x"] = 0.0 + pass + update["loc_x"] = str(update["loc_x"]) pass elif key == "Y" or key == "y": - # XXX 520 is hardcoded - update["loc_y"] = str( - 520 - float(value) * pixels_per_meter) + update["loc_y"] = float(value) * pixels_per_meter + if update["loc_y"] < 0.0: + update["loc_y"] = 0.0 + pass + update["loc_y"] = str(update["loc_y"]) pass else: sys.stderr.write("warning: unknown key: %s\n" %