X-Git-Url: https://defiant.homedns.org/gitweb/?p=ros_wild_thumper.git;a=blobdiff_plain;f=scripts%2Fwifistrength.py;h=d8a989bbf4cae5eab91e7ea4217bbb3dea3552ef;hp=496c7b25ca5952392eba3aa485af2e81bbc29cfd;hb=2f194b3fe82009a77b79021f0c57e6ca55c1706f;hpb=cf1ec643629b1b2f3d33ab67ce4851714c02bf5a diff --git a/scripts/wifistrength.py b/scripts/wifistrength.py index 496c7b2..d8a989b 100755 --- a/scripts/wifistrength.py +++ b/scripts/wifistrength.py @@ -1,6 +1,7 @@ #!/usr/bin/env python # -*- coding: iso-8859-15 -*- +import sys import os import re import rospy @@ -21,5 +22,6 @@ while not rospy.is_shutdown(): if match_lq is not None: lq = float(match_lq.group(1)) / float(match_lq.group(2)) pos = tfBuffer.lookup_transform("map", 'base_link', rospy.Time(0), rospy.Duration(1.0)) - print "{'x':%.2f, 'y':%.2f, 'link':%.2f}," % (pos.transform.translation.x, pos.transform.translation.y, lq) + print '{"x":%.2f, "y":%.2f, "link":%.2f},' % (pos.transform.translation.x, pos.transform.translation.y, lq) + sys.stdout.flush() sleep(0.5)