2 # -*- coding: iso-8859-15 -*-
11 rospy.init_node('wifi_strength')
13 tfBuffer = tf2_ros.Buffer()
14 listener = tf2_ros.TransformListener(tfBuffer)
15 regex_lq = re.compile("Link Quality=(\d*)/(\d*)")
16 while not rospy.is_shutdown():
17 f = os.popen("export LANG=C; /sbin/iwconfig wlan0")
20 match_lq = regex_lq.match(line)
21 if match_lq is not None:
22 lq = float(match_lq.group(1)) / float(match_lq.group(2))
23 pos = tfBuffer.lookup_transform("map", 'base_link', rospy.Time(0), rospy.Duration(1.0))
24 print '{"x":%.2f, "y":%.2f, "link":%.2f},' % (pos.transform.translation.x, pos.transform.translation.y, lq)