Skip to content

Commit 83aae43

Browse files
committed
rajant_parser will notify of radios that are not listed in the radio_configs
1 parent d6ae7e8 commit 83aae43

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

interface_rajant/scripts/rajant_parser.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ def update_dict(self, data):
6868
peer = wireless_keys
6969
if 'rssi' in state[wireless_channel][peer].keys():
7070
mac = state[wireless_channel][peer]['mac']
71+
if mac not in self.MAC_DICT.keys():
72+
rospy.logerr(f"MAC: {mac} is not in the list of knowns MACs. Is your radio_configs.yaml file correct?")
73+
continue
7174
rssi = state[wireless_channel][peer]['rssi']
7275
self.MAC_DICT[mac]['rssi'] = rssi
7376
self.MAC_DICT[mac]['timestamp'] = rospy.Time.now()
@@ -81,6 +84,9 @@ def update_dict(self, data):
8184
f"active radio {self.MAC_DICT[mac]['radio']} not assigned to any robot")
8285
elif 'mac' in state[wireless_channel][peer].keys() and 'rssi' not in state[wireless_channel][peer].keys():
8386
mac = state[wireless_channel][peer]['mac']
87+
if mac not in self.MAC_DICT.keys():
88+
rospy.logerr(f"MAC: {mac} is not in the list of knowns MACs. Is your radio_configs.yaml file correct?")
89+
continue
8490
if rospy.Time.now()-self.MAC_DICT[mac]['timestamp'] > dt:
8591
self.MAC_DICT[mac]['rssi'] = no_rssi
8692
# Only publish if the publisher is not None

0 commit comments

Comments
 (0)